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 BcTlsCryptoprotected final org.bouncycastle.asn1.x509.SubjectPublicKeyInfoprotected org.bouncycastle.crypto.params.DHPublicKeyParametersprotected org.bouncycastle.crypto.params.ECPublicKeyParametersprotected org.bouncycastle.crypto.params.Ed25519PublicKeyParametersprotected org.bouncycastle.crypto.params.Ed448PublicKeyParametersprotected 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) shortorg.bouncycastle.crypto.params.DHPublicKeyParametersorg.bouncycastle.crypto.params.DSAPublicKeyParametersorg.bouncycastle.crypto.params.ECPublicKeyParametersorg.bouncycastle.crypto.params.Ed25519PublicKeyParametersorg.bouncycastle.crypto.params.Ed448PublicKeyParametersorg.bouncycastle.crypto.params.RSAKeyParametersprotected org.bouncycastle.crypto.params.AsymmetricKeyParameterorg.bouncycastle.asn1.ASN1Encodableorg.bouncycastle.asn1.x509.SubjectPublicKeyInfoprotected booleansupportsKeyUsage(int keyUsageBits) protected booleanprotected booleansupportsRSA_PSS_PSS(short signatureAlgorithm) protected booleanbooleansupportsSignatureAlgorithm(short signatureAlgorithm) protected booleansupportsSignatureAlgorithm(short signatureAlgorithm, int keyUsage) booleansupportsSignatureAlgorithmCA(short signatureAlgorithm) voidvalidateKeyUsage(int keyUsageBits) protected voidprotected voidvalidateRSA_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: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:
IOException
-
createVerifier
- Specified by:
createVerifierin interfaceTlsCertificate- Parameters:
signatureAlgorithm-SignatureAlgorithm- Throws:
IOException
-
createVerifier
- Specified by:
createVerifierin interfaceTlsCertificate- Parameters:
signatureScheme-SignatureScheme- Throws:
IOException
-
getEncoded
- Specified by:
getEncodedin interfaceTlsCertificate- Throws:
IOException
-
getExtension
public byte[] getExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier extensionOID) throws IOException - Specified by:
getExtensionin interfaceTlsCertificate- Throws:
IOException
-
getSerialNumber
- Specified by:
getSerialNumberin interfaceTlsCertificate
-
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
- Specified by:
getLegacySignatureAlgorithmin 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
-
getPubKeyRSA
- Throws:
IOException
-
supportsSignatureAlgorithm
- 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:
IOException
-
supportsSignatureAlgorithmCA
- Specified by:
supportsSignatureAlgorithmCAin interfaceTlsCertificate- Throws:
IOException
-
checkUsageInRole
- Specified by:
checkUsageInRolein interfaceTlsCertificate- Parameters:
tlsCertificateRole-TlsCertificateRole- Throws:
IOException
-
getPublicKey
- Throws:
IOException
-
supportsKeyUsage
protected boolean supportsKeyUsage(int keyUsageBits) -
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
-
validateRSA_PKCS1
- Throws:
IOException
-
validateRSA_PSS_PSS
- Throws:
IOException
-
validateRSA_PSS_RSAE
- Throws:
IOException
-