public class CertificateFactory extends Object
It defines methods for parsing certificate chains (certificate paths) and Certificate Revocation Lists (CRLs).
| Modifier | Constructor and Description |
|---|---|
protected |
CertificateFactory(CertificateFactorySpi certFacSpi,
Provider provider,
String type)
Creates a new
CertificateFactory instance. |
| Modifier and Type | Method and Description |
|---|---|
Certificate |
generateCertificate(InputStream inStream)
Generates and initializes a
Certificate from the provided input
stream. |
Collection<? extends Certificate> |
generateCertificates(InputStream inStream)
Generates and initializes a collection of (unrelated) certificates from
the provided input stream.
|
CertPath |
generateCertPath(InputStream inStream)
Generates a
CertPath (a certificate chain) from the provided
InputStream. |
CertPath |
generateCertPath(InputStream inputStream,
String encoding)
Generates a
CertPath (a certificate chain) from the given
inputStream, assuming the given encoding from
getCertPathEncodings(). |
CertPath |
generateCertPath(List<? extends Certificate> certificates)
Generates a
CertPath from the provided list of certificates. |
CRL |
generateCRL(InputStream inStream)
Generates and initializes a Certificate Revocation List (CRL) from
the provided input stream.
|
Collection<? extends CRL> |
generateCRLs(InputStream inStream)
Generates and initializes a collection of Certificate Revocation
List (CRL) from the provided input stream.
|
Iterator<String> |
getCertPathEncodings()
Returns an
Iterator over the supported CertPath encodings
(as Strings). |
static CertificateFactory |
getInstance(String type)
Creates a new
CertificateFactory instance that provides the
requested certificate type. |
static CertificateFactory |
getInstance(String type,
Provider provider)
Creates a new
CertificateFactory instance from the specified
provider that provides the requested certificate type. |
static CertificateFactory |
getInstance(String type,
String provider)
Creates a new
CertificateFactory instance from the specified
provider that provides the requested certificate type. |
Provider |
getProvider()
Returns the
Provider of the certificate factory represented by
the certificate. |
String |
getType()
Returns the Certificate type.
|
protected CertificateFactory(CertificateFactorySpi certFacSpi, Provider provider, String type)
CertificateFactory instance.certFacSpi - the implementation delegate.provider - the associated provider.type - the certificate type.public static final CertificateFactory getInstance(String type) throws CertificateException
CertificateFactory instance that provides the
requested certificate type.type - the certificate type.CertificateFactory instance.CertificateException - if the specified certificate type is not available at any
installed provider.NullPointerException - if type == nullpublic static final CertificateFactory getInstance(String type, String provider) throws CertificateException, NoSuchProviderException
CertificateFactory instance from the specified
provider that provides the requested certificate type.type - the certificate type.provider - the name of the provider providing certificates of the
specified type.CertificateFactory instance.CertificateException - if the specified certificate type is not available by the
specified provider.NoSuchProviderException - if no provider with the specified name can be found.IllegalArgumentException - if provider == null || provider.isEmpty()NullPointerException - it type is null.public static final CertificateFactory getInstance(String type, Provider provider) throws CertificateException
CertificateFactory instance from the specified
provider that provides the requested certificate type. The
provider supplied does not have to be registered.type - the certificate type.provider - the name of the provider providing certificates of the
specified type.CertificateFactory instance.CertificateException - if the specified certificate type is not available at the
specified provider.IllegalArgumentException - if the specified provider is null.NullPointerException - if type == nullIllegalArgumentException - if provider == nullpublic final Provider getProvider()
Provider of the certificate factory represented by
the certificate.public final String getType()
public final Certificate generateCertificate(InputStream inStream) throws CertificateException
Certificate from the provided input
stream.inStream - the stream from where data is read to create the Certificate.CertificateException - if parsing problems are detected.public final Iterator<String> getCertPathEncodings()
Iterator over the supported CertPath encodings
(as Strings). The first element is the default encoding scheme to apply.CertPath encodings (as
Strings).public final CertPath generateCertPath(InputStream inStream) throws CertificateException
CertPath (a certificate chain) from the provided
InputStream. The default encoding scheme is applied.inStream - InputStream with encoded data.CertPath initialized from the provided data.CertificateException - if parsing problems are detected.public final CertPath generateCertPath(InputStream inputStream, String encoding) throws CertificateException
CertPath (a certificate chain) from the given
inputStream, assuming the given encoding from
getCertPathEncodings().CertificateException - if parsing problems are detected.UnsupportedOperationException - if the provider does not implement this method.public final CertPath generateCertPath(List<? extends Certificate> certificates) throws CertificateException
CertPath from the provided list of certificates. The
encoding is the default encoding.certificates - the list containing certificates in a format supported by the
CertificateFactory.CertPath initialized from the provided data.CertificateException - if parsing problems are detected.UnsupportedOperationException - if the provider does not implement this method.public final Collection<? extends Certificate> generateCertificates(InputStream inStream) throws CertificateException
inStream - the stream from which the data is read to create the
collection.CertificateException - if parsing problems are detected.public final CRL generateCRL(InputStream inStream) throws CRLException
inStream - the stream from where data is read to create the CRL.CRLException - if parsing problems are detected.public final Collection<? extends CRL> generateCRLs(InputStream inStream) throws CRLException
inStream - the stream from which the data is read to create the CRLs.CRLException - if parsing problems are detected.