public interface CMSEncryptionService
| Modifier and Type | Method and Description |
|---|---|
InputStream |
buildDecryptionInputStream(InputStream inputStream,
Function<Set<String>,Map<String,Key>> keysByIds)
Builds decrypted stream out of encrypted one.
|
OutputStream |
buildEncryptionOutputStream(OutputStream dataContentStream,
SecretKey secretKey,
KeyID secretKeyID)
Builds symmetrically encrypted stream.
|
OutputStream |
buildEncryptionOutputStream(OutputStream dataContentStream,
Set<PublicKeyIDWithPublicKey> publicKeys)
Builds asymmetrically encrypted stream using public-key cryptography.
|
OutputStream buildEncryptionOutputStream(OutputStream dataContentStream, Set<PublicKeyIDWithPublicKey> publicKeys)
dataContentStream - Stream to encryptpublicKeys - Contains user public key and
public-key ID which gets embedded into a stream, used for finding the private key to decryptdataContentStreamOutputStream buildEncryptionOutputStream(OutputStream dataContentStream, SecretKey secretKey, KeyID secretKeyID)
dataContentStream - Stream to encryptsecretKey - User secret keysecretKeyID - User key ID gets embedded into a stream, used for finding the key to decryptdataContentStreamInputStream buildDecryptionInputStream(InputStream inputStream, Function<Set<String>,Map<String,Key>> keysByIds)
inputStream - Stream to decryptkeysByIds - Key to its ID mapping function - you request for the set of key aliases and function returns
only those that were found as a map (key id - key), will retrieve key for decryption using this. Implemented
as a request once for many instead of iterating one-by-one to avoid possible concurrency issues.inputStreamCopyright © 2019. All rights reserved.