|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.crypto.certificate.CertificateFactory
public abstract class CertificateFactory
Create a new certificate given a String representing a certificate type.
Certificate
Constructor Summary | ||
---|---|---|
|
protected |
CertificateFactory()
Creates a new CertificateFactory object. |
Method Summary | ||
---|---|---|
|
protected Certificate |
createCertificate(byte[] encoding)
Constructs a Certificate from the given byte array. |
|
protected abstract Certificate |
createCertificate(InputStream input)
Constructs a Certificate from the given stream. |
|
static Certificate |
getInstance(String type,
byte[] encoding)
Creates a certificate from a byte array. |
|
static Certificate |
getInstance(String type,
InputStream stream)
Creates a certificate given the certificate type and input stream. |
|
protected abstract String |
getType()
Returns a String that indicates the type of certificate this factory creates, eg "X509". |
|
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 |
---|
protected CertificateFactory()
CertificateFactory
object.
This is the default constructor and is not used.
Method Detail |
---|
public static Certificate getInstance(String type, InputStream stream) throws NoSuchAlgorithmException, CertificateParsingException
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.
NoSuchAlgorithmException
- Thrown if the specified certificate type is
invalid.
CertificateParsingException
- Thrown if the certificate is
improperly formatted or invalid.public static Certificate getInstance(String type, byte[] encoding) throws NoSuchAlgorithmException, CertificateParsingException
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.
NoSuchAlgorithmException
- Thrown if the specified certificate type is
invalid.
CertificateParsingException
- Thrown if the certificate is
improperly formatted or invalid.public static boolean register(CertificateFactory factory)
CertificateFactory
object with the framework.
factory
- The certificate wrapper to register.
protected abstract String getType()
protected abstract Certificate createCertificate(InputStream input) throws NoSuchAlgorithmException, CertificateParsingException
Certificate
from the given stream.
input
- The input stream used to construct the certificate.
NoSuchAlgorithmException
- Thrown if the specified certificate type is
invalid.
CertificateParsingException
- Thrown if the certificate is
improperly formatted or invalid.protected Certificate createCertificate(byte[] encoding) throws NoSuchAlgorithmException, CertificateParsingException
encoding
- The encoding used to construct a certificate.
NoSuchAlgorithmException
- Thrown if the specified certificate type is
invalid.
CertificateParsingException
- Thrown if the certificate is
improperly formatted or invalid.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.