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

java.lang.Object
  extended by net.rim.device.api.crypto.encoder.SignatureDecoder
      extended by net.rim.device.api.crypto.encoder.X509_SignatureDecoder

public class X509_SignatureDecoder
extends SignatureDecoder

Implements the signature decoder for X509.

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 X509_SignatureDecoder()
          Creates a new X509_SignatureDecoder object.
 
Method Summary
Category: Signed protected  DecodedSignature decodeSignature(InputStream encodedSignature, String signatureAlgorithm, String digestAlgorithm)
          Decodes a signature given the specified signature data and a String representing the signatureAlgorithm.
Category: Signed protected  DecodedSignature decodeSignature(ASN1InputByteArray parameters, byte[] encodedSignature, String signatureAlgorithm, String digestAlgorithm)
          Decodes a signature given the parameters of the encoding, a byte array containing the encoded signature, and a String representing the name of the algorithm.
Category: Signed protected  String getEncodingAlgorithm()
          Returns the encoding algorithm used, "X509".
Category: Signed protected  String[] getSignatureAlgorithms()
          Returns the signature algorithm used, such as ("DSA", "RSA_PKCS1_SHA1").
 
Methods inherited from class net.rim.device.api.crypto.encoder.SignatureDecoder
decode, decode, decode, decode, decode, getDecoder, register
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

X509_SignatureDecoder

public X509_SignatureDecoder()
Creates a new X509_SignatureDecoder 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

decodeSignature

protected DecodedSignature decodeSignature(InputStream encodedSignature,
                                           String signatureAlgorithm,
                                           String digestAlgorithm)
                                    throws NoSuchAlgorithmException,
                                           InvalidSignatureEncodingException
Decodes a signature given the specified signature data and a String representing the signatureAlgorithm.

Specified by:
decodeSignature in class SignatureDecoder
Parameters:
encodedSignature - An input stream containing the encoded signature data.
signatureAlgorithm - A String representing the signature algorithm.
Returns:
The decoded signature.
Throws:
NoSuchAlgorithmException - Thrown if the specified algorithm is invalid.
InvalidSignatureEncodingException - Thrown if the encoded signature is improperly formatted.
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

decodeSignature

protected DecodedSignature decodeSignature(ASN1InputByteArray parameters,
                                           byte[] encodedSignature,
                                           String signatureAlgorithm,
                                           String digestAlgorithm)
                                    throws NoSuchAlgorithmException,
                                           InvalidSignatureEncodingException
Decodes a signature given the parameters of the encoding, a byte array containing the encoded signature, and a String representing the name of the algorithm.

This method is typically implemented by a subclass to finish decoding the signature.

Parameters:
parameters - The ASN1 byte array.
encodedSignature - A byte array containing the encoded signature.
signatureAlgorithm - A String representing the name of the signature algorithm.
Returns:
The decoded signature.
Throws:
NoSuchAlgorithmException - Thrown if the specified algorithm is invalid.
InvalidSignatureEncodingException - Thrown if the encoded signature is improperly formatted.
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, "X509".

Specified by:
getEncodingAlgorithm in class SignatureDecoder
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

getSignatureAlgorithms

protected String[] getSignatureAlgorithms()
Returns the signature algorithm used, such as ("DSA", "RSA_PKCS1_SHA1").

Specified by:
getSignatureAlgorithms in class SignatureDecoder
Returns:
An array of Strings representing the names of all signature algorithms.
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-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.