public class StreamingHybridEncryptionScheme extends java.lang.Object implements StreamingEncryptionScheme
| Modifier and Type | Class and Description |
|---|---|
static class |
StreamingHybridEncryptionScheme.HybridCipherText |
| Constructor and Description |
|---|
StreamingHybridEncryptionScheme(org.cryptimeleon.math.serialization.Representation repr) |
StreamingHybridEncryptionScheme(StreamingEncryptionScheme symmetricScheme,
KeyEncapsulationMechanism<SymmetricKey> kem2) |
| Modifier and Type | Method and Description |
|---|---|
java.io.OutputStream |
createDecryptor(java.io.OutputStream out,
DecryptionKey privateKey)
Returns an OutputStream that decrypts any bytes written to it
and writes the resulting plaintext to out.
|
java.io.OutputStream |
createEncryptor(java.io.OutputStream out,
EncryptionKey publicKey)
Returns an OutputStream that encrypts any bytes written to it
and writes the resulting ciphertext to out.
|
PlainText |
decrypt(CipherText cipherText,
DecryptionKey privateKey)
Decrypts the given cipher text using the given decryption key.
|
java.io.InputStream |
decrypt(java.io.InputStream in,
DecryptionKey privateKey)
Returns an InputStream containing the plaintext obtained
by decrypting the content of in.
|
java.io.InputStream |
encrypt(java.io.InputStream in,
EncryptionKey publicKey)
Returns an InputStream containing the ciphertext obtained
by encrypting the content of in.
|
CipherText |
encrypt(PlainText plainText,
EncryptionKey publicKey)
Encrypts the given plain text using the given encryption key.
|
boolean |
equals(java.lang.Object obj) |
KeyEncapsulationMechanism<SymmetricKey> |
getKeyEncapsulationMechanism() |
org.cryptimeleon.math.serialization.Representation |
getRepresentation() |
int |
hashCode() |
CipherText |
restoreCipherText(org.cryptimeleon.math.serialization.Representation repr)
Restores the ciphertext corresponding to the given representation.
|
DecryptionKey |
restoreDecryptionKey(org.cryptimeleon.math.serialization.Representation repr)
Restores the decryption key corresponding to the given representation.
|
EncryptionKey |
restoreEncryptionKey(org.cryptimeleon.math.serialization.Representation repr)
Restores the encryption key corresponding to the given representation.
|
PlainText |
restorePlainText(org.cryptimeleon.math.serialization.Representation repr)
Restores the plaintext corresponding to the given representation.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitdecrypt, encryptdecrypt, encrypt, restoreFromRepresentationpublic StreamingHybridEncryptionScheme(StreamingEncryptionScheme symmetricScheme, KeyEncapsulationMechanism<SymmetricKey> kem2)
public StreamingHybridEncryptionScheme(org.cryptimeleon.math.serialization.Representation repr)
public CipherText encrypt(PlainText plainText, EncryptionKey publicKey)
EncryptionSchemeencrypt in interface EncryptionSchemeplainText - the plaintext to encryptpublicKey - the key to use for encryptionpublic PlainText decrypt(CipherText cipherText, DecryptionKey privateKey)
EncryptionSchemedecrypt in interface EncryptionSchemecipherText - the ciphertext to decryptprivateKey - the key to use for decryptionpublic PlainText restorePlainText(org.cryptimeleon.math.serialization.Representation repr)
EncryptionSchemerestorePlainText in interface EncryptionSchemerepr - the representation to restore the plaintext frompublic CipherText restoreCipherText(org.cryptimeleon.math.serialization.Representation repr)
EncryptionSchemerestoreCipherText in interface EncryptionSchemerepr - the representation to restore the ciphertext frompublic EncryptionKey restoreEncryptionKey(org.cryptimeleon.math.serialization.Representation repr)
EncryptionSchemerestoreEncryptionKey in interface EncryptionSchemerepr - the representation to restore the encryption key frompublic DecryptionKey restoreDecryptionKey(org.cryptimeleon.math.serialization.Representation repr)
EncryptionSchemerestoreDecryptionKey in interface EncryptionSchemerepr - the representation to restore the decryption key frompublic org.cryptimeleon.math.serialization.Representation getRepresentation()
getRepresentation in interface org.cryptimeleon.math.serialization.Representablepublic java.io.InputStream encrypt(java.io.InputStream in,
EncryptionKey publicKey)
throws java.io.IOException
StreamingEncryptionSchemeNote that calling this may already cause some bytes to be read from in.
encrypt in interface StreamingEncryptionSchemein - stream containing the bytes to encryptpublicKey - the key to encrypt withjava.io.IOExceptionpublic java.io.OutputStream createEncryptor(java.io.OutputStream out,
EncryptionKey publicKey)
throws java.io.IOException
StreamingEncryptionSchemeNote that calling this may already cause some bytes to be written to out.
createEncryptor in interface StreamingEncryptionSchemeout - the stream to write the ciphertext to.publicKey - the key to encrypt with.java.io.IOExceptionpublic java.io.InputStream decrypt(java.io.InputStream in,
DecryptionKey privateKey)
throws java.io.IOException
StreamingEncryptionSchemeNote that calling this may already cause some bytes to be read from in.
decrypt in interface StreamingEncryptionSchemein - in stream containing the bytes to decryptprivateKey - the key to decrypt with.java.io.IOExceptionpublic java.io.OutputStream createDecryptor(java.io.OutputStream out,
DecryptionKey privateKey)
StreamingEncryptionSchemeNote that calling this may already cause some bytes to be written to out.
createDecryptor in interface StreamingEncryptionSchemeout - the stream to write the plaintext to.privateKey - the key to decrypt with.public KeyEncapsulationMechanism<SymmetricKey> getKeyEncapsulationMechanism()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object