net.rim.device.api.crypto.certificate
Class CertificateFactory

java.lang.Object
  extended by net.rim.device.api.crypto.certificate.CertificateFactory

public abstract class CertificateFactory
extends Object

Create a new certificate given a String representing a certificate type.

See Also:
Certificate
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 protected CertificateFactory()
          Creates a new CertificateFactory object.
 
Method Summary
Category: Signed protected  Certificate createCertificate(byte[] encoding)
          Constructs a Certificate from the given byte array.
Category: Signed protected abstract  Certificate createCertificate(InputStream input)
          Constructs a Certificate from the given stream.
Category: Signed static Certificate getInstance(String type, byte[] encoding)
          Creates a certificate from a byte array.
Category: Signed static Certificate getInstance(String type, InputStream stream)
          Creates a certificate given the certificate type and input stream.
Category: Signed protected abstract  String getType()
          Returns a String that indicates the type of certificate this factory creates, eg "X509".
Category: Signed static boolean register(CertificateFactory factory)
          Registers a new CertificateFactory object with the framework.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

CertificateFactory

protected CertificateFactory()
Creates a new CertificateFactory object.

This is the default constructor and is not used.

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

getInstance

public static Certificate getInstance(String type,
                                      InputStream stream)
                               throws NoSuchAlgorithmException,
                                      CertificateParsingException
Creates a certificate given the certificate type and input stream.

Parameters:
type - A string defining the type of certificate this is, such as "X509", "WTLS", etc.
stream - An input stream to pull the certificate encoding from.
Returns:
A certificate derived from the encoding.
Throws:
NoSuchAlgorithmException - Thrown if the specified certificate type is invalid.
CertificateParsingException - Thrown if the certificate is improperly formatted or invalid.
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

getInstance

public static Certificate getInstance(String type,
                                      byte[] encoding)
                               throws NoSuchAlgorithmException,
                                      CertificateParsingException
Creates a certificate from a byte array.

Parameters:
type - A String defining the type of certificate this is, such as "X509", "WTLS", etc.
encoding - A byte array containing the encoding of the certificate.
Returns:
A certificate derived from the encoding.
Throws:
NoSuchAlgorithmException - Thrown if the specified certificate type is invalid.
CertificateParsingException - Thrown if the certificate is improperly formatted or invalid.
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

register

public static boolean register(CertificateFactory factory)
Registers a new CertificateFactory object with the framework.

Parameters:
factory - The certificate wrapper to register.
Returns:
Returns true if the class was registered successfully, false otherwise. This will return false if the certificate already exists in the hash table.
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

getType

protected abstract String getType()
Returns a String that indicates the type of certificate this factory creates, eg "X509".

Returns:
A String representing the factory type.
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

createCertificate

protected abstract Certificate createCertificate(InputStream input)
                                          throws NoSuchAlgorithmException,
                                                 CertificateParsingException
Constructs a Certificate from the given stream.

Parameters:
input - The input stream used to construct the certificate.
Returns:
A certificate.
Throws:
NoSuchAlgorithmException - Thrown if the specified certificate type is invalid.
CertificateParsingException - Thrown if the certificate is improperly formatted or invalid.
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

createCertificate

protected Certificate createCertificate(byte[] encoding)
                                 throws NoSuchAlgorithmException,
                                        CertificateParsingException
Constructs a Certificate from the given byte array.

Parameters:
encoding - The encoding used to construct a certificate.
Returns:
A certificate.
Throws:
NoSuchAlgorithmException - Thrown if the specified certificate type is invalid.
CertificateParsingException - Thrown if the certificate is improperly formatted or invalid.
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