|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mozilla.jss.pkcs11.PK11KeyGenerator
public final class PK11KeyGenerator
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.mozilla.jss.crypto.KeyGenerator |
|---|
KeyGenerator.CharToByteConverter |
| Method Summary | |
|---|---|
SymmetricKey |
clone(SymmetricKey key)
Allows a SymmetricKey to be cloned on a different token. |
static SymmetricKey |
clone(SymmetricKey key,
PK11Token token)
Allows a SymmetricKey to be cloned on a different token. |
SymmetricKey |
generate()
Generates the key. |
byte[] |
generatePBE_IV()
Generates an Initialization Vector using a PBE algorithm. |
void |
initialize(java.security.spec.AlgorithmParameterSpec parameters)
|
void |
initialize(int strength)
|
void |
sensitiveKeys(boolean sensitive)
Tells the generator to generate sensitive or insensitive keys. |
void |
setCharToByteConverter(KeyGenerator.CharToByteConverter charToByte)
Sets the character to byte converter for passwords. |
void |
setKeyUsages(SymmetricKey.Usage[] usages)
|
void |
temporaryKeys(boolean temp)
Tells the generator to generate temporary or permanent keys. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void setCharToByteConverter(KeyGenerator.CharToByteConverter charToByte)
setCharToByteConverter in interface KeyGenerator
public void initialize(int strength)
throws java.security.InvalidAlgorithmParameterException
initialize in interface KeyGeneratorstrength - Key size in bits. Must be evenly divisible by 8.
java.security.InvalidAlgorithmParameterException
public void initialize(java.security.spec.AlgorithmParameterSpec parameters)
throws java.security.InvalidAlgorithmParameterException
initialize in interface KeyGeneratorjava.security.InvalidAlgorithmParameterExceptionpublic void setKeyUsages(SymmetricKey.Usage[] usages)
setKeyUsages in interface KeyGeneratorusages - The operations the key will be used for after it is
generated. You have to specify these so that the key can be properly
marked with the operations it supports. Some PKCS #11 tokens require
that a key be marked for an operation before it can perform that
operation. The default is SymmetricKey.Usage.SIGN and
SymmetricKey.Usage.ENCRYPT.public void temporaryKeys(boolean temp)
KeyGenerator
temporaryKeys in interface KeyGeneratorpublic void sensitiveKeys(boolean sensitive)
KeyGenerator
sensitiveKeys in interface KeyGenerator
public SymmetricKey generate()
throws java.lang.IllegalStateException,
TokenException,
java.io.CharConversionException
generate in interface KeyGeneratorjava.lang.IllegalStateException
TokenException
java.io.CharConversionException
public byte[] generatePBE_IV()
throws TokenException,
java.io.CharConversionException
PBEKeyGenParams.
generatePBE_IV in interface KeyGeneratorTokenException - If an error occurs on the CryptoToken while
generating the IV.
java.io.CharConversionException
public SymmetricKey clone(SymmetricKey key)
throws SymmetricKey.NotExtractableException,
java.security.InvalidKeyException,
TokenException
clone in interface KeyGeneratorSymmetricKey.NotExtractableException - If the key material
cannot be extracted from the current token.
java.security.InvalidKeyException - If the owning token cannot process
the key to be cloned.
TokenException
public static SymmetricKey clone(SymmetricKey key,
PK11Token token)
throws SymmetricKey.NotExtractableException,
java.security.InvalidKeyException,
TokenException
key - The key to clone.token - The token on which to clone the key.
SymmetricKey.NotExtractableException - If the key material
cannot be extracted from the current token.
java.security.InvalidKeyException - If the owning token cannot process
the key to be cloned.
TokenException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||