Class BcTlsRawKeyCertificate
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.bc.BcTlsRawKeyCertificate
-
- All Implemented Interfaces:
TlsCertificate
- Direct Known Subclasses:
BcTlsCertificate
public class BcTlsRawKeyCertificate extends java.lang.Object implements TlsCertificate
Implementation class for a single X.509 certificate based on the BC light-weight API.
-
-
Field Summary
Fields Modifier and Type Field Description protected BcTlsCryptocryptoprotected org.bouncycastle.asn1.x509.SubjectPublicKeyInfokeyInfoprotected org.bouncycastle.crypto.params.DHPublicKeyParameterspubKeyDHprotected org.bouncycastle.crypto.params.ECPublicKeyParameterspubKeyECprotected org.bouncycastle.crypto.params.Ed25519PublicKeyParameterspubKeyEd25519protected org.bouncycastle.crypto.params.Ed448PublicKeyParameterspubKeyEd448protected org.bouncycastle.crypto.params.RSAKeyParameterspubKeyRSA
-
Constructor Summary
Constructors Constructor Description BcTlsRawKeyCertificate(BcTlsCrypto crypto, byte[] keyInfo)BcTlsRawKeyCertificate(BcTlsCrypto crypto, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo keyInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsCertificatecheckUsageInRole(int tlsCertificateRole)TlsEncryptorcreateEncryptor(int tlsCertificateRole)Return an encryptor based on the public key in this certificate.Tls13VerifiercreateVerifier(int signatureScheme)TlsVerifiercreateVerifier(short signatureAlgorithm)byte[]getEncoded()byte[]getExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier extensionOID)shortgetLegacySignatureAlgorithm()org.bouncycastle.crypto.params.DHPublicKeyParametersgetPubKeyDH()org.bouncycastle.crypto.params.DSAPublicKeyParametersgetPubKeyDSS()org.bouncycastle.crypto.params.ECPublicKeyParametersgetPubKeyEC()org.bouncycastle.crypto.params.Ed25519PublicKeyParametersgetPubKeyEd25519()org.bouncycastle.crypto.params.Ed448PublicKeyParametersgetPubKeyEd448()org.bouncycastle.crypto.params.MLDSAPublicKeyParametersgetPubKeyMLDSA()org.bouncycastle.crypto.params.RSAKeyParametersgetPubKeyRSA()org.bouncycastle.crypto.params.SLHDSAPublicKeyParametersgetPubKeySLHDSA()protected org.bouncycastle.crypto.params.AsymmetricKeyParametergetPublicKey()java.math.BigIntegergetSerialNumber()java.lang.StringgetSigAlgOID()org.bouncycastle.asn1.ASN1EncodablegetSigAlgParams()org.bouncycastle.asn1.x509.SubjectPublicKeyInfogetSubjectPublicKeyInfo()protected booleansupportsKeyUsage(int keyUsageBit)protected booleansupportsMLDSA(org.bouncycastle.asn1.ASN1ObjectIdentifier mlDsaAlgOid)protected booleansupportsRSA_PKCS1()protected booleansupportsRSA_PSS_PSS(short signatureAlgorithm)protected booleansupportsRSA_PSS_RSAE()booleansupportsSignatureAlgorithm(short signatureAlgorithm)protected booleansupportsSignatureAlgorithm(short signatureAlgorithm, int keyUsage)booleansupportsSignatureAlgorithmCA(short signatureAlgorithm)protected booleansupportsSLHDSA(org.bouncycastle.asn1.ASN1ObjectIdentifier slhDsaAlgOid)voidvalidateKeyUsage(int keyUsageBit)protected voidvalidateMLDSA(org.bouncycastle.asn1.ASN1ObjectIdentifier mlDsaAlgOid)protected voidvalidateRSA_PKCS1()protected voidvalidateRSA_PSS_PSS(short signatureAlgorithm)protected voidvalidateRSA_PSS_RSAE()protected voidvalidateSLHDSA(org.bouncycastle.asn1.ASN1ObjectIdentifier slhDsaAlgOid)
-
-
-
Field Detail
-
crypto
protected final BcTlsCrypto 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 Detail
-
BcTlsRawKeyCertificate
public BcTlsRawKeyCertificate(BcTlsCrypto crypto, byte[] keyInfo)
-
BcTlsRawKeyCertificate
public BcTlsRawKeyCertificate(BcTlsCrypto crypto, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo keyInfo)
-
-
Method Detail
-
getSubjectPublicKeyInfo
public org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getSubjectPublicKeyInfo()
-
createEncryptor
public TlsEncryptor createEncryptor(int tlsCertificateRole) throws java.io.IOException
Description copied from interface:TlsCertificateReturn an encryptor based on the public key in this certificate.- Specified by:
createEncryptorin interfaceTlsCertificate- Parameters:
tlsCertificateRole-TlsCertificateRole- Returns:
- a TlsEncryptor based on this certificate's public key.
- Throws:
java.io.IOException
-
createVerifier
public TlsVerifier createVerifier(short signatureAlgorithm) throws java.io.IOException
- Specified by:
createVerifierin interfaceTlsCertificate- Parameters:
signatureAlgorithm-SignatureAlgorithm- Throws:
java.io.IOException
-
createVerifier
public Tls13Verifier createVerifier(int signatureScheme) throws java.io.IOException
- Specified by:
createVerifierin interfaceTlsCertificate- Parameters:
signatureScheme-SignatureScheme- Throws:
java.io.IOException
-
getEncoded
public byte[] getEncoded() throws java.io.IOException- Specified by:
getEncodedin interfaceTlsCertificate- Throws:
java.io.IOException
-
getExtension
public byte[] getExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier extensionOID) throws java.io.IOException- Specified by:
getExtensionin interfaceTlsCertificate- Throws:
java.io.IOException
-
getSerialNumber
public java.math.BigInteger getSerialNumber()
- Specified by:
getSerialNumberin interfaceTlsCertificate
-
getSigAlgOID
public java.lang.String getSigAlgOID()
- Specified by:
getSigAlgOIDin interfaceTlsCertificate- Returns:
- the OID of this certificate's 'signatureAlgorithm', as a String.
-
getSigAlgParams
public org.bouncycastle.asn1.ASN1Encodable getSigAlgParams()
- Specified by:
getSigAlgParamsin interfaceTlsCertificate
-
getLegacySignatureAlgorithm
public short getLegacySignatureAlgorithm() throws java.io.IOException- Specified by:
getLegacySignatureAlgorithmin interfaceTlsCertificate- Returns:
SignatureAlgorithm- Throws:
java.io.IOException
-
getPubKeyDH
public org.bouncycastle.crypto.params.DHPublicKeyParameters getPubKeyDH() throws java.io.IOException- Throws:
java.io.IOException
-
getPubKeyDSS
public org.bouncycastle.crypto.params.DSAPublicKeyParameters getPubKeyDSS() throws java.io.IOException- Throws:
java.io.IOException
-
getPubKeyEC
public org.bouncycastle.crypto.params.ECPublicKeyParameters getPubKeyEC() throws java.io.IOException- Throws:
java.io.IOException
-
getPubKeyEd25519
public org.bouncycastle.crypto.params.Ed25519PublicKeyParameters getPubKeyEd25519() throws java.io.IOException- Throws:
java.io.IOException
-
getPubKeyEd448
public org.bouncycastle.crypto.params.Ed448PublicKeyParameters getPubKeyEd448() throws java.io.IOException- Throws:
java.io.IOException
-
getPubKeyMLDSA
public org.bouncycastle.crypto.params.MLDSAPublicKeyParameters getPubKeyMLDSA() throws java.io.IOException- Throws:
java.io.IOException
-
getPubKeySLHDSA
public org.bouncycastle.crypto.params.SLHDSAPublicKeyParameters getPubKeySLHDSA() throws java.io.IOException- Throws:
java.io.IOException
-
getPubKeyRSA
public org.bouncycastle.crypto.params.RSAKeyParameters getPubKeyRSA() throws java.io.IOException- Throws:
java.io.IOException
-
supportsSignatureAlgorithm
public boolean supportsSignatureAlgorithm(short signatureAlgorithm) throws java.io.IOException- Specified by:
supportsSignatureAlgorithmin interfaceTlsCertificate- 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:
supportsSignatureAlgorithmCAin interfaceTlsCertificate- Throws:
java.io.IOException
-
checkUsageInRole
public TlsCertificate checkUsageInRole(int tlsCertificateRole) throws java.io.IOException
- Specified by:
checkUsageInRolein interfaceTlsCertificate- Parameters:
tlsCertificateRole-TlsCertificateRole- Throws:
java.io.IOException
-
getPublicKey
protected org.bouncycastle.crypto.params.AsymmetricKeyParameter getPublicKey() throws java.io.IOException- Throws:
java.io.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()
-
supportsSLHDSA
protected boolean supportsSLHDSA(org.bouncycastle.asn1.ASN1ObjectIdentifier slhDsaAlgOid)
-
supportsSignatureAlgorithm
protected boolean supportsSignatureAlgorithm(short signatureAlgorithm, int keyUsage) throws java.io.IOException- Throws:
java.io.IOException
-
validateKeyUsage
public void validateKeyUsage(int keyUsageBit) throws java.io.IOException- Throws:
java.io.IOException
-
validateMLDSA
protected void validateMLDSA(org.bouncycastle.asn1.ASN1ObjectIdentifier mlDsaAlgOid) 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
-
validateSLHDSA
protected void validateSLHDSA(org.bouncycastle.asn1.ASN1ObjectIdentifier slhDsaAlgOid) throws java.io.IOException- Throws:
java.io.IOException
-
-