pkix

Imports

Imports #

"encoding/asn1"
"encoding/hex"
"fmt"
"math/big"
"time"

Constants & Variables

attributeTypeNames var #

var attributeTypeNames = map[string]string{...}

oidCommonName var #

var oidCommonName = []int{...}

oidCountry var #

var oidCountry = []int{...}

oidLocality var #

var oidLocality = []int{...}

oidOrganization var #

var oidOrganization = []int{...}

oidOrganizationalUnit var #

var oidOrganizationalUnit = []int{...}

oidPostalCode var #

var oidPostalCode = []int{...}

oidProvince var #

var oidProvince = []int{...}

oidSerialNumber var #

var oidSerialNumber = []int{...}

oidStreetAddress var #

var oidStreetAddress = []int{...}

Type Aliases

RDNSequence type #

type RDNSequence []RelativeDistinguishedNameSET

RelativeDistinguishedNameSET type #

type RelativeDistinguishedNameSET []AttributeTypeAndValue

Structs

AlgorithmIdentifier struct #

AlgorithmIdentifier represents the ASN.1 structure of the same name. See RFC 5280, section 4.1.1.2.

type AlgorithmIdentifier struct {
Algorithm asn1.ObjectIdentifier
Parameters asn1.RawValue `asn1:"optional"`
}

AttributeTypeAndValue struct #

AttributeTypeAndValue mirrors the ASN.1 structure of the same name in RFC 5280, Section 4.1.2.4.

type AttributeTypeAndValue struct {
Type asn1.ObjectIdentifier
Value any
}

AttributeTypeAndValueSET struct #

AttributeTypeAndValueSET represents a set of ASN.1 sequences of [AttributeTypeAndValue] sequences from RFC 2986 (PKCS #10).

type AttributeTypeAndValueSET struct {
Type asn1.ObjectIdentifier
Value [][]AttributeTypeAndValue `asn1:"set"`
}

CertificateList struct #

CertificateList represents the ASN.1 structure of the same name. See RFC 5280, section 5.1. Use Certificate.CheckCRLSignature to verify the signature. Deprecated: x509.RevocationList should be used instead.

type CertificateList struct {
TBSCertList TBSCertificateList
SignatureAlgorithm AlgorithmIdentifier
SignatureValue asn1.BitString
}

Extension struct #

Extension represents the ASN.1 structure of the same name. See RFC 5280, section 4.2.

type Extension struct {
Id asn1.ObjectIdentifier
Critical bool `asn1:"optional"`
Value []byte
}

Name struct #

Name represents an X.509 distinguished name. This only includes the common elements of a DN. Note that Name is only an approximation of the X.509 structure. If an accurate representation is needed, asn1.Unmarshal the raw subject or issuer as an [RDNSequence].

type Name struct {
Country []string
Organization []string
OrganizationalUnit []string
Locality []string
Province []string
StreetAddress []string
PostalCode []string
SerialNumber string
CommonName string
Names []AttributeTypeAndValue
ExtraNames []AttributeTypeAndValue
}

RevokedCertificate struct #

RevokedCertificate represents the ASN.1 structure of the same name. See RFC 5280, section 5.1.

type RevokedCertificate struct {
SerialNumber *big.Int
RevocationTime time.Time
Extensions []Extension `asn1:"optional"`
}

TBSCertificateList struct #

TBSCertificateList represents the ASN.1 structure of the same name. See RFC 5280, section 5.1. Deprecated: x509.RevocationList should be used instead.

type TBSCertificateList struct {
Raw asn1.RawContent
Version int `asn1:"optional,default:0"`
Signature AlgorithmIdentifier
Issuer RDNSequence
ThisUpdate time.Time
NextUpdate time.Time `asn1:"optional"`
RevokedCertificates []RevokedCertificate `asn1:"optional"`
Extensions []Extension `asn1:"tag:0,optional,explicit"`
}

Functions

FillFromRDNSequence method #

FillFromRDNSequence populates n from the provided [RDNSequence]. Multi-entry RDNs are flattened, all entries are added to the relevant n fields, and the grouping is not preserved.

func (n *Name) FillFromRDNSequence(rdns *RDNSequence)

HasExpired method #

HasExpired reports whether certList should have been updated by now.

func (certList *CertificateList) HasExpired(now time.Time) bool

String method #

String returns a string representation of the sequence r, roughly following the RFC 2253 Distinguished Names syntax.

func (r RDNSequence) String() string

String method #

String returns the string form of n, roughly following the RFC 2253 Distinguished Names syntax.

func (n Name) String() string

ToRDNSequence method #

ToRDNSequence converts n into a single [RDNSequence]. The following attributes are encoded as multi-value RDNs: - Country - Organization - OrganizationalUnit - Locality - Province - StreetAddress - PostalCode Each ExtraNames entry is encoded as an individual RDN.

func (n Name) ToRDNSequence() (ret RDNSequence)

appendRDNs method #

appendRDNs appends a relativeDistinguishedNameSET to the given RDNSequence and returns the new value. The relativeDistinguishedNameSET contains an attributeTypeAndValue for each of the given values. See RFC 5280, A.1, and search for AttributeTypeAndValue.

func (n Name) appendRDNs(in RDNSequence, values []string, oid asn1.ObjectIdentifier) RDNSequence

oidInAttributeTypeAndValue function #

oidInAttributeTypeAndValue reports whether a type with the given OID exists in atv.

func oidInAttributeTypeAndValue(oid asn1.ObjectIdentifier, atv []AttributeTypeAndValue) bool

Generated with Arrow