Package pkix

import "crypto/x509/pkix"
Overview
Index

Overview ▾

软件包pkix包含用于X.509证书,CRL和OCSP的ASN.1解析和序列化的共享低级结构.

type AlgorithmIdentifier

AlgorithmIdentifier表示同名的ASN.1结构. 请参阅RFC 5280,第4.1.1.2节.

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

type AttributeTypeAndValue

AttributeTypeAndValue镜像RFC 5280第4.1.2.4节中同名的ASN.1结构.

type AttributeTypeAndValue struct {
    Type  asn1.ObjectIdentifier
    Value interface{}
}

type AttributeTypeAndValueSET 1.3

AttributeTypeAndValueSET表示一组来自RFC 2986(PKCS#10)的ASN.1序列AttributeTypeAndValue序列.

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

type CertificateList

CertificateList表示同名的ASN.1结构. 请参阅RFC 5280第5.1节. 使用Certificate.CheckCRLSignature验证签名.

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

func (*CertificateList) HasExpired

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

HasExpired报告certList是否应该立即更新.

type Extension

扩展名代表同名的ASN.1结构. 请参阅RFC 5280第4.2节.

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

type Name

名称表示X.509专有名称. 这仅包括DN的常见元素. 解析时,所有元素都存储在Names中,并且可以从那里提取非标准元素. 封送处理时,会附加ExtraNames中的元素,并使用相同的OID覆盖其他值.

type Name struct {
    Country, Organization, OrganizationalUnit []string
    Locality, Province                        []string
    StreetAddress, PostalCode                 []string
    SerialNumber, CommonName                  string

    Names      []AttributeTypeAndValue
    ExtraNames []AttributeTypeAndValue // Go 1.5
}

func (*Name) FillFromRDNSequence

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

func (Name) String 1.10

func (n Name) String() string

字符串返回n的字符串形式,大致遵循RFC 2253专有名称语法.

func (Name) ToRDNSequence

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

type RDNSequence

type RDNSequence []RelativeDistinguishedNameSET

func (RDNSequence) String 1.10

func (r RDNSequence) String() string

字符串返回序列r的字符串表示形式,大致遵循RFC 2253专有名称语法.

type RelativeDistinguishedNameSET

type RelativeDistinguishedNameSET []AttributeTypeAndValue

type RevokedCertificate

RevokedCertificate代表同名的ASN.1结构. 请参阅RFC 5280第5.1节.

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

type TBSCertificateList

TBSCertificateList表示同名的ASN.1结构. 请参阅RFC 5280第5.1节.

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"`
}

by  ICOPY.SITE