You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.




org.mozilla.jss.crypto
Interface KeyWrapper


Deprecated. Use the JCA interface instead (Cipher)

public interface KeyWrapper


Method Summary
 void initUnwrap()
          Deprecated. For plaintext-wrapped keys.
 void initUnwrap(PrivateKey unwrappingKey, java.security.spec.AlgorithmParameterSpec parameters)
          Deprecated.  
 void initUnwrap(SymmetricKey unwrappingKey, java.security.spec.AlgorithmParameterSpec parameters)
          Deprecated.  
 void initWrap()
          Deprecated. For wrapping keys in plaintext.
 void initWrap(java.security.PublicKey wrappingKey, java.security.spec.AlgorithmParameterSpec parameters)
          Deprecated.  
 void initWrap(SymmetricKey wrappingKey, java.security.spec.AlgorithmParameterSpec parameters)
          Deprecated.  
 PrivateKey unwrapPrivate(byte[] wrapped, PrivateKey.Type type, java.security.PublicKey publicKey)
          Deprecated. Unwraps a private key, creating a permanent private key object.
 SymmetricKey unwrapSymmetric(byte[] wrapped, SymmetricKey.Type type, int keyLength)
          Deprecated. Unwraps a key and allows it to be used for all operations.
 SymmetricKey unwrapSymmetric(byte[] wrapped, SymmetricKey.Type type, SymmetricKey.Usage usage, int keyLength)
          Deprecated.  
 PrivateKey unwrapTemporaryPrivate(byte[] wrapped, PrivateKey.Type type, java.security.PublicKey publicKey)
          Deprecated. Unwraps a private key, creating a temporary private key object.
 byte[] wrap(PrivateKey toBeWrapped)
          Deprecated.  
 byte[] wrap(SymmetricKey toBeWrapped)
          Deprecated.  
 

Method Detail

initWrap

void initWrap(SymmetricKey wrappingKey,
              java.security.spec.AlgorithmParameterSpec parameters)
              throws java.security.InvalidKeyException,
                     java.security.InvalidAlgorithmParameterException
Deprecated. 
Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

initWrap

void initWrap(java.security.PublicKey wrappingKey,
              java.security.spec.AlgorithmParameterSpec parameters)
              throws java.security.InvalidKeyException,
                     java.security.InvalidAlgorithmParameterException
Deprecated. 
Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

initWrap

void initWrap()
              throws java.security.InvalidKeyException,
                     java.security.InvalidAlgorithmParameterException
Deprecated. 
For wrapping keys in plaintext.

Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

initUnwrap

void initUnwrap(SymmetricKey unwrappingKey,
                java.security.spec.AlgorithmParameterSpec parameters)
                throws java.security.InvalidKeyException,
                       java.security.InvalidAlgorithmParameterException
Deprecated. 
Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

initUnwrap

void initUnwrap(PrivateKey unwrappingKey,
                java.security.spec.AlgorithmParameterSpec parameters)
                throws java.security.InvalidKeyException,
                       java.security.InvalidAlgorithmParameterException
Deprecated. 
Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

initUnwrap

void initUnwrap()
                throws java.security.InvalidKeyException,
                       java.security.InvalidAlgorithmParameterException
Deprecated. 
For plaintext-wrapped keys.

Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

wrap

byte[] wrap(PrivateKey toBeWrapped)
            throws java.security.InvalidKeyException,
                   java.lang.IllegalStateException,
                   TokenException
Deprecated. 
Throws:
java.security.InvalidKeyException
java.lang.IllegalStateException
TokenException

wrap

byte[] wrap(SymmetricKey toBeWrapped)
            throws java.security.InvalidKeyException,
                   java.lang.IllegalStateException,
                   TokenException
Deprecated. 
Throws:
java.security.InvalidKeyException
java.lang.IllegalStateException
TokenException

unwrapPrivate

PrivateKey unwrapPrivate(byte[] wrapped,
                         PrivateKey.Type type,
                         java.security.PublicKey publicKey)
                         throws TokenException,
                                java.security.InvalidKeyException,
                                java.lang.IllegalStateException
Deprecated. 
Unwraps a private key, creating a permanent private key object. A permanent private key object resides on a token until it is explicitly deleted from the token.

Parameters:
publicKey - Used to calculate the key identifier that must be stored with the private key. Must be a RSAPublicKey or a DSAPublicKey.
Throws:
java.security.InvalidKeyException - If the type of the public key does not match the type of the private key to be unwrapped.
TokenException
java.lang.IllegalStateException

unwrapTemporaryPrivate

PrivateKey unwrapTemporaryPrivate(byte[] wrapped,
                                  PrivateKey.Type type,
                                  java.security.PublicKey publicKey)
                                  throws TokenException,
                                         java.security.InvalidKeyException,
                                         java.lang.IllegalStateException
Deprecated. 
Unwraps a private key, creating a temporary private key object. A temporary private key is one that does not permanently reside on a token. As soon as it is garbage-collected, it is gone forever.

Parameters:
publicKey - Used to calculate the key identifier that must be stored with the private key. Must be a RSAPublicKey or a DSAPublicKey.
Throws:
java.security.InvalidKeyException - If the type of the public key does not match the type of the private key to be unwrapped.
TokenException
java.lang.IllegalStateException

unwrapSymmetric

SymmetricKey unwrapSymmetric(byte[] wrapped,
                             SymmetricKey.Type type,
                             SymmetricKey.Usage usage,
                             int keyLength)
                             throws TokenException,
                                    java.lang.IllegalStateException,
                                    java.security.InvalidAlgorithmParameterException
Deprecated. 
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.
Throws:
TokenException
java.lang.IllegalStateException
java.security.InvalidAlgorithmParameterException

unwrapSymmetric

SymmetricKey unwrapSymmetric(byte[] wrapped,
                             SymmetricKey.Type type,
                             int keyLength)
                             throws TokenException,
                                    java.lang.IllegalStateException,
                                    java.security.InvalidAlgorithmParameterException
Deprecated. 
Unwraps a key and allows it to be used for all operations.

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).
Throws:
TokenException
java.lang.IllegalStateException
java.security.InvalidAlgorithmParameterException