com.ibm.crypto.fips.provider
Class X509Factory
- java.lang.Object
-
- java.security.cert.CertificateFactorySpi
-
- com.ibm.crypto.fips.provider.X509Factory
-
public final class X509Factory extends java.security.cert.CertificateFactorySpiThis class defines a certificate factory for X.509 v3 certificates and X.509 v2 certificate revocation lists (CRLs).- See Also:
CertificateFactorySpi,Certificate,CRL,X509Certificate,X509CRL,X509CertImpl,X509CRLImpl
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringBEGIN_CERTstatic java.lang.StringEND_CERTprotected static java.lang.Stringpkcs7Stringprotected static java.lang.StringpkipStringprotected static java.lang.Stringx509String
-
Constructor Summary
Constructors Constructor and Description X509Factory()
-
Method Summary
Methods Modifier and Type Method and Description java.security.cert.CertificateengineGenerateCertificate(java.io.InputStream is)Generates an X.509 certificate object and initializes it with the data read from the input streamis.java.util.CollectionengineGenerateCertificates(java.io.InputStream is)Returns a (possibly empty) collection view of X.509 certificates read from the given input streamis.java.security.cert.CertPathengineGenerateCertPath(java.io.InputStream inStream)Generates a CertPath object and initializes it with the data read from the input stream inStream.java.security.cert.CertPathengineGenerateCertPath(java.io.InputStream inStream, java.lang.String encoding)Generates aCertPathobject and initializes it with the data read from the input stream inStream.java.security.cert.CertPathengineGenerateCertPath(java.util.List certificates)Generates a CertPath object and initializes it with the list of certificates supplied.java.security.cert.CRLengineGenerateCRL(java.io.InputStream is)Generates an X.509 certificate revocation list (CRL) object and initializes it with the data read from the given input streamis.java.util.CollectionengineGenerateCRLs(java.io.InputStream is)Returns a (possibly empty) collection view of X.509 CRLs read from the given input streamis.java.util.IteratorengineGetCertPathEncodings()Returns the encodings supported by this certification path factory, with the default encoding first.static com.ibm.security.x509.X509CertImplintern(java.security.cert.X509Certificate c)Return an interned X509CertImpl for the given certificate.static com.ibm.security.x509.X509CRLImplintern(java.security.cert.X509CRL c)protected java.security.cert.CertificateinternalGenerateCertificate(java.io.InputStream is)Generates an X.509 certificate object and initializes it with the data read from the input streamis.protected java.util.CollectioninternalGenerateCertificates(java.io.InputStream is)Returns a (possibly empty) collection view of X.509 certificates read from the given input streamis.protected java.security.cert.CertPathinternalGenerateCertPath(java.io.InputStream inStream)Generates a CertPath object and initializes it with the data read from the input stream inStream.protected java.security.cert.CertPathinternalGenerateCertPath(java.io.InputStream inStream, java.lang.String encoding)Generates aCertPathobject and initializes it with the data read from the input stream inStream.protected java.security.cert.CertPathinternalGenerateCertPath(java.util.List certificates)Generates a CertPath object and initializes it with the list of certificates supplied.protected java.security.cert.CRLinternalGenerateCRL(java.io.InputStream is)Generates an X.509 certificate revocation list (CRL) object and initializes it with the data read from the given input streamis.protected java.util.CollectioninternalGenerateCRLs(java.io.InputStream is)Returns a (possibly empty) collection view of X.509 CRLs read from the given input streamis.protected java.util.IteratorinternalGetCertPathEncodings()Returns the encodings supported by this certification path factory, with the default encoding first.
-
-
-
Field Detail
-
BEGIN_CERT
public static final java.lang.String BEGIN_CERT
- See Also:
- Constant Field Values
-
END_CERT
public static final java.lang.String END_CERT
- See Also:
- Constant Field Values
-
pkcs7String
protected static final java.lang.String pkcs7String
- See Also:
- Constant Field Values
-
pkipString
protected static final java.lang.String pkipString
- See Also:
- Constant Field Values
-
x509String
protected static final java.lang.String x509String
- See Also:
- Constant Field Values
-
-
Method Detail
-
engineGenerateCertificate
public java.security.cert.Certificate engineGenerateCertificate(java.io.InputStream is) throws java.security.cert.CertificateExceptionGenerates an X.509 certificate object and initializes it with the data read from the input streamis.- Specified by:
engineGenerateCertificatein classjava.security.cert.CertificateFactorySpi- Parameters:
is- an input stream with the certificate data.- Returns:
- an X.509 certificate object initialized with the data from the input stream.
- Throws:
java.security.cert.CertificateException- on parsing errors.FIPSRuntimeException- if the module is not runnable.
-
internalGenerateCertificate
protected java.security.cert.Certificate internalGenerateCertificate(java.io.InputStream is) throws java.security.cert.CertificateExceptionGenerates an X.509 certificate object and initializes it with the data read from the input streamis.- Parameters:
is- an input stream with the certificate data.- Returns:
- an X.509 certificate object initialized with the data from the input stream.
- Throws:
java.security.cert.CertificateException- on parsing errors.
-
intern
public static com.ibm.security.x509.X509CertImpl intern(java.security.cert.X509Certificate c) throws java.security.cert.CertificateExceptionReturn an interned X509CertImpl for the given certificate. If the given X509Certificate or X509CertImpl is already present in the cert cache, the cached object is returned. Otherwise, if it is a X509Certificate, it is first converted to a X509CertImpl. Then the X509CertImpl is added to the cache and returned. Note that all certificates created via generateCertificate(InputStream) are already interned and this method does not need to be called. It is useful for certificates that cannot be created via generateCertificate() and for converting other X509Certificate implementations to an X509CertImpl.- Throws:
java.security.cert.CertificateException
-
engineGenerateCertificates
public java.util.Collection engineGenerateCertificates(java.io.InputStream is) throws java.security.cert.CertificateExceptionReturns a (possibly empty) collection view of X.509 certificates read from the given input streamis.- Specified by:
engineGenerateCertificatesin classjava.security.cert.CertificateFactorySpi- Parameters:
is- the input stream with the certificates.- Returns:
- a (possibly empty) collection view of X.509 certificate objects initialized with the data from the input stream.
- Throws:
java.security.cert.CertificateException- on parsing errors.FIPSRuntimeException- if the module is not runnable.
-
internalGenerateCertificates
protected java.util.Collection internalGenerateCertificates(java.io.InputStream is) throws java.security.cert.CertificateExceptionReturns a (possibly empty) collection view of X.509 certificates read from the given input streamis.- Parameters:
is- the input stream with the certificates.- Returns:
- a (possibly empty) collection view of X.509 certificate objects initialized with the data from the input stream.
- Throws:
java.security.cert.CertificateException- on parsing errors.
-
engineGenerateCRL
public java.security.cert.CRL engineGenerateCRL(java.io.InputStream is) throws java.security.cert.CRLExceptionGenerates an X.509 certificate revocation list (CRL) object and initializes it with the data read from the given input streamis.- Specified by:
engineGenerateCRLin classjava.security.cert.CertificateFactorySpi- Parameters:
is- an input stream with the CRL data.- Returns:
- an X.509 CRL object initialized with the data from the input stream.
- Throws:
java.security.cert.CRLException- on parsing errors.FIPSRuntimeException- if the module is not runnable.
-
internalGenerateCRL
protected java.security.cert.CRL internalGenerateCRL(java.io.InputStream is) throws java.security.cert.CRLExceptionGenerates an X.509 certificate revocation list (CRL) object and initializes it with the data read from the given input streamis.- Parameters:
is- an input stream with the CRL data.- Returns:
- an X.509 CRL object initialized with the data from the input stream.
- Throws:
java.security.cert.CRLException- on parsing errors.
-
engineGenerateCRLs
public java.util.Collection engineGenerateCRLs(java.io.InputStream is) throws java.security.cert.CRLExceptionReturns a (possibly empty) collection view of X.509 CRLs read from the given input streamis.- Specified by:
engineGenerateCRLsin classjava.security.cert.CertificateFactorySpi- Parameters:
is- the input stream with the CRLs.- Returns:
- a (possibly empty) collection view of X.509 CRL objects initialized with the data from the input stream.
- Throws:
java.security.cert.CRLException- on parsing errors.FIPSRuntimeException- if the module is not runnable.
-
internalGenerateCRLs
protected java.util.Collection internalGenerateCRLs(java.io.InputStream is) throws java.security.cert.CRLExceptionReturns a (possibly empty) collection view of X.509 CRLs read from the given input streamis.- Parameters:
is- the input stream with the CRLs.- Returns:
- a (possibly empty) collection view of X.509 CRL objects initialized with the data from the input stream.
- Throws:
java.security.cert.CRLException- on parsing errors.
-
engineGenerateCertPath
public java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream inStream) throws java.security.cert.CertificateExceptionGenerates a CertPath object and initializes it with the data read from the input stream inStream. The data is assumed to be in the default encoding.- Overrides:
engineGenerateCertPathin classjava.security.cert.CertificateFactorySpi- Parameters:
inStream- an input stream with the data- Returns:
- a
CertPathinitialized with the data from the input stream - Throws:
- if an exception occursCertificateExceptionFIPSRuntimeException- if the module is not runnable.java.security.cert.CertificateException
-
internalGenerateCertPath
protected java.security.cert.CertPath internalGenerateCertPath(java.io.InputStream inStream) throws java.security.cert.CertificateExceptionGenerates a CertPath object and initializes it with the data read from the input stream inStream. The data is assumed to be in the default encoding.- Parameters:
inStream- an input stream with the data- Returns:
- a
CertPathinitialized with the data from the input stream - Throws:
- if an exception occursCertificateExceptionjava.security.cert.CertificateException
-
engineGenerateCertPath
public java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream inStream, java.lang.String encoding) throws java.security.cert.CertificateExceptionGenerates aCertPathobject and initializes it with the data read from the input stream inStream. The data is assumed to be in the specified encoding.- Overrides:
engineGenerateCertPathin classjava.security.cert.CertificateFactorySpi- Parameters:
inStream- an input stream with the dataencoding- the encoding used for the data- Returns:
- a
CertPathinitialized with the data from the input stream - Throws:
- if an exception occursCertificateExceptionFIPSRuntimeException- if the module is not runnable.java.security.cert.CertificateException
-
internalGenerateCertPath
protected java.security.cert.CertPath internalGenerateCertPath(java.io.InputStream inStream, java.lang.String encoding) throws java.security.cert.CertificateExceptionGenerates aCertPathobject and initializes it with the data read from the input stream inStream. The data is assumed to be in the specified encoding.- Parameters:
inStream- an input stream with the dataencoding- the encoding used for the data- Returns:
- a
CertPathinitialized with the data from the input stream - Throws:
- if an exception occursCertificateExceptionjava.security.cert.CertificateException
-
engineGenerateCertPath
public java.security.cert.CertPath engineGenerateCertPath(java.util.List certificates) throws java.security.cert.CertificateExceptionGenerates a CertPath object and initializes it with the list of certificates supplied. The certificates supplied must be of a type supported by the CertPathFactory.- Overrides:
engineGenerateCertPathin classjava.security.cert.CertificateFactorySpi- Parameters:
certificates- aListof Certificates- Returns:
- a
CertPathinitialized with the supplied list of certificates - Throws:
- if an exception occursCertificateExceptionFIPSRuntimeException- if the module is not runnable.java.security.cert.CertificateException
-
internalGenerateCertPath
protected java.security.cert.CertPath internalGenerateCertPath(java.util.List certificates) throws java.security.cert.CertificateExceptionGenerates a CertPath object and initializes it with the list of certificates supplied. The certificates supplied must be of a type supported by the CertPathFactory.- Parameters:
certificates- aListof Certificates- Returns:
- a
CertPathinitialized with the supplied list of certificates - Throws:
- if an exception occursCertificateExceptionjava.security.cert.CertificateException
-
engineGetCertPathEncodings
public java.util.Iterator engineGetCertPathEncodings()
Returns the encodings supported by this certification path factory, with the default encoding first.- Overrides:
engineGetCertPathEncodingsin classjava.security.cert.CertificateFactorySpi- Returns:
- an
Iteratorof the encodings supported - Throws:
FIPSRuntimeException- if the module is not runnable.
-
internalGetCertPathEncodings
protected java.util.Iterator internalGetCertPathEncodings()
Returns the encodings supported by this certification path factory, with the default encoding first.- Returns:
- an
Iteratorof the encodings supported
-
intern
public static com.ibm.security.x509.X509CRLImpl intern(java.security.cert.X509CRL c) throws java.security.cert.CRLException- Throws:
java.security.cert.CRLException
-
-