Class JcaTlsCertificate
java.lang.Object
org.bouncycastle.tls.crypto.impl.jcajce.JcaTlsCertificate
- All Implemented Interfaces:
TlsCertificate
Implementation class for a single X.509 certificate based on the JCA.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final X509Certificate
protected final JcaTlsCrypto
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected DHPublicKey
protected ECPublicKey
protected PublicKey
-
Constructor Summary
ConstructorDescriptionJcaTlsCertificate
(JcaTlsCrypto crypto, byte[] encoding) JcaTlsCertificate
(JcaTlsCrypto crypto, X509Certificate certificate) -
Method Summary
Modifier and TypeMethodDescriptioncheckUsageInRole
(int tlsCertificateRole) static JcaTlsCertificate
convert
(JcaTlsCrypto crypto, TlsCertificate certificate) createEncryptor
(int tlsCertificateRole) Return an encryptor based on the public key in this certificate.createVerifier
(int signatureScheme) createVerifier
(short signatureAlgorithm) byte[]
byte[]
getExtension
(org.bouncycastle.asn1.ASN1ObjectIdentifier extensionOID) short
protected PublicKey
org.bouncycastle.asn1.ASN1Encodable
protected org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
protected boolean
implSupportsSignatureAlgorithm
(short signatureAlgorithm) static X509Certificate
parseCertificate
(org.bouncycastle.jcajce.util.JcaJceHelper helper, byte[] encoding) protected boolean
supportsKeyUsageBit
(int keyUsageBit) protected boolean
protected boolean
supportsRSA_PSS_PSS
(short signatureAlgorithm) protected boolean
boolean
supportsSignatureAlgorithm
(short signatureAlgorithm) boolean
supportsSignatureAlgorithmCA
(short signatureAlgorithm) protected void
validateKeyUsageBit
(int keyUsageBit) protected void
protected void
validateRSA_PSS_PSS
(short signatureAlgorithm) protected void
-
Field Details
-
KU_DIGITAL_SIGNATURE
protected static final int KU_DIGITAL_SIGNATURE- See Also:
-
KU_NON_REPUDIATION
protected static final int KU_NON_REPUDIATION- See Also:
-
KU_KEY_ENCIPHERMENT
protected static final int KU_KEY_ENCIPHERMENT- See Also:
-
KU_DATA_ENCIPHERMENT
protected static final int KU_DATA_ENCIPHERMENT- See Also:
-
KU_KEY_AGREEMENT
protected static final int KU_KEY_AGREEMENT- See Also:
-
KU_KEY_CERT_SIGN
protected static final int KU_KEY_CERT_SIGN- See Also:
-
KU_CRL_SIGN
protected static final int KU_CRL_SIGN- See Also:
-
KU_ENCIPHER_ONLY
protected static final int KU_ENCIPHER_ONLY- See Also:
-
KU_DECIPHER_ONLY
protected static final int KU_DECIPHER_ONLY- See Also:
-
crypto
-
certificate
-
pubKeyDH
-
pubKeyEC
-
pubKeyRSA
-
-
Constructor Details
-
JcaTlsCertificate
- Throws:
IOException
-
JcaTlsCertificate
-
-
Method Details
-
convert
public static JcaTlsCertificate convert(JcaTlsCrypto crypto, TlsCertificate certificate) throws IOException - Throws:
IOException
-
parseCertificate
public static X509Certificate parseCertificate(org.bouncycastle.jcajce.util.JcaJceHelper helper, byte[] encoding) throws IOException - Throws:
IOException
-
createEncryptor
Description copied from interface:TlsCertificate
Return an encryptor based on the public key in this certificate.- Specified by:
createEncryptor
in interfaceTlsCertificate
- Parameters:
tlsCertificateRole
-TlsCertificateRole
- Returns:
- a TlsEncryptor based on this certificate's public key.
- Throws:
IOException
-
createVerifier
- Specified by:
createVerifier
in interfaceTlsCertificate
- Parameters:
signatureAlgorithm
-SignatureAlgorithm
- Throws:
IOException
-
createVerifier
- Specified by:
createVerifier
in interfaceTlsCertificate
- Parameters:
signatureScheme
-SignatureScheme
- Throws:
IOException
-
getEncoded
- Specified by:
getEncoded
in interfaceTlsCertificate
- Throws:
IOException
-
getExtension
public byte[] getExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier extensionOID) throws IOException - Specified by:
getExtension
in interfaceTlsCertificate
- Throws:
IOException
-
getSerialNumber
- Specified by:
getSerialNumber
in interfaceTlsCertificate
-
getSigAlgOID
- Specified by:
getSigAlgOID
in interfaceTlsCertificate
- Returns:
- the OID of this certificate's 'signatureAlgorithm', as a String.
-
getSigAlgParams
- Specified by:
getSigAlgParams
in interfaceTlsCertificate
- Throws:
IOException
-
getLegacySignatureAlgorithm
- Specified by:
getLegacySignatureAlgorithm
in interfaceTlsCertificate
- Returns:
SignatureAlgorithm
- Throws:
IOException
-
supportsSignatureAlgorithm
- Specified by:
supportsSignatureAlgorithm
in interfaceTlsCertificate
- Parameters:
signatureAlgorithm
-SignatureAlgorithm
- Returns:
- true if (and only if) this certificate can be used to verify the given signature algorithm.
- Throws:
IOException
-
supportsSignatureAlgorithmCA
- Specified by:
supportsSignatureAlgorithmCA
in interfaceTlsCertificate
- Throws:
IOException
-
checkUsageInRole
- Specified by:
checkUsageInRole
in interfaceTlsCertificate
- Parameters:
tlsCertificateRole
-TlsCertificateRole
- Throws:
IOException
-
implSupportsSignatureAlgorithm
- Throws:
IOException
-
getPublicKey
- Throws:
IOException
-
getSubjectPublicKeyInfo
protected org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getSubjectPublicKeyInfo() throws IOException- Throws:
IOException
-
getX509Certificate
-
supportsKeyUsageBit
protected boolean supportsKeyUsageBit(int keyUsageBit) -
supportsRSA_PKCS1
- Throws:
IOException
-
supportsRSA_PSS_PSS
- Throws:
IOException
-
supportsRSA_PSS_RSAE
- Throws:
IOException
-
validateKeyUsageBit
- Throws:
IOException
-
validateRSA_PKCS1
- Throws:
IOException
-
validateRSA_PSS_PSS
- Throws:
IOException
-
validateRSA_PSS_RSAE
- Throws:
IOException
-