org.apache.derby.iapi.services.crypto
Interface CipherFactory

All Known Implementing Classes:
JCECipherFactory

public interface CipherFactory

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
static int DECRYPT
           
static int ENCRYPT
          Get a CipherProvider that either Encrypts or Decrypts.
static int MIN_BOOTPASS_LENGTH
          Minimum bootPassword length
 
Method Summary
 java.lang.String changeBootPassword(java.lang.String changeString, java.util.Properties properties, CipherProvider verify)
           
 CipherProvider createNewCipher(int mode)
          Returns a CipherProvider which is the encryption or decryption engine.
 java.security.SecureRandom getSecureRandom()
           
 void saveProperties(java.util.Properties properties)
           
 void verifyKey(boolean create, StorageFactory storageFactory, java.util.Properties properties)
          Verify the external encryption key.
 

Field Detail

MIN_BOOTPASS_LENGTH

static final int MIN_BOOTPASS_LENGTH
Minimum bootPassword length

See Also:
Constant Field Values

ENCRYPT

static final int ENCRYPT
Get a CipherProvider that either Encrypts or Decrypts.

See Also:
Constant Field Values

DECRYPT

static final int DECRYPT
See Also:
Constant Field Values
Method Detail

getSecureRandom

java.security.SecureRandom getSecureRandom()

createNewCipher

CipherProvider createNewCipher(int mode)
                               throws StandardException
Returns a CipherProvider which is the encryption or decryption engine.

Parameters:
mode - is either ENCRYPT or DECRYPT. The CipherProvider can only do encryption or decryption but not both.
Throws:
StandardException - Standard Derby Error Policy

changeBootPassword

java.lang.String changeBootPassword(java.lang.String changeString,
                                    java.util.Properties properties,
                                    CipherProvider verify)
                                    throws StandardException
Throws:
StandardException

verifyKey

void verifyKey(boolean create,
               StorageFactory storageFactory,
               java.util.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 - true means database is being created, whereas false implies that the database has already been created
storageFactory - storageFactory is used to access any stored data that might be needed for verification process of the encryption key
properties - properties at time of database connection as well as those in service.properties
Throws:
StandardException

saveProperties

void saveProperties(java.util.Properties properties)

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.