org.mozilla.jss.crypto
public interface KeyWrapper
Deprecated: Use the JCA interface instead (javax.crypto.Cipher)
Method Summary | |
---|---|
void | initUnwrap(SymmetricKey unwrappingKey, AlgorithmParameterSpec parameters) |
void | initUnwrap(PrivateKey unwrappingKey, AlgorithmParameterSpec parameters) |
void | initUnwrap()
For plaintext-wrapped keys. |
void | initWrap(SymmetricKey wrappingKey, AlgorithmParameterSpec parameters) |
void | initWrap(PublicKey wrappingKey, AlgorithmParameterSpec parameters) |
void | initWrap()
For wrapping keys in plaintext. |
PrivateKey | unwrapPrivate(byte[] wrapped, PrivateKey.Type type, PublicKey publicKey)
Unwraps a private key, creating a permanent private key object.
|
SymmetricKey | unwrapSymmetric(byte[] wrapped, SymmetricKey.Type type, SymmetricKey.Usage usage, int keyLength) |
SymmetricKey | unwrapSymmetric(byte[] wrapped, SymmetricKey.Type type, int keyLength)
Unwraps a key and allows it to be used for all operations. |
PrivateKey | unwrapTemporaryPrivate(byte[] wrapped, PrivateKey.Type type, PublicKey publicKey)
Unwraps a private key, creating a temporary private key object.
|
byte[] | wrap(PrivateKey toBeWrapped) |
byte[] | wrap(SymmetricKey toBeWrapped) |
Parameters: publicKey Used to calculate the key identifier that must be stored
with the private key. Must be a RSAPublicKey
or a
DSAPublicKey
.
Throws: InvalidKeyException If the type of the public key does not match the type of the private key to be unwrapped.
Parameters: keyLength The expected length of the key in bytes. This is only used for variable-length keys (RC4) and non-padding algorithms. Otherwise, it can be set to anything(like 0). usage The operation the key will be used for after it is unwrapped. You have to specify this so that the key can be properly marked with the operation it supports. Some PKCS #11 tokens require that a key be marked for an operation before it can perform that operation.
Parameters: keyLength The expected length of the key in bytes. This is only used for variable-length keys (RC4) and non-padding algorithms. Otherwise, it can be set to anything(like 0).
Parameters: publicKey Used to calculate the key identifier that must be stored
with the private key. Must be a RSAPublicKey
or a
DSAPublicKey
.
Throws: InvalidKeyException If the type of the public key does not match the type of the private key to be unwrapped.