|
Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1.9) E56315-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
oracle.security.crypto.core.SymmetricKeyGenerator
public class SymmetricKeyGenerator
A class for randomly generating symmetric keys.
Note: DES and Triple-DES (DES-EDE) keys are generated with odd parity. Parity may also be set and tested using the methods CryptoUtils.setKeyParity(oracle.security.crypto.core.SymmetricKey, int) and CryptoUtils.checkKeyParity(oracle.security.crypto.core.SymmetricKey, int).
| Field Summary | |
|---|---|
protected static int |
AES128_DEFAULT_LENGTHDefault key length for AES128 (16 bytes). |
protected static int |
AES192_DEFAULT_LENGTHDefault key length for AES192 (24 bytes). |
protected static int |
AES256_DEFAULT_LENGTHDefault key length for AES256 (32 bytes). |
protected AlgorithmIdentifier |
algID |
protected static int |
ARCFOUR_DEFAULT_LENGTHDefault key length for ARCFOUR (16 bytes). |
protected static int |
BLOWFISH_DEFAULT_LENGTHDefault key length for BLOWFISH (56 bytes). |
protected static int |
DES_DEFAULT_LENGTHDefault key length for DES (8 bytes). |
protected static int |
DES_EDE3_DEFAULT_LENGTHDefault key length for DES_EDE3 (24 bytes). |
protected static int |
RC2_DEFAULT_LENGTHDefault key length for RC2 (16 bytes). |
| Constructor Summary | |
|---|---|
SymmetricKeyGenerator()Empty constructor. |
|
| Method Summary | |
|---|---|
SymmetricKey |
generateKey()Generate a new random symmetric key using the default RandomBitsSource and the length set by the algorithm identifier parameters or the default for the algorithm. |
SymmetricKey |
generateKey(int length)Generate a new random symmetric key using the default RandomBitsSource and the given length. |
SymmetricKey |
generateKey(RandomBitsSource rbs)Generate a new random symmetric key of the length set by the algorithm identifier parameters, or the default for the algorithm. |
SymmetricKey |
generateKey(RandomBitsSource rbs, int length)Generate a new random symmetric key using the given RandomBitsSource and length. |
AlgorithmIdentifier |
getAlgID()Returns the AlgorithmIdentifier of this SymmetricKeyGenerator. |
static SymmetricKeyGenerator |
getInstance(AlgorithmIdentifier algID)Create a new SymmetricKeyGenerator for the given algorithm. |
void |
setAlgID(AlgorithmIdentifier algID)Set the algorithm identifier for the symmetric key algorithm. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int AES128_DEFAULT_LENGTH
protected static final int AES192_DEFAULT_LENGTH
protected static final int AES256_DEFAULT_LENGTH
protected static final int BLOWFISH_DEFAULT_LENGTH
protected static final int DES_DEFAULT_LENGTH
protected static final int DES_EDE3_DEFAULT_LENGTH
protected static final int ARCFOUR_DEFAULT_LENGTH
protected static final int RC2_DEFAULT_LENGTH
protected AlgorithmIdentifier algID
| Constructor Detail |
|---|
public SymmetricKeyGenerator()
| Method Detail |
|---|
public static SymmetricKeyGenerator getInstance(AlgorithmIdentifier algID)
throws java.lang.IllegalArgumentException
SymmetricKeyGenerator for the given algorithm.java.lang.IllegalArgumentException
public void setAlgID(AlgorithmIdentifier algID)
throws AlgorithmIdentifierException
AlgorithmIdentifierExceptionAlgorithmIdentifier, CBCAlgorithmIdentifier, RC2AlgorithmIdentifierpublic AlgorithmIdentifier getAlgID()
public SymmetricKey generateKey(RandomBitsSource rbs,
int length)
RandomBitsSource and length.rbs - The source of randomness used to generate the key material.length - The length, in bytes, of the key to be generated.public SymmetricKey generateKey(RandomBitsSource rbs)
rbs - The source of randomness used to generate the key material.public SymmetricKey generateKey(int length)
RandomBitsSource and the given length.length - The length, in bytes, of the key to be generated.public SymmetricKey generateKey()
RandomBitsSource and the length set by the algorithm identifier parameters or the default for the algorithm.
|
Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1.9) E56315-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||