SHOW Signed SHOW CryptoExtensionAPI
 

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

java.lang.Object
  |
  +--net.rim.device.api.crypto.encoder.PrivateKeyDecoder
        |
        +--net.rim.device.api.crypto.encoder.PKCS8_PrivateKeyDecoder

public class PKCS8_PrivateKeyDecoder
extends PrivateKeyDecoder

Implements the private key decoder for 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 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:
JDE 3.6.0

Constructor Summary
 Category: CryptoExtensionAPI Category: Signed PKCS8_PrivateKeyDecoder()
          Creates a new PKCS8_PrivatekeyDecoder object.
 
Method Summary
 Category: CryptoExtensionAPI Category: Signed protected  PrivateKey decodeKey(ASN1InputStream parameters, ASN1InputStream privateKeyInfo, CryptoSystem cryptoSystem, String algorithm)
          Decodes a key given the key data and the details of the encoding.
 Category: CryptoExtensionAPI Category: Signed protected  PrivateKey decodeKey(InputStream encodedKey, CryptoSystem cryptoSystem, String keyAlgorithm)
          Decodes the specified 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.PrivateKeyDecoder
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_PrivateKeyDecoder

public PKCS8_PrivateKeyDecoder()
Creates a new PKCS8_PrivatekeyDecoder 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 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.
Method Detail

decodeKey

protected PrivateKey decodeKey(ASN1InputStream parameters,
                               ASN1InputStream privateKeyInfo,
                               CryptoSystem cryptoSystem,
                               String algorithm)
                        throws NoSuchAlgorithmException,
                               InvalidKeyEncodingException,
                               InvalidKeyException,
                               InvalidCryptoSystemException,
                               UnsupportedCryptoSystemException,
                               CryptoTokenException,
                               CryptoUnsupportedOperationException,
                               IOException,
                               ASN1EncodingException
Decodes a key given the key data and the details of the encoding.

This method is called by a subclass to finish decoding the key.

Parameters:
parameters - The ASN1 input stream parameters.
privateKeyInfo - The private key data.
cryptoSystem - The crypto system associated with the key.
algorithm - The algorithm used to encode the key.
Returns:
A String representing the name of the algorithm.
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.
InvalidCryptoSystemException - Thrown if the specified crypto system is invalid.
UnsupportedCryptoSystemException - Thrown if the specified crypto system is unsupported.
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 if the ASN1 input stream is invalid.
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 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.

decodeKey

protected PrivateKey decodeKey(InputStream encodedKey,
                               CryptoSystem cryptoSystem,
                               String keyAlgorithm)
                        throws NoSuchAlgorithmException,
                               InvalidKeyEncodingException,
                               InvalidKeyException,
                               InvalidCryptoSystemException,
                               UnsupportedCryptoSystemException,
                               CryptoTokenException,
                               CryptoUnsupportedOperationException,
                               IOException
Description copied from class: PrivateKeyDecoder
Decodes the specified key.

This method must be implemented by subclasses.

Overrides:
decodeKey in class PrivateKeyDecoder
Since:
JDE 3.6.0

Following copied from class: PrivateKeyDecoder
Parameters:
encodedKey - An input stream containing the encoded key.
cryptoSystem - The crypto system to base the decoded key upon (if no parameters were encoded with it).
keyAlgorithm - The type of key.
Returns:
The decoded 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.
InvalidCryptoSystemException - Thrown if the specified crypto system is invalid.
UnsupportedCryptoSystemException - Thrown if the specified crypto system is unsupported.
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.
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 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.

getEncodingAlgorithm

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

Overrides:
getEncodingAlgorithm in class PrivateKeyDecoder
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 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.

getKeyAlgorithms

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

Overrides:
getKeyAlgorithms in class PrivateKeyDecoder
Returns:
An array of Strings 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 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.



Copyright 1999-2009 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.