SHOW Signed SHOW CryptoExtensionAPI
 

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

java.lang.Object
  |
  +--net.rim.device.api.crypto.certificate.CertificateFactory

public abstract class CertificateFactory
extends Object

Create a new certificate given a String representing a certificate 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:
JDE 3.6.0
See Also:
Certificate

Constructor Summary
 Category: CryptoExtensionAPI Category: Signed protected CertificateFactory()
          Creates a new CertificateFactory object.
 
Method Summary
 Category: CryptoExtensionAPI Category: Signed protected  Certificate createCertificate(byte[] encoding)
          Constructs a Certificate from the given byte array.
 Category: CryptoExtensionAPI 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: CryptoExtensionAPI Category: Signed protected abstract  String getType()
          Returns a String that indicates the type of certificate this factory creates, eg "X509".
 Category: CryptoExtensionAPI 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.

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

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.
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.

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.
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.

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.
Since:
JDE 3.6.0
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.

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.
Since:
JDE 3.6.0
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.

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.
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.

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.
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.