Class BcTlsRawKeyCertificate
java.lang.Object
org.bouncycastle.tls.crypto.impl.bc.BcTlsRawKeyCertificate
- All Implemented Interfaces:
TlsCertificate
- Direct Known Subclasses:
BcTlsCertificate
Implementation class for a single X.509 certificate based on the BC light-weight API.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BcTlsCrypto
protected final org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
protected org.bouncycastle.crypto.params.DHPublicKeyParameters
protected org.bouncycastle.crypto.params.ECPublicKeyParameters
protected org.bouncycastle.crypto.params.Ed25519PublicKeyParameters
protected org.bouncycastle.crypto.params.Ed448PublicKeyParameters
protected org.bouncycastle.crypto.params.RSAKeyParameters
-
Constructor Summary
ConstructorsConstructorDescriptionBcTlsRawKeyCertificate
(BcTlsCrypto crypto, byte[] keyInfo) BcTlsRawKeyCertificate
(BcTlsCrypto crypto, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo keyInfo) -
Method Summary
Modifier and TypeMethodDescriptioncheckUsageInRole
(int tlsCertificateRole) 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
org.bouncycastle.crypto.params.DHPublicKeyParameters
org.bouncycastle.crypto.params.DSAPublicKeyParameters
org.bouncycastle.crypto.params.ECPublicKeyParameters
org.bouncycastle.crypto.params.Ed25519PublicKeyParameters
org.bouncycastle.crypto.params.Ed448PublicKeyParameters
org.bouncycastle.pqc.crypto.mldsa.MLDSAPublicKeyParameters
org.bouncycastle.crypto.params.RSAKeyParameters
protected org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.asn1.ASN1Encodable
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
protected boolean
supportsKeyUsage
(int keyUsageBit) protected boolean
supportsMLDSA
(org.bouncycastle.asn1.ASN1ObjectIdentifier mlDsaAlgOid) protected boolean
protected boolean
supportsRSA_PSS_PSS
(short signatureAlgorithm) protected boolean
boolean
supportsSignatureAlgorithm
(short signatureAlgorithm) protected boolean
supportsSignatureAlgorithm
(short signatureAlgorithm, int keyUsage) boolean
supportsSignatureAlgorithmCA
(short signatureAlgorithm) void
validateKeyUsage
(int keyUsageBit) protected void
validateMLDSA
(org.bouncycastle.asn1.ASN1ObjectIdentifier mlDsaAlgOid) protected void
protected void
validateRSA_PSS_PSS
(short signatureAlgorithm) protected void
-
Field Details
-
crypto
-
keyInfo
protected final org.bouncycastle.asn1.x509.SubjectPublicKeyInfo keyInfo -
pubKeyDH
protected org.bouncycastle.crypto.params.DHPublicKeyParameters pubKeyDH -
pubKeyEC
protected org.bouncycastle.crypto.params.ECPublicKeyParameters pubKeyEC -
pubKeyEd25519
protected org.bouncycastle.crypto.params.Ed25519PublicKeyParameters pubKeyEd25519 -
pubKeyEd448
protected org.bouncycastle.crypto.params.Ed448PublicKeyParameters pubKeyEd448 -
pubKeyRSA
protected org.bouncycastle.crypto.params.RSAKeyParameters pubKeyRSA
-
-
Constructor Details
-
BcTlsRawKeyCertificate
-
BcTlsRawKeyCertificate
public BcTlsRawKeyCertificate(BcTlsCrypto crypto, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo keyInfo)
-
-
Method Details
-
getSubjectPublicKeyInfo
public org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getSubjectPublicKeyInfo() -
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
public org.bouncycastle.asn1.ASN1Encodable getSigAlgParams()- Specified by:
getSigAlgParams
in interfaceTlsCertificate
-
getLegacySignatureAlgorithm
- Specified by:
getLegacySignatureAlgorithm
in interfaceTlsCertificate
- Returns:
SignatureAlgorithm
- Throws:
IOException
-
getPubKeyDH
- Throws:
IOException
-
getPubKeyDSS
- Throws:
IOException
-
getPubKeyEC
- Throws:
IOException
-
getPubKeyEd25519
public org.bouncycastle.crypto.params.Ed25519PublicKeyParameters getPubKeyEd25519() throws IOException- Throws:
IOException
-
getPubKeyEd448
- Throws:
IOException
-
getPubKeyMLDSA
public org.bouncycastle.pqc.crypto.mldsa.MLDSAPublicKeyParameters getPubKeyMLDSA() throws IOException- Throws:
IOException
-
getPubKeyRSA
- 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
-
getPublicKey
- Throws:
IOException
-
supportsKeyUsage
protected boolean supportsKeyUsage(int keyUsageBit) -
supportsMLDSA
protected boolean supportsMLDSA(org.bouncycastle.asn1.ASN1ObjectIdentifier mlDsaAlgOid) -
supportsRSA_PKCS1
protected boolean supportsRSA_PKCS1() -
supportsRSA_PSS_PSS
protected boolean supportsRSA_PSS_PSS(short signatureAlgorithm) -
supportsRSA_PSS_RSAE
protected boolean supportsRSA_PSS_RSAE() -
supportsSignatureAlgorithm
protected boolean supportsSignatureAlgorithm(short signatureAlgorithm, int keyUsage) throws IOException - Throws:
IOException
-
validateKeyUsage
- Throws:
IOException
-
validateMLDSA
protected void validateMLDSA(org.bouncycastle.asn1.ASN1ObjectIdentifier mlDsaAlgOid) throws IOException - Throws:
IOException
-
validateRSA_PKCS1
- Throws:
IOException
-
validateRSA_PSS_PSS
- Throws:
IOException
-
validateRSA_PSS_RSAE
- Throws:
IOException
-