SHOW Signed SHOW CryptoExtensionAPI

net.rim.device.api.crypto.encoder
Class PKCS8_SymmetricKeyDecoder

java.lang.Object
  |
  +--net.rim.device.api.crypto.encoder.SymmetricKeyDecoder
        |
        +--net.rim.device.api.crypto.encoder.PKCS8_SymmetricKeyDecoder

public class PKCS8_SymmetricKeyDecoder
extends SymmetricKeyDecoder

Implements the symmetric key decoder.

This class is modelled after after PKCS8.

Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Since:
JDE 3.6.0
See Also:
PKCS8_PrivateKeyDecoder

Constructor Summary
 Category: CryptoExtensionAPI Category: Signed PKCS8_SymmetricKeyDecoder()
          Creates a new PKCS8_SymmetricKeyDecder object.
 
Method Summary
 Category: CryptoExtensionAPI Category: Signed protected  SymmetricKey decodeKey(ASN1InputStream parameters, ASN1InputStream symmetricKeyInfo, String algorithm)
          Decodes a key.
 Category: CryptoExtensionAPI Category: Signed protected  SymmetricKey decodeKey(InputStream encodedKey, String keyAlgorithm)
          Decodes the passed in key.
 Category: CryptoExtensionAPI Category: Signed protected  String getEncodingAlgorithm()
          Returns the encoding algorithm used, "PKCS8".
 Category: CryptoExtensionAPI Category: Signed protected  String[] getKeyAlgorithms()
          Returns the key algorithm encoded.
 
Methods inherited from class net.rim.device.api.crypto.encoder.SymmetricKeyDecoder
decode, decode, decode, decode, getDecoder, register
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS8_SymmetricKeyDecoder

public PKCS8_SymmetricKeyDecoder()
Creates a new PKCS8_SymmetricKeyDecder object.

This is the default constructor.

Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

decodeKey

protected SymmetricKey decodeKey(ASN1InputStream parameters,
                                 ASN1InputStream symmetricKeyInfo,
                                 String algorithm)
                          throws NoSuchAlgorithmException,
                                 InvalidKeyEncodingException,
                                 InvalidKeyException,
                                 CryptoTokenException,
                                 CryptoUnsupportedOperationException,
                                 IOException,
                                 ASN1EncodingException
Decodes a key.

This method will typically be implemented by a subclass to finish decoding the key.

Parameters:
parameters - The parameters that specify the details of the encoding.
symmetricKeyInfo - The symmetric key info to be decoded.
algorithm - The algorithm used to encode and decode the key.
Returns:
The decoded symmetric key.
Throws:
NoSuchAlgorithmException - Thrown if the specified algorithm is invalid.
InvalidKeyEncodingException - Thrown if the key is improperly formatted.
InvalidKeyException - Thrown if the specified key is invalid.
CryptoTokenException - Thrown if an error occurs with the crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown if a call is made to an unsupported operation.
IOException - Thrown when an I/O error occurs.
ASN1EncodingException - Thrown when the input stream is invalid or an unexpected error occurs.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

decodeKey

protected SymmetricKey decodeKey(InputStream encodedKey,
                                 String keyAlgorithm)
                          throws NoSuchAlgorithmException,
                                 InvalidKeyEncodingException,
                                 InvalidKeyException,
                                 CryptoTokenException,
                                 CryptoUnsupportedOperationException,
                                 IOException
Description copied from class: SymmetricKeyDecoder
Decodes the passed in key.

Overrides:
decodeKey in class SymmetricKeyDecoder
Since:
JDE 3.6.0

Following copied from class: SymmetricKeyDecoder
Parameters:
encodedKey - An input stream containing the public key to decode.
keyAlgorithm - The type of key.
Returns:
The decoded symmetric key
Throws:
NoSuchAlgorithmException - Thrown if the encoding algorithm cannot be found.
InvalidKeyEncodingException - Thrown if the key is imporperly formatted.
InvalidKeyException - Thrown if the specified key is invalid.
CryptoTokenException - Thrown if an error occurs with the crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown if a call is made to an unsupported operation.
IOException - Thrown if an I/O error occurs.
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getEncodingAlgorithm

protected String getEncodingAlgorithm()
Returns the encoding algorithm used, "PKCS8".

Overrides:
getEncodingAlgorithm in class SymmetricKeyDecoder
Returns:
A String representing the name of the encoding algorithm.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getKeyAlgorithms

protected String[] getKeyAlgorithms()
Returns the key algorithm encoded.

Overrides:
getKeyAlgorithms in class SymmetricKeyDecoder
Returns:
A String array representing the key algorithm.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2007 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.