|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.crypt.symmetric.SecretKeyUtils
public final class SecretKeyUtils
Utility class with methods for handling secret keys.
| Constructor Summary | |
|---|---|
SecretKeyUtils()
|
|
| Method Summary | |
|---|---|
static SecretKey |
generate(String algorithm,
int bitLength)
Generates a new secret key of the prescribed length that is suitable for the given algorithm. |
static SecretKey |
generate(String algorithm,
int bitLength,
SecureRandom random)
Generates a new secret key of the prescribed length that is suitable for the given algorithm. |
int |
length(SecretKey key)
Gets the key size in bits, which is simply the size of the encoded data in bytes converted to bits. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SecretKeyUtils()
| Method Detail |
|---|
public int length(SecretKey key)
key - Secret key.
public static SecretKey generate(String algorithm,
int bitLength)
throws CryptException
algorithm - Name of cipher algorithm for which a suitable key will
be generated.bitLength - Bit length required in generated key. Valid key lengths
are commonly a function of the cipher algorithm.
CryptException - if the private key cannot be generated
public static SecretKey generate(String algorithm,
int bitLength,
SecureRandom random)
throws CryptException
algorithm - Name of cipher algorithm for which a suitable key will
be generated.bitLength - Bit length required in generated key. Valid key lengths
are commonly a function of the cipher algorithm.random - Source of random data for key generation operation.
CryptException - if the private key cannot be generated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||