Package org.nuxeo.ecm.core.blob
Class AESBlobStoreConfiguration
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.PropertyBasedConfiguration
-
- org.nuxeo.ecm.core.blob.AESBlobStoreConfiguration
-
public class AESBlobStoreConfiguration extends PropertyBasedConfiguration
Configuration for the AES-encrypted storage of files.- Since:
- 11.1
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringAESprotected static StringAES_CBC_PKCS5_PADDINGprotected static StringAES_GCM_NOPADDINGStringkeyAliasStringkeyPasswordStringkeyStoreFileStringkeyStorePasswordStringkeyStoreTypeStringpasswordprotected static intPBKDF2_ITERATIONSprotected static intPBKDF2_KEY_LENGTHprotected static StringPBKDF2_WITH_HMAC_SHA1static StringPROP_COMPAT_KEYstatic StringPROP_KEY_ALIASstatic StringPROP_KEY_PASSWORDstatic StringPROP_KEY_STORE_FILEstatic StringPROP_KEY_STORE_PASSWORDstatic StringPROP_KEY_STORE_TYPEstatic StringPROP_KEY_USE_INSECURE_CIPHERIftrue, use the insecure AES/CBC/PKCS5Padding for encryption.static StringPROP_PASSWORDbooleanuseInsecureCipherbooleanusePBKDF2-
Fields inherited from class org.nuxeo.ecm.core.blob.PropertyBasedConfiguration
properties, systemPropertyPrefix
-
-
Constructor Summary
Constructors Constructor Description AESBlobStoreConfiguration(Map<String,String> properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected KeygenerateSecretKey(byte[] salt)Generates an AES key from the password using PBKDF2.protected CiphergetCipher()protected AlgorithmParameterSpecgetParameterSpec(byte[] iv)protected KeygetSecretKey()Gets the AES key from the keystore.protected voidparseCompat()-
Methods inherited from class org.nuxeo.ecm.core.blob.PropertyBasedConfiguration
getBooleanProperty, getIntProperty, getIntProperty, getLongProperty, getProperty, getProperty
-
-
-
-
Field Detail
-
AES
protected static final String AES
- See Also:
- Constant Field Values
-
PBKDF2_WITH_HMAC_SHA1
protected static final String PBKDF2_WITH_HMAC_SHA1
- See Also:
- Constant Field Values
-
PBKDF2_ITERATIONS
protected static final int PBKDF2_ITERATIONS
- See Also:
- Constant Field Values
-
PBKDF2_KEY_LENGTH
protected static final int PBKDF2_KEY_LENGTH
- See Also:
- Constant Field Values
-
AES_CBC_PKCS5_PADDING
protected static final String AES_CBC_PKCS5_PADDING
- See Also:
- Constant Field Values
-
AES_GCM_NOPADDING
protected static final String AES_GCM_NOPADDING
- See Also:
- Constant Field Values
-
PROP_COMPAT_KEY
public static final String PROP_COMPAT_KEY
- See Also:
- Constant Field Values
-
PROP_PASSWORD
public static final String PROP_PASSWORD
- See Also:
- Constant Field Values
-
PROP_KEY_STORE_TYPE
public static final String PROP_KEY_STORE_TYPE
- See Also:
- Constant Field Values
-
PROP_KEY_STORE_FILE
public static final String PROP_KEY_STORE_FILE
- See Also:
- Constant Field Values
-
PROP_KEY_STORE_PASSWORD
public static final String PROP_KEY_STORE_PASSWORD
- See Also:
- Constant Field Values
-
PROP_KEY_ALIAS
public static final String PROP_KEY_ALIAS
- See Also:
- Constant Field Values
-
PROP_KEY_PASSWORD
public static final String PROP_KEY_PASSWORD
- See Also:
- Constant Field Values
-
PROP_KEY_USE_INSECURE_CIPHER
public static final String PROP_KEY_USE_INSECURE_CIPHER
Iftrue, use the insecure AES/CBC/PKCS5Padding for encryption. The default isfalse, to use AES/GCM/NoPadding.- See Also:
- Constant Field Values
-
usePBKDF2
public final boolean usePBKDF2
-
password
public final String password
-
keyStoreType
public final String keyStoreType
-
keyStoreFile
public final String keyStoreFile
-
keyStorePassword
public final String keyStorePassword
-
keyAlias
public final String keyAlias
-
keyPassword
public final String keyPassword
-
useInsecureCipher
public final boolean useInsecureCipher
-
-
Constructor Detail
-
AESBlobStoreConfiguration
public AESBlobStoreConfiguration(Map<String,String> properties) throws IOException
- Throws:
IOException
-
-
Method Detail
-
parseCompat
protected void parseCompat()
-
generateSecretKey
protected Key generateSecretKey(byte[] salt) throws GeneralSecurityException
Generates an AES key from the password using PBKDF2.- Parameters:
salt- the salt- Throws:
GeneralSecurityException
-
getSecretKey
protected Key getSecretKey() throws GeneralSecurityException, IOException
Gets the AES key from the keystore.- Throws:
GeneralSecurityExceptionIOException
-
getCipher
protected Cipher getCipher() throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
getParameterSpec
protected AlgorithmParameterSpec getParameterSpec(byte[] iv)
-
-