public interface ISymmetricCipherSuite extends ICipherSuite
| Modifier and Type | Method and Description |
|---|---|
IDecryptedInputStream |
createDecryptedInputStream(SecretKey key,
byte[] encryptedData) |
IEncryptedOutputStream |
createEncryptedOutputStream(SecretKey key) |
byte[] |
decrypt(SecretKey key,
byte[] cipherText)
Decrypt the given Base64 encoded cipher test using the given key.
|
byte[] |
encrypt(SecretKey secretKey,
byte[] data)
Encrypt the given binary data with the given key and return a Base64
encoded String containing the encrypted form.
|
SecretKey |
generateKey() |
SymmetricCipher |
getId()
Get the unique ID for this cipher suite.
|
int |
getKeySize(SecretKey key) |
PrivateKey |
unwrap(byte[] cipherText,
SecretKey userKey,
IAsymmetricCipherSuite cipherSuite)
Unwrap the given encrypted PrivateKey
|
byte[] |
wrap(PrivateKey key,
SecretKey userKey)
Wrap the given asymmetric key by encrypting with the given user's secret key.
|
getCipher, getKeyAlgorithm, getKeySizeSymmetricCipher getId()
SecretKey generateKey()
byte[] encrypt(SecretKey secretKey, byte[] data) throws GeneralSecurityException
secretKey - Encryption keydata - Plain text.GeneralSecurityExceptionbyte[] decrypt(SecretKey key, byte[] cipherText) throws GeneralSecurityException
key - Decryption key.cipherText - ciphertext.GeneralSecurityExceptionIDecryptedInputStream createDecryptedInputStream(SecretKey key, byte[] encryptedData) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionIEncryptedOutputStream createEncryptedOutputStream(SecretKey key) throws IOException
IOExceptionbyte[] wrap(PrivateKey key, SecretKey userKey) throws GeneralSecurityException
key - Key to be wrapped.userKey - Secret key of user for whom it is wrapped.GeneralSecurityExceptionPrivateKey unwrap(byte[] cipherText, SecretKey userKey, IAsymmetricCipherSuite cipherSuite) throws GeneralSecurityException
cipherText - Encrypted key to be unwrapped.userKey - Wrapping key.cipherSuite - Wrapping cipherSuiteGeneralSecurityExceptionint getKeySize(SecretKey key)
Copyright © 2018 Symphony Software Foundation. All rights reserved.