public class C509CertificateHolder
extends java.lang.Object
implements org.bouncycastle.util.Encodable
X509CertificateHolder.
For a natively signed certificate (type 2) the signature covers the
TBSCertificate CBOR sequence and isSignatureValid(org.bouncycastle.operator.ContentVerifierProvider) checks it directly over
those bytes. For a CBOR re-encoded X.509 certificate (type 3) the signature covers
the reconstructed DER TBSCertificate, and the holder can also be turned back into
an X509CertificateHolder with toX509CertificateHolder().
| Constructor and Description |
|---|
C509CertificateHolder(byte[] encoding)
Create a holder from the CBOR encoding of a C509 certificate.
|
C509CertificateHolder(org.bouncycastle.cbor.c509.C509Certificate certificate)
Base constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
org.bouncycastle.cbor.c509.C509Certificate |
getC509Certificate()
Return the certificate this holder wraps.
|
int |
getCertificateType()
Return the certificate type (
C509Certificate.TYPE_NATIVE or
C509Certificate.TYPE_REENCODED_X509). |
byte[] |
getEncoded()
Return the CBOR encoding of the certificate.
|
org.bouncycastle.asn1.x509.Extensions |
getExtensions()
Return the X.509 view of the extensions, or null if there are none.
|
org.bouncycastle.asn1.x500.X500Name |
getIssuer() |
java.util.Date |
getNotAfter()
Return the end of the validity period.
|
java.util.Date |
getNotBefore() |
java.math.BigInteger |
getSerialNumber() |
org.bouncycastle.cbor.c509.C509AlgorithmIdentifier |
getSignatureAlgorithm() |
byte[] |
getSignedBytes()
Return the bytes the certificate signature is computed over: the TBSCertificate
CBOR sequence for a natively signed certificate, the reconstructed DER
TBSCertificate for a re-encoded one.
|
org.bouncycastle.asn1.x500.X500Name |
getSubject() |
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo |
getSubjectPublicKeyInfo() |
int |
hashCode() |
boolean |
isSignatureValid(ContentVerifierProvider verifierProvider)
Validate the signature on this certificate.
|
boolean |
isValidOn(java.util.Date date)
Return whether or not the certificate is valid on the date given.
|
X509CertificateHolder |
toX509CertificateHolder()
Return the X.509 holder for a CBOR re-encoded (type 3) certificate.
|
public C509CertificateHolder(org.bouncycastle.cbor.c509.C509Certificate certificate)
certificate - the certificate this holder wraps.public C509CertificateHolder(byte[] encoding)
throws java.io.IOException
java.io.IOExceptionpublic org.bouncycastle.cbor.c509.C509Certificate getC509Certificate()
public int getCertificateType()
C509Certificate.TYPE_NATIVE or
C509Certificate.TYPE_REENCODED_X509).public java.math.BigInteger getSerialNumber()
public org.bouncycastle.asn1.x500.X500Name getIssuer()
public org.bouncycastle.asn1.x500.X500Name getSubject()
public java.util.Date getNotBefore()
public java.util.Date getNotAfter()
public boolean isValidOn(java.util.Date date)
public org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getSubjectPublicKeyInfo()
public org.bouncycastle.cbor.c509.C509AlgorithmIdentifier getSignatureAlgorithm()
public org.bouncycastle.asn1.x509.Extensions getExtensions()
public boolean isSignatureValid(ContentVerifierProvider verifierProvider) throws CertException
verifierProvider - a provider of verifiers built on the issuer's public
key.CertExceptionpublic byte[] getSignedBytes()
throws java.io.IOException
java.io.IOExceptionpublic X509CertificateHolder toX509CertificateHolder() throws java.io.IOException
java.lang.IllegalStateException - if this is a natively signed certificate.java.io.IOExceptionpublic byte[] getEncoded()
throws java.io.IOException
getEncoded in interface org.bouncycastle.util.Encodablejava.io.IOExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object