Class JcaTlsCertificate

  • All Implemented Interfaces:
    TlsCertificate

    public class JcaTlsCertificate
    extends java.lang.Object
    implements TlsCertificate
    Implementation class for a single X.509 certificate based on the JCA.
    • Field Detail

      • certificate

        protected final java.security.cert.X509Certificate certificate
      • pubKeyDH

        protected javax.crypto.interfaces.DHPublicKey pubKeyDH
      • pubKeyEC

        protected java.security.interfaces.ECPublicKey pubKeyEC
      • pubKeyRSA

        protected java.security.PublicKey pubKeyRSA
    • Constructor Detail

      • JcaTlsCertificate

        public JcaTlsCertificate​(JcaTlsCrypto crypto,
                                 byte[] encoding)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • JcaTlsCertificate

        public JcaTlsCertificate​(JcaTlsCrypto crypto,
                                 java.security.cert.X509Certificate certificate)
    • Method Detail

      • parseCertificate

        public static java.security.cert.X509Certificate parseCertificate​(org.bouncycastle.jcajce.util.JcaJceHelper helper,
                                                                          byte[] encoding)
                                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getEncoded

        public byte[] getEncoded()
                          throws java.io.IOException
        Specified by:
        getEncoded in interface TlsCertificate
        Throws:
        java.io.IOException
      • getExtension

        public byte[] getExtension​(org.bouncycastle.asn1.ASN1ObjectIdentifier extensionOID)
                            throws java.io.IOException
        Specified by:
        getExtension in interface TlsCertificate
        Throws:
        java.io.IOException
      • getSigAlgOID

        public java.lang.String getSigAlgOID()
        Specified by:
        getSigAlgOID in interface TlsCertificate
        Returns:
        the OID of this certificate's 'signatureAlgorithm', as a String.
      • getSigAlgParams

        public org.bouncycastle.asn1.ASN1Encodable getSigAlgParams()
                                                            throws java.io.IOException
        Specified by:
        getSigAlgParams in interface TlsCertificate
        Throws:
        java.io.IOException
      • supportsSignatureAlgorithm

        public boolean supportsSignatureAlgorithm​(short signatureAlgorithm)
                                           throws java.io.IOException
        Specified by:
        supportsSignatureAlgorithm in interface TlsCertificate
        Parameters:
        signatureAlgorithm - SignatureAlgorithm
        Returns:
        true if (and only if) this certificate can be used to verify the given signature algorithm.
        Throws:
        java.io.IOException
      • supportsSignatureAlgorithmCA

        public boolean supportsSignatureAlgorithmCA​(short signatureAlgorithm)
                                             throws java.io.IOException
        Specified by:
        supportsSignatureAlgorithmCA in interface TlsCertificate
        Throws:
        java.io.IOException
      • implSupportsSignatureAlgorithm

        protected boolean implSupportsSignatureAlgorithm​(short signatureAlgorithm)
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getPublicKey

        protected java.security.PublicKey getPublicKey()
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getSubjectPublicKeyInfo

        protected org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getSubjectPublicKeyInfo()
                                                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getX509Certificate

        public java.security.cert.X509Certificate getX509Certificate()
      • supportsKeyUsageBit

        protected boolean supportsKeyUsageBit​(int keyUsageBit)
      • supportsRSA_PKCS1

        protected boolean supportsRSA_PKCS1()
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • supportsRSA_PSS_PSS

        protected boolean supportsRSA_PSS_PSS​(short signatureAlgorithm)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • supportsRSA_PSS_RSAE

        protected boolean supportsRSA_PSS_RSAE()
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • validateKeyUsageBit

        protected void validateKeyUsageBit​(int keyUsageBit)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • validateRSA_PKCS1

        protected void validateRSA_PKCS1()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • validateRSA_PSS_PSS

        protected void validateRSA_PSS_PSS​(short signatureAlgorithm)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • validateRSA_PSS_RSAE

        protected void validateRSA_PSS_RSAE()
                                     throws java.io.IOException
        Throws:
        java.io.IOException