Implements a X.509v3 certificate TBS block according to the following ASN.1 data structure:
TBSCertificate ::= SEQUENCE { version [0] EXPLICIT Version DEFAULT v1, serialNumber CertificateSerialNumber, signature AlgorithmIdentifier, issuer Name, validity Validity, subject Name, subjectPublicKeyInfo SubjectPublicKeyInfo, issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, -- If present, version must be v2 or v3 subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, -- If present, version must be v2 or v3 extensions [3] EXPLICIT Extensions OPTIONAL -- If present, version must be v3 } UniqueIdentifier ::= BIT STRING Validity ::= SEQUENCE { notBefore Time, notAfter Time } Time ::= CHOICE { utcTime UTCTime, generalTime GeneralizedTime }
If you want to create a certificate, you should create a {@link X509TBSCertificate X509TBSCertificate}, fill it with useful data (certificate serial number, validity period, subject and issuer DN, subject public key) and the signature algorithm!
Note that you have to set the signature algorithm before encoding a X509TBSCertificate or putting it into a X509Certificate!
Certificate version will be set automatically to "V2" if issuerUniqueID or subjectUniqueID is set and to "V3" if any extension is added. Version defaults to "V1".
Example:
... tbd
@author Markus Tak