X509TbsCertificate

@Serializable
data class X509TbsCertificate(source)

As per RFC5280:

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
}

Version ::= INTEGER { v1(0), v2(1), v3(2) }

CertificateSerialNumber ::= INTEGER

Name ::= CHOICE { -- only one possibility for now --
rdnSequence RDNSequence }

RDNSequence ::= SEQUENCE OF RelativeDistinguishedName

Validity ::= SEQUENCE {
notBefore Time,
notAfter Time }

Time ::= CHOICE {
utcTime UTCTime,
generalTime GeneralizedTime }

UniqueIdentifier ::= BIT STRING

SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING }

Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension

Extension ::= SEQUENCE {
extnID OBJECT IDENTIFIER,
critical BOOLEAN DEFAULT FALSE,
extnValue OCTET STRING
-- contains the DER encoding of an ASN.1 value
-- corresponding to the extension type identified
-- by extnID
}

Constructors

Link copied to clipboard
constructor(version: X509TbsCertificate.Version? = Version.V3, serialNumber: Asn1Integer, signatureAlgorithm: X509AlgorithmIdentifier, issuerName: List<X500RelativeDistinguishedName>, validFrom: Asn1Time, validUntil: Asn1Time, subjectName: List<X500RelativeDistinguishedName>, subjectPublicKeyInfo: SubjectPublicKeyInfo, issuerUniqueID: Asn1BitString? = null, subjectUniqueID: Asn1BitString? = null, extensions: List<X509CertificateExtension>? = null)

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Getter may throw but we cannot annotate due to https://youtrack.jetbrains.com/issue/KT-63047/Throws-annotation-on-getter-leads-to-compile-time-error-for-iOS-target

Link copied to clipboard

Non-throwing variant of X509TbsCertificate.issuerUniqueID that returns null if the bit string is malformed.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The raw value of the certificate version, useful if nullness of encoded version is needed.

Link copied to clipboard
Link copied to clipboard

Getter may throw but we cannot annotate due to https://youtrack.jetbrains.com/issue/KT-63047/Throws-annotation-on-getter-leads-to-compile-time-error-for-iOS-target

Link copied to clipboard

Non-throwing variant of X509TbsCertificate.subjectUniqueID that returns null if the bit string is malformed.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int