Class JCECipherProvider
java.lang.Object
org.apache.derby.impl.services.jce.JCECipherProvider
- All Implemented Interfaces:
CipherProvider
This is a wrapper for a Cipher
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Cipherprivate SecretKeyprivate final intprivate final IvParameterSpecprivate booleanprivate intprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionJCECipherProvider(int mode, SecretKey secretKey, byte[] iv, String algorithm, String provider) -
Method Summary
Modifier and TypeMethodDescriptionintdecrypt(byte[] ciphertext, int offset, int length, byte[] cleartext, int outputOffset) Decrypt data - use only with Cipher that has been initialized with CipherFactory.DECRYPT.intencrypt(byte[] cleartext, int offset, int length, byte[] ciphertext, int outputOffset) Encrypt data - use only with Cipher that has been initialized with CipherFactory.ENCRYPT.intReturns the encryption block size used during creation of the encrypted database(package private) booleanverifyIV(byte[] IV)
-
Field Details
-
cipher
-
mode
private int mode -
ivUsed
private boolean ivUsed -
ivspec
-
encryptionBlockSize
private final int encryptionBlockSize -
sunjce
private boolean sunjce -
cryptixKey
-
-
Constructor Details
-
JCECipherProvider
JCECipherProvider(int mode, SecretKey secretKey, byte[] iv, String algorithm, String provider) throws StandardException - Throws:
StandardException
-
-
Method Details
-
encrypt
public int encrypt(byte[] cleartext, int offset, int length, byte[] ciphertext, int outputOffset) throws StandardException Description copied from interface:CipherProviderEncrypt data - use only with Cipher that has been initialized with CipherFactory.ENCRYPT.- Specified by:
encryptin interfaceCipherProvider- Parameters:
cleartext- the byte array containing the cleartextoffset- encrypt from this byte offset in the cleartextlength- encrypt this many bytes starting from offsetciphertext- the byte array to store the ciphertextoutputOffset- the offset into the ciphertext array the output should go If cleartext and ciphertext are the same array, caller must be careful to not overwrite the cleartext before it is scrambled.- Returns:
- The number of bytes stored in ciphertext.
- Throws:
StandardException- Standard Derby Error Policy- See Also:
-
decrypt
public int decrypt(byte[] ciphertext, int offset, int length, byte[] cleartext, int outputOffset) throws StandardException Description copied from interface:CipherProviderDecrypt data - use only with Cipher that has been initialized with CipherFactory.DECRYPT.- Specified by:
decryptin interfaceCipherProvider- Parameters:
ciphertext- the byte array containing the ciphertextoffset- decrypt from this byte offset in the ciphertextlength- decrypt this many bytes starting from offsetcleartext- the byte array to store the cleartextoutputOffset- the offset into the cleartext array the output should go If cleartext and ciphertext are the same array, caller must be careful to not overwrite the ciphertext before it is un-scrambled.- Returns:
- The number of bytes stored in cleartext.
- Throws:
StandardException- Standard Derby Error Policy- See Also:
-
verifyIV
boolean verifyIV(byte[] IV) -
getEncryptionBlockSize
public int getEncryptionBlockSize()Description copied from interface:CipherProviderReturns the encryption block size used during creation of the encrypted database- Specified by:
getEncryptionBlockSizein interfaceCipherProvider
-