Top Description Fields Methods
org.apache.derby.iapi.services.crypto

public Interface CipherFactory

Known Direct Implementers
org.apache.derby.impl.services.jce.JCECipherFactory
Imports
org.apache.derby.shared.common.error.StandardException, java.security.SecureRandom, java.util.Properties, org.apache.derby.io.StorageFactory

A CipherFactory can create new CipherProvider, which is a wrapper for a javax.crypto.Cipher This service is only available when run on JDK1.2 or beyond. To use this service, either the SunJCE or an alternative clean room implementation of the JCE must be installed. To use a CipherProvider to encrypt or decrypt, it needs 3 things: 1) A CipherProvider that is initialized to ENCRYPT or DECRYPT 2) A secret Key for the encryption/decryption 3) An Initialization Vector (IvParameterSpec) that is used to create some randomness in the encryption See $WS/docs/funcspec/mulan/configurableEncryption.html See http://java.sun.com/products/JDK/1.1/docs/guide/security/CryptoSpec.html See http://java.sun.com/products/JDK/1.2/docs/guide/security/CryptoSpec.html See http://java.sun.com/products/jdk/1.2/jce/index.html

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
ENCRYPT

Get a CipherProvider that either Encrypts or Decrypts.

public static final int
MIN_BOOTPASS_LENGTH

Minimum bootPassword length

Method Summary

Modifier and TypeMethod and Description
public String
changeBootPassword(String changeString, Properties properties, CipherProvider verify)

public CipherProvider

Returns:

a cipher provider
createNewCipher
(int
is either ENCRYPT or DECRYPT. The CipherProvider can only do encryption or decryption but not both.
mode
)

Returns a CipherProvider which is the encryption or decryption engine.

public SecureRandom
public void
public void
verifyKey(boolean
true means database is being created, whereas false implies that the database has already been created
create
,
StorageFactory
storageFactory is used to access any stored data that might be needed for verification process of the encryption key
storageFactory
,
Properties
properties at time of database connection as well as those in service.properties
properties
)

Verify the external encryption key.

Field Detail

DECRYPTback to summary
public static final int DECRYPT
ENCRYPTback to summary
public static final int ENCRYPT

Get a CipherProvider that either Encrypts or Decrypts.

MIN_BOOTPASS_LENGTHback to summary
public static final int MIN_BOOTPASS_LENGTH

Minimum bootPassword length

Method Detail

changeBootPasswordback to summary
public String changeBootPassword(String changeString, Properties properties, CipherProvider verify) throws StandardException
createNewCipherback to summary
public CipherProvider createNewCipher(int mode) throws StandardException

Returns a CipherProvider which is the encryption or decryption engine.

Parameters
mode:int

is either ENCRYPT or DECRYPT. The CipherProvider can only do encryption or decryption but not both.

Returns:CipherProvider

a cipher provider

Exceptions
StandardException:
Standard Derby Error Policy
getSecureRandomback to summary
public SecureRandom getSecureRandom()
savePropertiesback to summary
public void saveProperties(Properties properties)
verifyKeyback to summary
public void verifyKey(boolean create, StorageFactory storageFactory, Properties properties) throws StandardException

Verify the external encryption key. Throws exception if unable to verify that the encryption key is the same as that used during database creation or if there are any problems when trying to do the verification process.

Parameters
create:boolean

true means database is being created, whereas false implies that the database has already been created

storageFactory:StorageFactory

storageFactory is used to access any stored data that might be needed for verification process of the encryption key

properties:Properties

properties at time of database connection as well as those in service.properties

Exceptions
StandardException:
on error