public abstract class AbstractAesAdapter extends PropertyStorageAdapter
| Modifier and Type | Field and Description | 
|---|---|
protected static byte[] | 
EMPTY  | 
| Constructor and Description | 
|---|
AbstractAesAdapter()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected byte[] | 
cipher(byte[] iv,
      byte[] input,
      int mode)  | 
protected byte[] | 
decrypt(byte[] data)
Unpacks the data to iv, ciphertext, mac, validates and decrypts. 
 | 
protected byte[] | 
encrypt(byte[] plainText)
Encrypts the provided plainText, and packs it with the iv and mac. 
 | 
Object | 
fromSpace(Object value)
Triggered when a property value arrives from the space and is about to be injected in the user's object. 
 | 
protected byte[] | 
generateInitializationVector(int length)
Generate initialization vector for encryption. 
 | 
protected byte[] | 
generateMac(byte[] cipherText,
           byte[] iv)  | 
protected byte[] | 
generateSubKey(byte[] rawKey,
              int length,
              byte[] salt,
              byte[] subKey)  | 
protected SecretKey | 
generateSubKey(String subKey,
              int length,
              String algorithm)  | 
String | 
getName()
Returns a name used for display in monitoring tools. 
 | 
protected Cipher | 
getOrCreateCipher()  | 
protected Mac | 
getOrCreateMac()  | 
protected byte[] | 
getPassPhrase()
Returns the pass phrase which is used to generate the encryption key and mac key. 
 | 
protected Random | 
getSecureRandom()  | 
Class<?> | 
getStorageClass()
Returns the class of the values which will be stored in the space. 
 | 
protected String | 
initEncryptionAlgorithm()
Provides the encryption algorithm. 
 | 
protected int | 
initEncryptionKeyLength()
Provides the encryption key length, in bytes. 
 | 
protected abstract int | 
initIvLengthBytes()
Provides the initialization vector length, in bytes. 
 | 
protected String | 
initMacAlgorithm()  | 
protected abstract boolean | 
initMacEnabled()  | 
protected int | 
initMacKeyLength()  | 
protected Random | 
initSecureRandom()  | 
protected abstract String | 
initTransformation()
Provides the cipher transformation string. 
 | 
protected static byte[] | 
readArrayRemaining(ByteBuffer byteBuffer)  | 
protected static byte[] | 
readArrayWithByteLength(ByteBuffer byteBuffer)  | 
protected AlgorithmParameterSpec | 
toParameterSpec(byte[] iv)  | 
Object | 
toSpace(Object value)
Triggered when a property value is retrieved from the user's object and is about to be sent to the space. 
 | 
protected static void | 
writeArrayRemaining(ByteBuffer byteBuffer,
                   byte[] array)  | 
protected static void | 
writeArrayWithByteLength(ByteBuffer byteBuffer,
                        byte[] array)  | 
base64Decode, base64Encode, deserialize, serialize, supportsEqualsMatching, supportsOrderedMatching, toBinaryWrapper, unwrapBinary, unzip, useBase64Wrapper, wrapBinary, zippublic String getName()
PropertyStorageAdaptergetName in class PropertyStorageAdapterpublic Class<?> getStorageClass()
PropertyStorageAdaptergetStorageClass in class PropertyStorageAdapterpublic Object toSpace(Object value) throws IOException
PropertyStorageAdaptertoSpace in class PropertyStorageAdaptervalue - The original property valueIOException - Thrown when processing the property value fails.public Object fromSpace(Object value) throws IOException, ClassNotFoundException
PropertyStorageAdapterfromSpace in class PropertyStorageAdaptervalue - The value which was stored in the spaceIOException - Thrown when processing the property value fails.ClassNotFoundException - Thrown when processing the property value fails due to a class loading issue.protected byte[] getPassPhrase()
                        throws GeneralSecurityException
GeneralSecurityExceptionprotected Random getSecureRandom()
protected Random initSecureRandom()
protected abstract String initTransformation()
protected abstract int initIvLengthBytes()
protected String initEncryptionAlgorithm()
protected int initEncryptionKeyLength()
protected byte[] encrypt(byte[] plainText)
                  throws GeneralSecurityException
GeneralSecurityExceptionprotected byte[] decrypt(byte[] data)
                  throws GeneralSecurityException
GeneralSecurityExceptionprotected byte[] generateInitializationVector(int length)
protected byte[] cipher(byte[] iv,
                        byte[] input,
                        int mode)
                 throws GeneralSecurityException
GeneralSecurityExceptionprotected Cipher getOrCreateCipher() throws GeneralSecurityException
GeneralSecurityExceptionprotected AlgorithmParameterSpec toParameterSpec(byte[] iv)
protected abstract boolean initMacEnabled()
protected String initMacAlgorithm()
protected int initMacKeyLength()
protected byte[] generateMac(byte[] cipherText,
                             byte[] iv)
                      throws GeneralSecurityException
GeneralSecurityExceptionprotected Mac getOrCreateMac() throws GeneralSecurityException
GeneralSecurityExceptionprotected SecretKey generateSubKey(String subKey, int length, String algorithm) throws GeneralSecurityException
GeneralSecurityExceptionprotected byte[] generateSubKey(byte[] rawKey,
                                int length,
                                byte[] salt,
                                byte[] subKey)
                         throws GeneralSecurityException
GeneralSecurityExceptionprotected static void writeArrayWithByteLength(ByteBuffer byteBuffer, byte[] array)
protected static byte[] readArrayWithByteLength(ByteBuffer byteBuffer)
protected static void writeArrayRemaining(ByteBuffer byteBuffer, byte[] array)
protected static byte[] readArrayRemaining(ByteBuffer byteBuffer)
Copyright © GigaSpaces.