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

java.lang.Object
  extended by net.rim.device.api.crypto.encoder.SymmetricKeyDecoder
      extended by 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.

See Also:
PKCS8_PrivateKeyDecoder
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

Constructor Summary
Category: Signed PKCS8_SymmetricKeyDecoder()
          Creates a new PKCS8_SymmetricKeyDecder object.
 
Method Summary
Category: Signed protected  SymmetricKey decodeKey(InputStream encodedKey, String keyAlgorithm)
          Decodes the passed in key.
Category: Signed protected  SymmetricKey decodeKey(ASN1InputStream parameters, ASN1InputStream symmetricKeyInfo, String algorithm)
          Decodes a key.
Category: Signed protected  String getEncodingAlgorithm()
          Returns the encoding algorithm used, "PKCS8".
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.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0


Method Detail

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.

Specified by:
decodeKey in 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:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

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.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

getEncodingAlgorithm

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

Specified by:
getEncodingAlgorithm in class SymmetricKeyDecoder
Returns:
A String representing the name of the encoding algorithm.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

getKeyAlgorithms

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

Specified by:
getKeyAlgorithms in class SymmetricKeyDecoder
Returns:
A String array representing the key algorithm.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal