CipherProvider
class JCECipherProvider extends java.lang.Object implements CipherProvider
CipherFactory
Modifier and Type | Field | Description |
---|---|---|
private javax.crypto.Cipher |
cipher |
|
private javax.crypto.SecretKey |
cryptixKey |
|
private int |
encryptionBlockSize |
|
private javax.crypto.spec.IvParameterSpec |
ivspec |
|
private boolean |
ivUsed |
|
private int |
mode |
|
private boolean |
sunjce |
Constructor | Description |
---|---|
JCECipherProvider(int mode,
javax.crypto.SecretKey secretKey,
byte[] iv,
java.lang.String algorithm,
java.lang.String provider) |
Modifier and Type | Method | Description |
---|---|---|
int |
decrypt(byte[] ciphertext,
int offset,
int length,
byte[] cleartext,
int outputOffset) |
Decrypt data - use only with Cipher that has been initialized with
CipherFactory.DECRYPT.
|
int |
encrypt(byte[] cleartext,
int offset,
int length,
byte[] ciphertext,
int outputOffset) |
Encrypt data - use only with Cipher that has been initialized with
CipherFactory.ENCRYPT.
|
int |
getEncryptionBlockSize() |
Returns the encryption block size used during creation of the encrypted database
|
(package private) boolean |
verifyIV(byte[] IV) |
private javax.crypto.Cipher cipher
private int mode
private boolean ivUsed
private final javax.crypto.spec.IvParameterSpec ivspec
private final int encryptionBlockSize
private boolean sunjce
private javax.crypto.SecretKey cryptixKey
JCECipherProvider(int mode, javax.crypto.SecretKey secretKey, byte[] iv, java.lang.String algorithm, java.lang.String provider) throws StandardException
StandardException
public int encrypt(byte[] cleartext, int offset, int length, byte[] ciphertext, int outputOffset) throws StandardException
CipherProvider
encrypt
in interface CipherProvider
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.StandardException
- Standard Derby Error PolicyCipherProvider.encrypt(byte[], int, int, byte[], int)
public int decrypt(byte[] ciphertext, int offset, int length, byte[] cleartext, int outputOffset) throws StandardException
CipherProvider
decrypt
in interface CipherProvider
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.StandardException
- Standard Derby Error PolicyCipherProvider.decrypt(byte[], int, int, byte[], int)
boolean verifyIV(byte[] IV)
public int getEncryptionBlockSize()
CipherProvider
getEncryptionBlockSize
in interface CipherProvider
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.