Class X509CertFactoryImpl
java.lang.Object
java.security.cert.CertificateFactorySpi
org.apache.harmony.security.provider.cert.X509CertFactoryImpl
public class X509CertFactoryImpl extends CertificateFactorySpi
X509 Certificate Factory Service Provider Interface Implementation.
It supports CRLs and Certificates in (PEM) ASN.1 DER encoded form,
and Certification Paths in PkiPath and PKCS7 formats.
For Certificates and CRLs factory maintains the caching
mechanisms allowing to speed up repeated Certificate/CRL
generation.
- See Also:
Cache
-
Constructor Summary
Constructors Constructor Description X509CertFactoryImpl()Default constructor. -
Method Summary
Modifier and Type Method Description CertificateengineGenerateCertificate(InputStream inStream)Generates the X.509 certificate from the data in the stream.Collection<? extends Certificate>engineGenerateCertificates(InputStream inStream)Generates the collection of the certificates on the base of provided via input stream encodings.CertPathengineGenerateCertPath(InputStream inStream)Generates aCertPathfrom the providedInputStream.CertPathengineGenerateCertPath(InputStream inStream, String encoding)Generates aCertPath(a certificate chain) from the giveninputStream, assuming the givenencodingfromCertificateFactorySpi.engineGetCertPathEncodings().CertPathengineGenerateCertPath(List<? extends Certificate> certificates)Generates aCertPathfrom the provided list of certificates.CRLengineGenerateCRL(InputStream inStream)Generates and initializes a Certificate Revocation List (CRL) from the provided input stream.Collection<? extends CRL>engineGenerateCRLs(InputStream inStream)Generates and initializes a collection of Certificate Revocation List (CRL) from the provided input stream.Iterator<String>engineGetCertPathEncodings()Returns anIteratorover the supportedCertPathencodings (as Strings).
-
Constructor Details
-
X509CertFactoryImpl
public X509CertFactoryImpl()Default constructor. Creates the instance of Certificate Factory SPI ready for use.
-
-
Method Details
-
engineGenerateCertificate
Generates the X.509 certificate from the data in the stream. The data in the stream can be either in ASN.1 DER encoded X.509 certificate, or PEM (Base64 encoding bounded by"-----BEGIN CERTIFICATE-----"at the beginning and"-----END CERTIFICATE-----"at the end) representation of the former encoded form. Before the generation the encoded form is looked up in the cache. If the cache contains the certificate with requested encoded form it is returned from it, otherwise it is generated by ASN.1 decoder.- Specified by:
engineGenerateCertificatein classCertificateFactorySpi- Parameters:
inStream- the stream from which the data is read to create the certificate.- Returns:
- an initialized certificate.
- Throws:
CertificateException- if parsing problems are detected.- See Also:
method documentation for more info
-
engineGenerateCertificates
public Collection<? extends Certificate> engineGenerateCertificates(InputStream inStream) throws CertificateExceptionGenerates the collection of the certificates on the base of provided via input stream encodings.- Specified by:
engineGenerateCertificatesin classCertificateFactorySpi- Parameters:
inStream- the stream from where data is read to create the certificates.- Returns:
- a collection of certificates.
- Throws:
CertificateException- if parsing problems are detected.- See Also:
method documentation for more info
-
engineGenerateCRL
Description copied from class:CertificateFactorySpiGenerates and initializes a Certificate Revocation List (CRL) from the provided input stream.- Specified by:
engineGenerateCRLin classCertificateFactorySpi- Parameters:
inStream- the stream from where data is read to create the CRL.- Returns:
- an CRL instance.
- Throws:
CRLException- if parsing problems are detected.- See Also:
method documentation for more info
-
engineGenerateCRLs
Description copied from class:CertificateFactorySpiGenerates and initializes a collection of Certificate Revocation List (CRL) from the provided input stream.- Specified by:
engineGenerateCRLsin classCertificateFactorySpi- Parameters:
inStream- the stream from which the data is read to create the CRLs.- Returns:
- a collection of CRLs.
- Throws:
CRLException- if parsing problems are detected.- See Also:
method documentation for more info
-
engineGenerateCertPath
Description copied from class:CertificateFactorySpiGenerates aCertPathfrom the providedInputStream. The default encoding scheme is applied.- Overrides:
engineGenerateCertPathin classCertificateFactorySpi- Parameters:
inStream- an input stream with encoded data.- Returns:
- a
CertPathinitialized from the provided data. - Throws:
CertificateException- if parsing problems are detected.- See Also:
method documentation for more info
-
engineGenerateCertPath
public CertPath engineGenerateCertPath(InputStream inStream, String encoding) throws CertificateExceptionDescription copied from class:CertificateFactorySpiGenerates aCertPath(a certificate chain) from the giveninputStream, assuming the givenencodingfromCertificateFactorySpi.engineGetCertPathEncodings().- Overrides:
engineGenerateCertPathin classCertificateFactorySpi- Throws:
CertificateException- if parsing problems are detected.- See Also:
method documentation for more info
-
engineGenerateCertPath
public CertPath engineGenerateCertPath(List<? extends Certificate> certificates) throws CertificateExceptionDescription copied from class:CertificateFactorySpiGenerates aCertPathfrom the provided list of certificates. The encoding is the default encoding.- Overrides:
engineGenerateCertPathin classCertificateFactorySpi- Parameters:
certificates- the list containing certificates in a format supported by theCertificateFactory.- Returns:
- a
CertPathinitialized from the provided data. - Throws:
CertificateException- if parsing problems are detected.- See Also:
method documentation for more info
-
engineGetCertPathEncodings
Description copied from class:CertificateFactorySpiReturns anIteratorover the supportedCertPathencodings (as Strings). The first element is the default encoding.- Overrides:
engineGetCertPathEncodingsin classCertificateFactorySpi- Returns:
- an iterator over supported
CertPathencodings (as Strings). - See Also:
method documentation for more info
-