X509Cert

data class X509Cert(val encoded: ByteString) : X509Signed

A data type for a X.509 certificate.

Parameters

encoded

the bytes of the X.509 certificate in DER encoding.

Constructors

Link copied to clipboard
constructor(encoded: ByteString)

Types

Link copied to clipboard
class Builder(publicKey: PublicKey, signingKey: AsymmetricKey, serialNumber: ASN1Integer, subject: X500Name, issuer: X500Name, validFrom: Instant, validUntil: Instant) : X509SignedBuilder<X509Cert.Builder>

Builder for X.509 certificate.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The authority key identifier (OID 2.5.29.35), or null if not present in the certificate.

Link copied to clipboard

Certificate basic constraints (if defined).

Link copied to clipboard

The OIDs for X.509 extensions which are marked as critical.

Link copied to clipboard

The public key in the certificate, as an Elliptic Curve key.

Link copied to clipboard
open override val encoded: ByteString
Link copied to clipboard
val encodedIssuer: ByteString

The DER-encoded X.500 Name of the issuer of the certificate.

Link copied to clipboard
val encodedSubject: ByteString

The DER-encoded X.500 Name of the subject of the certificate.

Link copied to clipboard

The extended key usage OIDs (OID 2.5.29.37) or the empty set if not present.

Link copied to clipboard

The list of decoded extensions information.

Link copied to clipboard
protected open override val extensionTag: Int
Link copied to clipboard

The issuer of the certificate.

Link copied to clipboard
val X509Cert.javaX509Certificate: ERROR CLASS: Symbol not found for X509Certificate

The Java X509 certificate from the encoded certificate data.

Link copied to clipboard

The key usage (OID 2.5.29.15) or the empty set if not present.

Link copied to clipboard
protected open override val name: String
Link copied to clipboard

The OIDs for X.509 extensions which are not marked as critical.

Link copied to clipboard
protected val parsed: ASN1Sequence
Link copied to clipboard

The public key in the certificate.

Link copied to clipboard

The certificate serial number.

Link copied to clipboard

The certificate or CRL signature.

Link copied to clipboard

The signature algorithm for the certificate or CRL as Algorithm.

Link copied to clipboard

The signature algorithm for the CRL as OID string.

Link copied to clipboard

The subject of the certificate.

Link copied to clipboard

The dNSName entries of the subject alternative name (OID 2.5.29.17), or the empty list if the extension is not present.

Link copied to clipboard

The subject key identifier (OID 2.5.29.14), or null if not present in the certificate.

Link copied to clipboard
protected val tbs: ASN1Sequence
Link copied to clipboard

The bytes of TBS sequence.

Link copied to clipboard

The point in time where the certificate is valid until.

Link copied to clipboard

The point in time where the certificate is valid from.

Link copied to clipboard

The certificate version.

Functions

Link copied to clipboard
Link copied to clipboard

Gets the bytes of a X.509 extension.

Link copied to clipboard
suspend fun toCoseX5t(): DataItem

Encodes the SHA-256 certificate hash as a CBOR COSE_CertHash structure for use in the COSE x5t header parameter (label 34) according to RFC 9360 Section 2 and ISO/IEC 18013-5 Second Edition Clauses 12.3.4 and 12.5.4.

Link copied to clipboard
Link copied to clipboard
fun toPem(): String

Encode this certificate or CRL in PEM format

Link copied to clipboard
suspend fun verify(publicKey: EcPublicKey)
suspend fun verify(publicKey: PublicKey)

Checks if the certificate or CRL was signed with a given key.

Link copied to clipboard
suspend fun verifyCoseX5t(x5tDataItem: DataItem)

Verifies a CBOR COSE_CertHash structure from the COSE x5t header parameter (label 34) against this certificate according to RFC 9360 Section 2 and ISO/IEC 18013-5 Second Edition Clauses 12.3.4 and 12.5.4 (which mandate SHA-256).