Go 语言

Go 语言教程 Go 语言环境安装 Go 语言结构 Go 语言基础语法 Go 语言数据类型 Go 语言变量 Go 语言常量 Go 语言运算符 Go 语言条件语句 Go 语言 if 语句 Go 语言 if...else 语句 Go 语言 if 语句嵌套 Go 语言 switch 语句 Go 语言 select 语句 Go 语言循环语句 Go 语言 for 循环 Go 语言循环嵌套 Go 语言 break 语句 Go 语言 continue 语句 Go 语言 goto 语句 Go 语言函数 Go 语言函数值传递值 Go 语言函数引用传递值 Go 语言函数作为值 Go 语言函数闭包 Go 语言函数方法 Go 语言变量作用域 Go 语言数组 Go 语言多维数组 Go 语言向函数传递数组 Go 语言指针 Go 语言指针数组 Go 语言指向指针的指针 Go 语言指针作为函数参数 Go 语言结构体 Go 语言切片(Slice) Go 语言范围(Range) Go 语言Map(集合) Go 语言递归函数 Go 语言类型转换 Go 语言接口 Go 错误处理 Go 语言开发工具Go 语言标准库

Go 语言标准库


package pkix

import "crypto/x509/pkix"

pkix包提供了共享的、低层次的结构体,用于ASN.1解析和X.509证书、CRL、OCSP的序列化。

Go语言标准库 >>


  • type Extension
  • type AlgorithmIdentifier
  • type RevokedCertificate
  • type TBSCertificateList
  • type AttributeTypeAndValue
  • type AttributeTypeAndValueSET
  • type CertificateList
  • type RelativeDistinguishedNameSET
  • type RDNSequence
  • type Name
  • type Extension

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

    Extension代表一个同名的ASN.1结构体,参见RFC 5280, section 4.2。

    type AlgorithmIdentifier

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

    AlgorithmIdentifier代表一个同名的ASN.1结构体,参见RFC 5280, section 4.1.1.2。

    type RevokedCertificate

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

    RevokedCertificate代表一个同名的ASN.1结构体,参见RFC 5280, section 5.1。

    type TBSCertificateList

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

    TBSCertificateList代表一个同名的ASN.1结构体,参见RFC 5280, section 5.1。

    type AttributeTypeAndValue

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

    AttributeTypeAndValue代表一个同名的ASN.1结构体,参见http://tools.ietf.org/html/rfc5280#section-4.1.2.4

    type AttributeTypeAndValueSET

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

    AttributeTypeAndValueSET代表AttributeTypeAndValue序列表示的ASN.1序列的集合,参见RFC 2986 (PKCS #10)。

    type CertificateList

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

    CertificateList代表一个同名的ASN.1结构体,参见RFC 5280, section 5.1。用于认证签名。

    func (*CertificateList) HasExpired

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

    HasExpired报告证书列表是否已过期。

    type RelativeDistinguishedNameSET

    type RelativeDistinguishedNameSET []AttributeTypeAndValue

    type RDNSequence

    type RDNSequence []RelativeDistinguishedNameSET

    type Name

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

    Name代表一个X.509识别名。只包含识别名的公共属性,额外的属性被忽略。

    func (*Name) FillFromRDNSequence

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

    func (Name) ToRDNSequence

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