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

java.lang.Object
  extended by net.rim.device.api.crypto.encoder.PrivateKeyDecoder
      extended by net.rim.device.api.crypto.encoder.MSCAPI_PrivateKeyDecoder

public class MSCAPI_PrivateKeyDecoder
extends PrivateKeyDecoder

Implements the private key decoder for Microsoft Crypto api keys.

See Also:
MSCAPI_PublicKeyDecoder
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 MSCAPI_PrivateKeyDecoder()
          Creates a new MSCAPI_PrivateKeyDecoder object.
 
Method Summary
Category: Signed protected  PrivateKey decodeKey(InputStream input, String algorithm)
          The function a subclass would implement to finish decoding the key.
Category: Signed protected  PrivateKey decodeKey(InputStream input, CryptoSystem defaultCryptoSystem, String defaultKeyAlgorithm)
          Decodes the specified key.
Category: Signed protected  String getEncodingAlgorithm()
          Returns the encoding algorithm used, "MSCAPI".
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

MSCAPI_PrivateKeyDecoder

public MSCAPI_PrivateKeyDecoder()
Creates a new MSCAPI_PrivateKeyDecoder 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 PrivateKey decodeKey(InputStream input,
                               CryptoSystem defaultCryptoSystem,
                               String defaultKeyAlgorithm)
                        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.

Specified by:
decodeKey in class PrivateKeyDecoder
Parameters:
input - An input stream containing the encoded key.
defaultCryptoSystem - The crypto system to base the decoded key upon (if no parameters were encoded with it).
defaultKeyAlgorithm - 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:
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 PrivateKey decodeKey(InputStream input,
                               String algorithm)
                        throws NoSuchAlgorithmException,
                               InvalidKeyEncodingException,
                               InvalidKeyException,
                               InvalidCryptoSystemException,
                               UnsupportedCryptoSystemException,
                               CryptoTokenException,
                               CryptoUnsupportedOperationException,
                               IOException
The function a subclass would implement to finish decoding the key.

Parameters:
input - The input stream containing the encoded key data.
algorithm - A String representing the name of the algorithm used to encode the key.
Returns:
The decoded private key.
Throws:
NoSuchAlgorithmException - Thrown if the specified algorithm is invalid.
InvalidKeyEncodingException - Thrown if the key is improperly formatted or encoded.
InvalidKeyException - Thrown if the key is invalid.
InvalidCryptoSystemException - Thrown if the crypto system is invalid.
UnsupportedCryptoSystemException - Thrown if the crypto system in question is invalid.
CryptoTokenException - Thrown if a problem 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

getEncodingAlgorithm

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

This method will always return the String "MSCAPI".

Specified by:
getEncodingAlgorithm in class PrivateKeyDecoder
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 PrivateKeyDecoder
Returns:
An array of Strings 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