public class CertificateFactory
extends java.security.cert.CertificateFactorySpi
Certificate Factories are used for reading encoded certificates and Certificate Recovation Lists (CRLs) from input streams.
For instantiating the IAIK certificate factory call the getInstance
factory method of the java.security.cert.CertificateFactory engine class,
thereby supplying the certificate type ("X.509") and the name of the IAIK
provider:
CertifiacteFactory certFactory =
CertificateFactory.getInstance("X.509", "IAIK");
Subsequently use the generateCertificate, generateCertificates,
generateCRL, or generateCRLs method for pasrsing a
X.509 certificate, a collection of X.509 certificates, a X.509 CRL, or a
collection of X.509 CRLs, respectively, e.g.:
Collection c = certFactory.generateCertificates(is);
X509Certificate,
X509CRL| Constructor and Description |
|---|
CertificateFactory() |
| Modifier and Type | Method and Description |
|---|---|
java.security.cert.Certificate |
engineGenerateCertificate(java.io.InputStream is)
Parses a X.509 certificate from the supplied input stream.
|
java.util.Collection |
engineGenerateCertificates(java.io.InputStream is)
Parses a collection of X.509 certificates from the supplied input stream.
|
java.security.cert.CertPath |
engineGenerateCertPath(java.io.InputStream inStream)
Generates a
CertPath object and initializes it with the
data read from the InputStream inStream. |
java.security.cert.CertPath |
engineGenerateCertPath(java.io.InputStream inStream,
java.lang.String encoding)
Generates a
CertPath object and initializes it with the
data read from the InputStream inStream. |
java.security.cert.CertPath |
engineGenerateCertPath(java.util.List<? extends java.security.cert.Certificate> certificates)
Generates a
CertPath object and initializes it with a
List of Certificates. |
java.security.cert.CRL |
engineGenerateCRL(java.io.InputStream is)
Parses a X.509 CRL from the supplied input stream.
|
java.util.Collection |
engineGenerateCRLs(java.io.InputStream is)
Parses a collection of X.509 CRLs from the supplied input stream.
|
java.util.Iterator<java.lang.String> |
engineGetCertPathEncodings()
Returns an iteration of the
CertPath encodings supported
by this certificate factory, with the default encoding first. |
public java.security.cert.Certificate engineGenerateCertificate(java.io.InputStream is)
throws java.security.cert.CertificateException
engineGenerateCertificate in class java.security.cert.CertificateFactorySpiis - the input stream supplying the encoded certificatejava.security.cert.CertificateException - if an decoding/parsing error occurspublic java.util.Collection engineGenerateCertificates(java.io.InputStream is)
throws java.security.cert.CertificateException
This method requires that classes from the iaik.pkcs.pkcs7 package and com.entrust.toolkit.exceptions package be on the class path.
engineGenerateCertificates in class java.security.cert.CertificateFactorySpiis - the input stream supplying the encoded certificatesjava.security.cert.CertificateException - if an decoding/parsing error occurspublic java.security.cert.CRL engineGenerateCRL(java.io.InputStream is)
throws java.security.cert.CRLException
engineGenerateCRL in class java.security.cert.CertificateFactorySpiis - the input stream supplying the encoded CRLjava.security.cert.CRLException - if an decoding/parsing error occurspublic java.util.Collection engineGenerateCRLs(java.io.InputStream is)
throws java.security.cert.CRLException
This method requires that classes from the iaik.pkcs.pkcs7 package and com.entrust.toolkit.exceptions package be on the class path.
engineGenerateCRLs in class java.security.cert.CertificateFactorySpiis - the input stream supplying the encoded CRLsjava.security.cert.CRLException - if an decoding/parsing error occurspublic java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream inStream)
throws java.security.cert.CertificateException
CertPath object and initializes it with the
data read from the InputStream inStream. The data is
assumed to be in the default encoding.
IMPORTANT:This API is not supported by this
CertificateFactory implementation; it always throws a
UnsupportedOperationException.
engineGenerateCertPath in class java.security.cert.CertificateFactorySpiinStream - an InputStream containing the dataCertPath initialized with the data from the
InputStreamjava.security.cert.CertificateException - if an exception occurs while decodingjava.lang.UnsupportedOperationException - always thrownpublic java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream inStream,
java.lang.String encoding)
throws java.security.cert.CertificateException
CertPath object and initializes it with the
data read from the InputStream inStream. The data is
assumed to be in the specified encoding.
IMPORTANT:This API is not supported by this
CertificateFactory implementation; it always throws a
UnsupportedOperationException.
engineGenerateCertPath in class java.security.cert.CertificateFactorySpiinStream - an InputStream containing the dataencoding - the encoding used for the dataCertPath initialized with the data from the
InputStreamjava.security.cert.CertificateException - if an exception occurs while decoding or the encoding
requested is not supportedjava.lang.UnsupportedOperationException - always thrownpublic java.security.cert.CertPath engineGenerateCertPath(java.util.List<? extends java.security.cert.Certificate> certificates)
throws java.security.cert.CertificateException
CertPath object and initializes it with a
List of Certificates.
The certificates supplied must be of a type supported by the
CertificateFactory. They will be copied out of the
supplied List object.
IMPORTANT:This API is not supported by this
CertificateFactory implementation; it always throws a
UnsupportedOperationException.
engineGenerateCertPath in class java.security.cert.CertificateFactorySpicertificates - a List of CertificatesCertPath initialized with the supplied list of
certificatesjava.security.cert.CertificateException - if an exception occursjava.lang.UnsupportedOperationException - always thrownpublic java.util.Iterator<java.lang.String> engineGetCertPathEncodings()
CertPath encodings supported
by this certificate factory, with the default encoding first. See
Appendix A in the
Java Certification Path API Programmer's Guide for information about
standard encoding names.
Attempts to modify the returned Iterator via its
remove method result in an
UnsupportedOperationException.
IMPORTANT:This API is not supported by this
CertificateFactory implementation; it always throws a
UnsupportedOperationException.
engineGetCertPathEncodings in class java.security.cert.CertificateFactorySpiIterator over the names of the supported
CertPath encodings (as Strings)java.lang.UnsupportedOperationException - always thrown