Top Description Fields Constructors Methods
org.apache.derby.impl.services.jce

pack-priv Class JCECipherProvider

extends Object
implements CipherProvider
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.crypto.CipherProvider
Imports
org.apache.derby.iapi.services.crypto.CipherFactory, .CipherProvider, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, java.security.Key, .InvalidKeyException, .NoSuchAlgorithmException, .GeneralSecurityException, .NoSuchProviderException, javax.crypto.Cipher, .SecretKeyFactory, .SecretKey, javax.crypto.spec.IvParameterSpec, .SecretKeySpec

This is a wrapper for a Cipher
See Also
CipherFactory

Field Summary

Modifier and TypeField and Description
private Cipher
private SecretKey
private final int
private final IvParameterSpec
private boolean
private int
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv
JCECipherProvider(int mode, SecretKey secretKey, byte[] iv, String algorithm, String provider)

Method Summary

Modifier and TypeMethod and Description
public int
decrypt(byte[]
the byte array containing the ciphertext
ciphertext
,
int
decrypt from this byte offset in the ciphertext
offset
,
int
decrypt this many bytes starting from offset
length
,
byte[]
the byte array to store the cleartext
cleartext
,
int
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.
outputOffset
)

Implements org.apache.derby.iapi.services.crypto.CipherProvider.decrypt.

Decrypt data - use only with Cipher that has been initialized with CipherFactory.DECRYPT.

public int
encrypt(byte[]
the byte array containing the cleartext
cleartext
,
int
encrypt from this byte offset in the cleartext
offset
,
int
encrypt this many bytes starting from offset
length
,
byte[]
the byte array to store the ciphertext
ciphertext
,
int
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.
outputOffset
)

Implements org.apache.derby.iapi.services.crypto.CipherProvider.encrypt.

Encrypt data - use only with Cipher that has been initialized with CipherFactory.ENCRYPT.

public int
getEncryptionBlockSize()

Implements org.apache.derby.iapi.services.crypto.CipherProvider.getEncryptionBlockSize.

Returns the encryption block size used during creation of the encrypted database

pack-priv boolean
verifyIV(byte[] IV)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cipherback to summary
private Cipher cipher
cryptixKeyback to summary
private SecretKey cryptixKey
encryptionBlockSizeback to summary
private final int encryptionBlockSize
ivspecback to summary
private final IvParameterSpec ivspec
ivUsedback to summary
private boolean ivUsed
modeback to summary
private int mode
sunjceback to summary
private boolean sunjce

Constructor Detail

JCECipherProviderback to summary
pack-priv JCECipherProvider(int mode, SecretKey secretKey, byte[] iv, String algorithm, String provider) throws StandardException

Method Detail

decryptback to summary
public int decrypt(byte[] ciphertext, int offset, int length, byte[] cleartext, int outputOffset) throws StandardException

Implements org.apache.derby.iapi.services.crypto.CipherProvider.decrypt.

Doc from org.apache.derby.iapi.services.crypto.CipherProvider.decrypt.

Decrypt data - use only with Cipher that has been initialized with CipherFactory.DECRYPT.

Parameters
ciphertext:byte[]

the byte array containing the ciphertext

offset:int

decrypt from this byte offset in the ciphertext

length:int

decrypt this many bytes starting from offset

cleartext:byte[]

the byte array to store the cleartext

outputOffset:int

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:int

The number of bytes stored in cleartext.

Exceptions
StandardException:
Standard Derby Error Policy
See Also
CipherProvider#decrypt
encryptback to summary
public int encrypt(byte[] cleartext, int offset, int length, byte[] ciphertext, int outputOffset) throws StandardException

Implements org.apache.derby.iapi.services.crypto.CipherProvider.encrypt.

Doc from org.apache.derby.iapi.services.crypto.CipherProvider.encrypt.

Encrypt data - use only with Cipher that has been initialized with CipherFactory.ENCRYPT.

Parameters
cleartext:byte[]

the byte array containing the cleartext

offset:int

encrypt from this byte offset in the cleartext

length:int

encrypt this many bytes starting from offset

ciphertext:byte[]

the byte array to store the ciphertext

outputOffset:int

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:int

The number of bytes stored in ciphertext.

Exceptions
StandardException:
Standard Derby Error Policy
See Also
CipherProvider#encrypt
getEncryptionBlockSizeback to summary
public int getEncryptionBlockSize()

Implements org.apache.derby.iapi.services.crypto.CipherProvider.getEncryptionBlockSize.

Doc from org.apache.derby.iapi.services.crypto.CipherProvider.getEncryptionBlockSize.

Returns the encryption block size used during creation of the encrypted database

Returns:int

the encryption block size

verifyIVback to summary
pack-priv boolean verifyIV(byte[] IV)