public class EncryptionConfig
extends java.lang.Object
S3EncryptionClient
.
Both keystore keys and bare RSA KeyPairs are supported. You can optionally implement your own
KeyProvider
as well.Constructor and Description |
---|
EncryptionConfig(EncryptionConfig other)
Cloning constructor.
|
EncryptionConfig(java.security.KeyPair masterEncryptionKey,
java.util.Set<java.security.KeyPair> decryptionKeys)
Creates a new EncryptionConfig object that uses bare KeyPair objects.
|
EncryptionConfig(com.emc.codec.encryption.KeyProvider keyProvider) |
EncryptionConfig(java.security.KeyStore keystore,
char[] masterKeyPassword,
java.lang.String masterKeyAlias)
Creates a new EncryptionConfig object that will retrieve keys from a Keystore
object.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getCodecProperties() |
java.lang.String |
getCompressionSpec() |
java.lang.String |
getEncryptionSpec() |
com.emc.codec.encryption.KeyProvider |
getKeyProvider() |
int |
getKeySize() |
java.security.Provider |
getSecurityProvider() |
boolean |
isCompressionEnabled() |
void |
setCodecProperties(java.util.Map<java.lang.String,java.lang.Object> codecProperties) |
void |
setCompressionEnabled(boolean compressionEnabled)
If set to true, will enable compression for objects created with the encryption client.
|
void |
setCompressionSpec(java.lang.String compressionSpec)
Sets the compression spec to use for compression.
|
void |
setEncryptionSpec(java.lang.String encryptionSpec) |
void |
setKeySize(int keySize)
Set the size of encryption key to use, either 128 or 256.
|
void |
setSecurityProvider(java.security.Provider provider)
Set the Java security provider to use for all encryption operations.
|
EncryptionConfig |
withCompressionEnabled(boolean compressionEnabled) |
EncryptionConfig |
withCompressionSpec(java.lang.String compressionSpec) |
EncryptionConfig |
withEncryptionSpec(java.lang.String encryptionSpec) |
EncryptionConfig |
withKeySize(int keySize) |
EncryptionConfig |
withSecurityProvider(java.security.Provider provider) |
public EncryptionConfig(java.security.KeyStore keystore, char[] masterKeyPassword, java.lang.String masterKeyAlias) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.UnrecoverableKeyException
keystore
- the Keystore containing the master encryption key and any
additional decryption key(s).masterKeyPassword
- password for the master keys. Note that this
implementation assumes that all master keys use the same password.masterKeyAlias
- name of the master encryption key in the Keystore object.java.security.KeyStoreException
- if the keystore has not been initialized properly.java.security.NoSuchAlgorithmException
- if the master key's algorithm is not available.java.security.InvalidKeyException
- if the master key alias is not found in the keystore.java.security.UnrecoverableKeyException
- if the master key is not readable (e.g. bad password)public EncryptionConfig(java.security.KeyPair masterEncryptionKey, java.util.Set<java.security.KeyPair> decryptionKeys)
masterEncryptionKey
- the KeyPair to use for encryption.decryptionKeys
- (optional) additional KeyPair objects available to
decrypt objects.public EncryptionConfig(com.emc.codec.encryption.KeyProvider keyProvider)
public EncryptionConfig(EncryptionConfig other)
public com.emc.codec.encryption.KeyProvider getKeyProvider()
public int getKeySize()
public void setKeySize(int keySize)
public java.security.Provider getSecurityProvider()
public void setSecurityProvider(java.security.Provider provider)
public java.lang.String getEncryptionSpec()
public void setEncryptionSpec(java.lang.String encryptionSpec)
public boolean isCompressionEnabled()
public void setCompressionEnabled(boolean compressionEnabled)
public java.lang.String getCompressionSpec()
public void setCompressionSpec(java.lang.String compressionSpec)
DeflateCodec.encodeSpec(int)
public java.util.Map<java.lang.String,java.lang.Object> getCodecProperties()
public void setCodecProperties(java.util.Map<java.lang.String,java.lang.Object> codecProperties)
public EncryptionConfig withKeySize(int keySize)
setKeySize(int)
public EncryptionConfig withSecurityProvider(java.security.Provider provider)
setSecurityProvider(Provider)
public EncryptionConfig withEncryptionSpec(java.lang.String encryptionSpec)
public EncryptionConfig withCompressionEnabled(boolean compressionEnabled)
public EncryptionConfig withCompressionSpec(java.lang.String compressionSpec)