123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123module juptune.data.x509.asn1convert;
struct X509Certificate
{
/++ STRUCTS ++/
/// NOTE: This should always be a UTC time.
static struct Time
{
/++ FUNCTIONS ++/
///
bool isAfter(X509Certificate.Time other);
///
bool isBefore(X509Certificate.Time other);
///
void toString(SinkT)(SinkT sink);
/++ VARIABLES ++/
///
ubyte day;
///
ubyte hour;
///
ubyte minute;
///
ubyte month;
///
ubyte second;
///
ushort year;
}
/++ FUNCTIONS ++/
///
X509Certificate opAssign(X509Certificate p);
/++ ENUMS ++/
///
enum NameComponentKind : int
{
///
FAILSAFE = 0,
///
countryName = 1,
///
organizationName = 2,
///
organizationalUnitName = 3,
///
dnQualifier = 4,
///
stateOrProvinceName = 5,
///
commonName = 6,
///
serialNumber = 7,
///
localityName = 8,
///
title = 9,
///
surname = 10,
///
givenName = 11,
///
initials = 12,
///
pseudonym = 13,
///
generationQualifier = 14,
///
domainComponent = 15,
///
unknown = 16
}
///
enum Version : int
{
///
FAILSAFE = 0,
///
v1 = 1,
///
v2 = 2,
///
v3 = 3
}
/++ VARIABLES ++/
///
Nullable!(Extensions) extensions;
///
Name issuer;
///
Nullable!(Asn1BitString) issuerUniqueId;
///
X509Certificate.Time notValidAfter;
///
X509Certificate.Time notValidBefore;
///
Asn1Integer serialNumber;
///
SumType!(X509SignatureAlgorithm.Unknown, X509SignatureAlgorithm.Md2WithRsaEncryption, X509SignatureAlgorithm.Md5WithRsaEncryption, X509SignatureAlgorithm.Sha1WithRsaEncryption, X509SignatureAlgorithm.DsaWithSha1, X509SignatureAlgorithm.EcdsaWithSha1, X509SignatureAlgorithm.DsaWithSha244, X509SignatureAlgorithm.DsaWithSha256, X509SignatureAlgorithm.Sha244WithRsaEncryption, X509SignatureAlgorithm.Sha256WithRsaEncryption, X509SignatureAlgorithm.Sha384WithRsaEncryption, X509SignatureAlgorithm.Sha512WithRsaEncryption, X509SignatureAlgorithm.EcdsaWith244, X509SignatureAlgorithm.EcdsaWith256, X509SignatureAlgorithm.EcdsaWith384, X509SignatureAlgorithm.EcdsaWith512) signatureAlgorithm;
///
Asn1BitString signatureValue;
///
Name subject;
///
Asn1BitString subjectPublicKey;
///
SumType!(X509PublicKeyAlgorithm.Unknown, X509PublicKeyAlgorithm.RsaEncryption, X509PublicKeyAlgorithm.DsaEncryption, X509PublicKeyAlgorithm.DhPublicNumber, X509PublicKeyAlgorithm.KeyExchangeAlgorithm, X509PublicKeyAlgorithm.EcPublicKey, X509PublicKeyAlgorithm.RsaSsaPss, X509PublicKeyAlgorithm.RsaEsOaep) subjectPublicKeyAlgorithm;
///
Nullable!(Asn1BitString) subjectUniqueId;
///
const ubyte[] tbsCertificateRawDerEncoding;
///
X509Certificate.Version version_;
}
Represents an x.509 certificate, with as much of the ASN.1 jank cut out as possible without the need for allocation.
It's advised to read through RFC 5280 to learn what each field is, as there's no point in me copy-pasting the spec into comments.
| Name | Description |
|---|---|
| NameComponentKind | |
| Version |
| Name | Description |
|---|---|
| opAssign |
| Name | Description |
|---|---|
| Time |
NOTE: This should always be a UTC time. |