Top Description Fields Constructors Methods
org.bouncycastle.tls.crypto.impl.jcajce

public Class JcaTlsCertificate

extends Object
implements TlsCertificate
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tls.crypto.TlsCertificate
Imports
java.io.ByteArrayInputStream, .IOException, java.math.BigInteger, java.security.GeneralSecurityException, .PublicKey, java.security.cert.CertificateEncodingException, .X509Certificate, java.security.interfaces.DSAPublicKey, .ECPublicKey, .RSAPublicKey, java.security.spec.AlgorithmParameterSpec, javax.crypto.interfaces.DHPublicKey, org.bouncycastle.asn1.ASN1Encodable, .ASN1Encoding, .ASN1ObjectIdentifier, .ASN1OctetString, .ASN1Primitive, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .Certificate, .SubjectPublicKeyInfo, org.bouncycastle.jcajce.util.JcaJceHelper, org.bouncycastle.tls.AlertDescription, .HashAlgorithm, .SignatureAlgorithm, .SignatureScheme, .TlsFatalAlert, .TlsUtils, org.bouncycastle.tls.crypto.Tls13Verifier, .TlsCertificate, .TlsCertificateRole, .TlsCryptoException, .TlsEncryptor, .TlsVerifier, org.bouncycastle.tls.crypto.impl.LegacyTls13Verifier, .RSAUtil

Implementation class for a single X.509 certificate based on the JCA.

Field Summary

Modifier and TypeField and Description
protected 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

AccessConstructor and Description
public
JcaTlsCertificate(JcaTlsCrypto crypto, byte[] encoding)

public

Method Summary

Modifier and TypeMethod and Description
public TlsCertificate
public static JcaTlsCertificate
convert(JcaTlsCrypto crypto, TlsCertificate certificate)

public TlsEncryptor
createEncryptor(int tlsCertificateRole)

Implements org.bouncycastle.tls.crypto.TlsCertificate.createEncryptor.

Return an encryptor based on the public key in this certificate.
public TlsVerifier
public Tls13Verifier
public byte[]
public byte[]
public short
pack-priv DHPublicKey
pack-priv DSAPublicKey
pack-priv ECPublicKey
pack-priv PublicKey
pack-priv PublicKey
pack-priv PublicKey
protected PublicKey
public BigInteger
public String
public ASN1Encodable
protected SubjectPublicKeyInfo
public X509Certificate
protected boolean
implSupportsSignatureAlgorithm(short signatureAlgorithm)

public static X509Certificate
parseCertificate(JcaJceHelper helper, byte[] encoding)

protected boolean
supportsKeyUsageBit(int keyUsageBit)

protected boolean
protected boolean
supportsRSA_PSS_PSS(short signatureAlgorithm)

protected boolean
public boolean
public boolean
protected void
validateKeyUsageBit(int keyUsageBit)

protected void
protected void
validateRSA_PSS_PSS(short signatureAlgorithm)

protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

certificateback to summary
protected final X509Certificate certificate
cryptoback to summary
protected final JcaTlsCrypto crypto
KU_CRL_SIGNback to summary
protected static final int KU_CRL_SIGN
KU_DATA_ENCIPHERMENTback to summary
protected static final int KU_DATA_ENCIPHERMENT
KU_DECIPHER_ONLYback to summary
protected static final int KU_DECIPHER_ONLY
KU_DIGITAL_SIGNATUREback to summary
protected static final int KU_DIGITAL_SIGNATURE
KU_ENCIPHER_ONLYback to summary
protected static final int KU_ENCIPHER_ONLY
KU_KEY_AGREEMENTback to summary
protected static final int KU_KEY_AGREEMENT
KU_KEY_CERT_SIGNback to summary
protected static final int KU_KEY_CERT_SIGN
KU_KEY_ENCIPHERMENTback to summary
protected static final int KU_KEY_ENCIPHERMENT
KU_NON_REPUDIATIONback to summary
protected static final int KU_NON_REPUDIATION
pubKeyDHback to summary
protected DHPublicKey pubKeyDH
pubKeyECback to summary
protected ECPublicKey pubKeyEC
pubKeyRSAback to summary
protected PublicKey pubKeyRSA

Constructor Detail

JcaTlsCertificateback to summary
public JcaTlsCertificate(JcaTlsCrypto crypto, byte[] encoding) throws IOException
JcaTlsCertificateback to summary
public JcaTlsCertificate(JcaTlsCrypto crypto, X509Certificate certificate)

Method Detail

checkUsageInRoleback to summary
public TlsCertificate checkUsageInRole(int tlsCertificateRole) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.checkUsageInRole.

Parameters
tlsCertificateRole:int

Doc from org.bouncycastle.tls.crypto.TlsCertificate.checkUsageInRole.

TlsCertificateRole

