123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184module juptune.data.x509.asn1convert;
abstract abstract class X509Extension
{
/++ STRUCTS ++/
/// The Authority Key Identifier extension from (RFC 5280 4.2.1.1).
static struct AuthorityKeyIdentifier
{
/++ VARIABLES ++/
///
Nullable!(GeneralNames) authorityCertIssuer;
///
Nullable!(Asn1Integer) authorityCertSerialNumber;
///
const ubyte[] keyIdentifier;
}
/// The Basic Constraints extension from (RFC 5280 4.2.1.9).
static struct BasicConstraints
{
/++ VARIABLES ++/
///
bool ca;
///
Nullable!(ulong) pathLenConstraint;
}
/// The CRL Distribution Points extension from (RFC 5280 4.2.1.13).
static struct CrlDistributionPoints
{
/++ VARIABLES ++/
///
CRLDistributionPoints points;
}
/// The Extended Key Usage extension from (RFC 5280 4.2.1.12).
static struct ExtendedKeyUsage
{
/++ FUNCTIONS ++/
///
bool clientAuth();
///
bool codeSigning();
///
bool emailProtection();
///
bool ocspSigning();
///
bool serverAuth();
///
bool timeStamping();
/++ ENUMS ++/
///
enum Flag : int
{
///
serverAuth = 1,
///
clientAuth = 2,
///
codeSigning = 4,
///
emailProtection = 8,
///
timeStamping = 16,
///
ocspSigning = 32
}
}
/// The Freshest CRL extension from (RFC 5280 4.2.1.15).
static struct FreshestCrl
{
/++ VARIABLES ++/
///
CRLDistributionPoints points;
}
/// The Inhibit anyPolicy extension from (RFC 5280 4.2.1.14).
static struct InhibitAnyPolicy
{
/++ VARIABLES ++/
///
ulong skipCerts;
}
/// The Issuer Alt Name extension from (RFC 5280 4.2.1.7).
static struct IssuerAltName
{
/++ VARIABLES ++/
///
GeneralNames names;
}
/// The Key Usage extension from (RFC 5280 4.2.1.3).
static struct KeyUsage
{
/++ FUNCTIONS ++/
///
bool cRLSign();
///
bool contentCommitment();
///
bool dataEncipherment();
///
bool decipherOnly();
///
bool digitalSignature();
///
bool encipherOnly();
///
bool keyAgreement();
///
bool keyCertSign();
///
bool keyEncipherment();
}
/// The Name Constraints extension from (RFC 5280 4.2.1.10).
static struct NameConstraints
{
/++ VARIABLES ++/
///
Nullable!(GeneralSubtrees) excludedSubtrees;
///
Nullable!(GeneralSubtrees) permittedSubtrees;
}
/// The Policy Constraints extension from (RFC 5280 4.2.1.11).
static struct PolicyConstraints
{
/++ VARIABLES ++/
///
Nullable!(ulong) inhibitPolicyMapping;
///
Nullable!(ulong) requireExplicitPolicy;
}
/// The Subject Alt Name extension from (RFC 5280 4.2.1.6).
static struct SubjectAltName
{
/++ VARIABLES ++/
///
GeneralNames names;
}
/// The Subject Key Identifier extension from (RFC 5280 4.2.1.2).
static struct SubjectKeyIdentifier
{
/++ VARIABLES ++/
///
const ubyte[] keyIdentifier;
}
/// An unknown extension was encoutered - user code may be able to recognise it though.
static struct Unknown
{
/++ VARIABLES ++/
///
Extension extension;
}
/++ ALIASES ++/
/// The Authority Information Access extension from (RFC 5280 4.2.2.1).
alias AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax;
/// The Certificate Policies extension from (RFC 5280 4.2.1.4).
alias CertificatePolicies = CertificatePolicies;
/// The Policy Mappings extension from (RFC 5280 4.2.1.5).
alias PolicyMappings = PolicyMappings;
/// The Subject Directory Attributes extension from (RFC 5280 4.2.1.8).
alias SubjectDirectoryAttributes = SubjectDirectoryAttributes;
/// The Subject Information Access extension from (RFC 5280 4.2.2.2).
alias SubjectInfoAccessSyntax = SubjectInfoAccessSyntax;
/// A SumType of all recognised extensions.
alias SumT = SumType!(X509Extension.Unknown, X509Extension.AuthorityKeyIdentifier, X509Extension.SubjectKeyIdentifier, X509Extension.KeyUsage, PolicyMappings, X509Extension.SubjectAltName, X509Extension.IssuerAltName, SubjectDirectoryAttributes, X509Extension.BasicConstraints, X509Extension.NameConstraints, X509Extension.PolicyConstraints, X509Extension.ExtendedKeyUsage, X509Extension.CrlDistributionPoints, X509Extension.InhibitAnyPolicy, X509Extension.FreshestCrl, AuthorityInfoAccessSyntax, SubjectInfoAccessSyntax, CertificatePolicies);
}
Namespace class used to store all recognised extensions.
| Name | Description |
|---|---|
| AuthorityInfoAccessSyntax |
The Authority Information Access extension from (RFC 5280 4.2.2.1). |
| CertificatePolicies |
The Certificate Policies extension from (RFC 5280 4.2.1.4). |
| PolicyMappings |
The Policy Mappings extension from (RFC 5280 4.2.1.5). |
| SubjectDirectoryAttributes |
The Subject Directory Attributes extension from (RFC 5280 4.2.1.8). |
| SubjectInfoAccessSyntax |
The Subject Information Access extension from (RFC 5280 4.2.2.2). |
| SumT |
A SumType of all recognised extensions. |
| Name | Description |
|---|---|
| AuthorityKeyIdentifier |
The Authority Key Identifier extension from (RFC 5280 4.2.1.1). |
| BasicConstraints |
The Basic Constraints extension from (RFC 5280 4.2.1.9). |
| CrlDistributionPoints |
The CRL Distribution Points extension from (RFC 5280 4.2.1.13). |
| ExtendedKeyUsage |
The Extended Key Usage extension from (RFC 5280 4.2.1.12). |
| FreshestCrl |
The Freshest CRL extension from (RFC 5280 4.2.1.15). |
| InhibitAnyPolicy |
The Inhibit anyPolicy extension from (RFC 5280 4.2.1.14). |
| IssuerAltName |
The Issuer Alt Name extension from (RFC 5280 4.2.1.7). |
| KeyUsage |
The Key Usage extension from (RFC 5280 4.2.1.3). |
| NameConstraints |
The Name Constraints extension from (RFC 5280 4.2.1.10). |
| PolicyConstraints |
The Policy Constraints extension from (RFC 5280 4.2.1.11). |
| SubjectAltName |
The Subject Alt Name extension from (RFC 5280 4.2.1.6). |
| SubjectKeyIdentifier |
The Subject Key Identifier extension from (RFC 5280 4.2.1.2). |
| Unknown |
An unknown extension was encoutered - user code may be able to recognise it though. |