public class MessageEncryptionHelper extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
MessageEncryptionHelper.KeyTransportRecipientInfo |
Modifier and Type | Field and Description |
---|---|
static String |
AES_ALGORITHM |
static int |
AES_INITIALIZATION_VECTOR_LENGTH |
static int |
AES_KEY_SIZE_BYTES |
static String |
DEFAULT_KEY_ENCRYPTION_ALGORITHM |
static String |
DEFAULT_MESSAGE_ENCRYPTION_CIPHER_NAME |
static String |
ENCRYPT_HEADER |
static String |
ENCRYPT_RECIPIENTS_HEADER |
static String |
ENCRYPTED_KEYS_PROPERTY |
static String |
ENCRYPTION_ALGORITHM_PROPERTY |
static String |
KEY_INIT_VECTOR_PROPERTY |
static String |
UNENCRYPTED_PROPERTIES_HEADER |
Constructor and Description |
---|
MessageEncryptionHelper(AMQSession<?,?> session) |
Modifier and Type | Method and Description |
---|---|
SecretKeySpec |
createSecretKey() |
byte[] |
encrypt(SecretKeySpec secretKey,
byte[] unencryptedBytes,
byte[] ivbytes) |
PrivateKey |
getEncryptionPrivateKey(X500Principal issuer,
BigInteger serialNumber) |
byte[] |
getInitialisationVector() |
String |
getKeyEncryptionAlgorithm() |
List<MessageEncryptionHelper.KeyTransportRecipientInfo> |
getKeyTransportRecipientInfo(List<String> recipients,
SecretKeySpec secretKey) |
String |
getMessageEncryptionCipherName() |
X509Certificate |
getSigningCertificate(String name) |
KeyStore |
getSigningCertificateStore() |
byte[] |
readFromCipherStream(byte[] unencryptedBytes,
Cipher cipher,
AMQSession amqSession) |
byte[] |
readFromCipherStream(byte[] unencryptedBytes,
int offset,
int length,
Cipher cipher) |
void |
setKeyEncryptionAlgorithm(String keyEncryptionAlgorithm) |
void |
setMessageEncryptionCipherName(String messageEncryptionCipherName) |
public static final String ENCRYPTION_ALGORITHM_PROPERTY
public static final String KEY_INIT_VECTOR_PROPERTY
public static final String ENCRYPTED_KEYS_PROPERTY
public static final String ENCRYPT_HEADER
public static final String ENCRYPT_RECIPIENTS_HEADER
public static final String UNENCRYPTED_PROPERTIES_HEADER
public static final int AES_KEY_SIZE_BYTES
public static final String AES_ALGORITHM
public static final String DEFAULT_MESSAGE_ENCRYPTION_CIPHER_NAME
public static final int AES_INITIALIZATION_VECTOR_LENGTH
public static final String DEFAULT_KEY_ENCRYPTION_ALGORITHM
public MessageEncryptionHelper(AMQSession<?,?> session)
public String getKeyEncryptionAlgorithm()
public void setKeyEncryptionAlgorithm(String keyEncryptionAlgorithm)
public String getMessageEncryptionCipherName()
public void setMessageEncryptionCipherName(String messageEncryptionCipherName)
public KeyStore getSigningCertificateStore() throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public List<MessageEncryptionHelper.KeyTransportRecipientInfo> getKeyTransportRecipientInfo(List<String> recipients, SecretKeySpec secretKey) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public X509Certificate getSigningCertificate(String name) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public PrivateKey getEncryptionPrivateKey(X500Principal issuer, BigInteger serialNumber) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public SecretKeySpec createSecretKey()
public byte[] getInitialisationVector()
public byte[] readFromCipherStream(byte[] unencryptedBytes, int offset, int length, Cipher cipher) throws IOException
IOException
public byte[] readFromCipherStream(byte[] unencryptedBytes, Cipher cipher, AMQSession amqSession) throws IOException
IOException
public byte[] encrypt(SecretKeySpec secretKey, byte[] unencryptedBytes, byte[] ivbytes)
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.