convertback to summary
public static JcaTlsCertificate convert(JcaTlsCrypto crypto, TlsCertificate certificate) throws IOException
createEncryptorback to summary
public TlsEncryptor createEncryptor(int tlsCertificateRole) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.createEncryptor.

Doc from org.bouncycastle.tls.crypto.TlsCertificate.createEncryptor.

Return an encryptor based on the public key in this certificate.

Parameters
tlsCertificateRole:int

TlsCertificateRole

Returns:TlsEncryptor

a TlsEncryptor based on this certificate's public key.

createVerifierback to summary
public TlsVerifier createVerifier(short signatureAlgorithm) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.createVerifier.

Parameters
signatureAlgorithm:short

Doc from org.bouncycastle.tls.crypto.TlsCertificate.createVerifier.

SignatureAlgorithm

createVerifierback to summary
public Tls13Verifier createVerifier(int signatureScheme) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.createVerifier.

Parameters
signatureScheme:int

Doc from org.bouncycastle.tls.crypto.TlsCertificate.createVerifier.

SignatureScheme

getEncodedback to summary
public byte[] getEncoded() throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.getEncoded.

getExtensionback to summary
public byte[] getExtension(ASN1ObjectIdentifier extensionOID) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.getExtension.

getLegacySignatureAlgorithmback to summary
public short getLegacySignatureAlgorithm() throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.getLegacySignatureAlgorithm.

Returns:short

Doc from org.bouncycastle.tls.crypto.TlsCertificate.getLegacySignatureAlgorithm.

SignatureAlgorithm

getPubKeyDHback to summary
pack-priv DHPublicKey getPubKeyDH() throws IOException
getPubKeyDSSback to summary
pack-priv DSAPublicKey getPubKeyDSS() throws IOException
getPubKeyECback to summary
pack-priv ECPublicKey getPubKeyEC() throws IOException
getPubKeyEd25519back to summary
pack-priv PublicKey getPubKeyEd25519() throws IOException
getPubKeyEd448back to summary
pack-priv PublicKey getPubKeyEd448() throws IOException
getPubKeyRSAback to summary
pack-priv PublicKey getPubKeyRSA() throws IOException
getPublicKeyback to summary
protected PublicKey getPublicKey() throws IOException
getSerialNumberback to summary
public BigInteger getSerialNumber()

Implements org.bouncycastle.tls.crypto.TlsCertificate.getSerialNumber.

getSigAlgOIDback to summary
public String getSigAlgOID()

Implements org.bouncycastle.tls.crypto.TlsCertificate.getSigAlgOID.

Returns:String

Doc from org.bouncycastle.tls.crypto.TlsCertificate.getSigAlgOID.

the OID of this certificate's 'signatureAlgorithm', as a String.

getSigAlgParamsback to summary
public ASN1Encodable getSigAlgParams() throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.getSigAlgParams.

getSubjectPublicKeyInfoback to summary
protected SubjectPublicKeyInfo getSubjectPublicKeyInfo() throws IOException
getX509Certificateback to summary
public X509Certificate getX509Certificate()
implSupportsSignatureAlgorithmback to summary
protected boolean implSupportsSignatureAlgorithm(short signatureAlgorithm) throws IOException
parseCertificateback to summary
public static X509Certificate parseCertificate(JcaJceHelper helper, byte[] encoding) throws IOException
supportsKeyUsageBitback to summary
protected boolean supportsKeyUsageBit(int keyUsageBit)
supportsRSA_PKCS1back to summary
protected boolean supportsRSA_PKCS1() throws IOException
supportsRSA_PSS_PSSback to summary
protected boolean supportsRSA_PSS_PSS(short signatureAlgorithm) throws IOException
supportsRSA_PSS_RSAEback to summary
protected boolean supportsRSA_PSS_RSAE() throws IOException
supportsSignatureAlgorithmback to summary
public boolean supportsSignatureAlgorithm(short signatureAlgorithm) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.supportsSignatureAlgorithm.

Parameters
signatureAlgorithm:short

Doc from org.bouncycastle.tls.crypto.TlsCertificate.supportsSignatureAlgorithm.

SignatureAlgorithm

Returns:boolean

Doc from org.bouncycastle.tls.crypto.TlsCertificate.supportsSignatureAlgorithm.

true if (and only if) this certificate can be used to verify the given signature algorithm.

supportsSignatureAlgorithmCAback to summary
public boolean supportsSignatureAlgorithmCA(short signatureAlgorithm) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCertificate.supportsSignatureAlgorithmCA.

validateKeyUsageBitback to summary
protected void validateKeyUsageBit(int keyUsageBit) throws IOException
validateRSA_PKCS1back to summary
protected void validateRSA_PKCS1() throws IOException
validateRSA_PSS_PSSback to summary
protected void validateRSA_PSS_PSS(short signatureAlgorithm) throws IOException
validateRSA_PSS_RSAEback to summary
protected void validateRSA_PSS_RSAE() throws IOException