com.ibm.crypto.pkcs11impl.provider

Class X509Factory

  • java.lang.Object
    • java.security.cert.CertificateFactorySpi
      • com.ibm.crypto.pkcs11impl.provider.X509Factory


  • public class X509Factory
    extends java.security.cert.CertificateFactorySpi
    This 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.String BEGIN_CERT 
      static java.lang.String END_CERT 
    • Constructor Summary

      Constructors 
      Constructor and Description
      X509Factory()
      Creates an instance of this class
      X509Factory(java.security.Provider provider)
      Creates an instance of this class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.security.cert.Certificate engineGenerateCertificate(java.io.InputStream is)
      Generates an X.509 certificate object and initializes it with the data read from the input stream is.
      java.util.Collection engineGenerateCertificates(java.io.InputStream is)
      Returns a (possibly empty) collection view of X.509 certificates read from the given input stream is.
      java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream inStream)
      Generates a CertPath object and initializes it with the data read from the input stream 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 input stream inStream.
      java.security.cert.CertPath engineGenerateCertPath(java.util.List certificates)
      Generates a CertPath object and initializes it with the list of certificates supplied.
      java.security.cert.CRL engineGenerateCRL(java.io.InputStream is)
      Generates an X.509 certificate revocation list (CRL) object and initializes it with the data read from the given input stream is.
      java.util.Collection engineGenerateCRLs(java.io.InputStream is)
      Returns a (possibly empty) collection view of X.509 CRLs read from the given input stream is.
      java.util.Iterator engineGetCertPathEncodings()
      Returns the encodings supported by this certification path factory, with the default encoding first.
      com.ibm.security.x509.X509CertImpl intern(java.security.cert.X509Certificate c)
      Return an interned X509CertImpl for the given certificate.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • X509Factory

        public X509Factory()
        Creates an instance of this class
      • X509Factory

        public X509Factory(java.security.Provider provider)
        Creates an instance of this class
    • Method Detail

      • engineGenerateCertificate

        public java.security.cert.Certificate engineGenerateCertificate(java.io.InputStream is)
                                                                 throws java.security.cert.CertificateException
        Generates an X.509 certificate object and initializes it with the data read from the input stream is.
        Specified by:
        engineGenerateCertificate in class java.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.
      • intern

        public com.ibm.security.x509.X509CertImpl intern(java.security.cert.X509Certificate c)
                                                  throws java.security.cert.CertificateException
        Return 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.CertificateException
        Returns a (possibly empty) collection view of X.509 certificates read from the given input stream is.
        Specified by:
        engineGenerateCertificates in class java.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.
      • engineGenerateCRL

        public java.security.cert.CRL engineGenerateCRL(java.io.InputStream is)
                                                 throws java.security.cert.CRLException
        Generates an X.509 certificate revocation list (CRL) object and initializes it with the data read from the given input stream is.
        Specified by:
        engineGenerateCRL in class java.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.
      • engineGenerateCRLs

        public java.util.Collection engineGenerateCRLs(java.io.InputStream is)
                                                throws java.security.cert.CRLException
        Returns a (possibly empty) collection view of X.509 CRLs read from the given input stream is.
        Specified by:
        engineGenerateCRLs in class java.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.
      • engineGenerateCertPath

        public java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream inStream)
                                                           throws java.security.cert.CertificateException
        Generates 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:
        engineGenerateCertPath in class java.security.cert.CertificateFactorySpi
        Parameters:
        inStream - an input stream with the data
        Returns:
        a CertPath initialized with the data from the input stream
        Throws:
        CertificateException - if an exception occurs
        java.security.cert.CertificateException
      • engineGenerateCertPath

        public java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream inStream,
                                                                  java.lang.String encoding)
                                                           throws java.security.cert.CertificateException
        Generates a CertPath object and initializes it with the data read from the input stream inStream. The data is assumed to be in the specified encoding.
        Overrides:
        engineGenerateCertPath in class java.security.cert.CertificateFactorySpi
        Parameters:
        inStream - an input stream with the data
        encoding - the encoding used for the data
        Returns:
        a CertPath initialized with the data from the input stream
        Throws:
        CertificateException - if an exception occurs
        java.security.cert.CertificateException
      • engineGenerateCertPath

        public java.security.cert.CertPath engineGenerateCertPath(java.util.List certificates)
                                                           throws java.security.cert.CertificateException
        Generates 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:
        engineGenerateCertPath in class java.security.cert.CertificateFactorySpi
        Parameters:
        certificates - a List of Certificates
        Returns:
        a CertPath initialized with the supplied list of certificates
        Throws:
        CertificateException - if an exception occurs
        java.security.cert.CertificateException
      • engineGetCertPathEncodings

        public java.util.Iterator engineGetCertPathEncodings()
        Returns the encodings supported by this certification path factory, with the default encoding first.
        Overrides:
        engineGetCertPathEncodings in class java.security.cert.CertificateFactorySpi
        Returns:
        an Iterator of the encodings supported

© Portions Copyright 2003, 2017 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2017, Oracle and/or its affiliates. All rights reserved.