# package pkix
`import "crypto/x509/pkix"`
pkix包提供了共享的、低层次的结构体,用于ASN.1解析和X.509证书、CRL、OCSP的序列化。
## Index
* [type Extension](#Extension)
* [type AlgorithmIdentifier](#AlgorithmIdentifier)
* [type RevokedCertificate](#RevokedCertificate)
* [type TBSCertificateList](#TBSCertificateList)
* [type AttributeTypeAndValue](#AttributeTypeAndValue)
* [type AttributeTypeAndValueSET](#AttributeTypeAndValueSET)
* [type CertificateList](#CertificateList)
* [func (certList \*CertificateList) HasExpired(now time.Time) bool](#CertificateList.HasExpired)
* [type RelativeDistinguishedNameSET](#RelativeDistinguishedNameSET)
* [type RDNSequence](#RDNSequence)
* [type Name](#Name)
* [func (n \*Name) FillFromRDNSequence(rdns \*RDNSequence)](#Name.FillFromRDNSequence)
* [func (n Name) ToRDNSequence() (ret RDNSequence)](#Name.ToRDNSequence)
## type [Extension](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#42 "View Source")
```
type Extension struct {
Id asn1.ObjectIdentifier
Critical bool `asn1:"optional"`
Value []byte
}
```
Extension代表一个同名的ASN.1结构体,参见[RFC 5280](http://tools.ietf.org/html/rfc5280), section 4.2。
## type [AlgorithmIdentifier](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#17 "View Source")
```
type AlgorithmIdentifier struct {
Algorithm asn1.ObjectIdentifier
Parameters asn1.RawValue `asn1:"optional"`
}
```
AlgorithmIdentifier代表一个同名的ASN.1结构体,参见[RFC 5280](http://tools.ietf.org/html/rfc5280), section 4.1.1.2。
## type [RevokedCertificate](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#174 "View Source")
```
type RevokedCertificate struct {
SerialNumber *big.Int
RevocationTime time.Time
Extensions []Extension `asn1:"optional"`
}
```
RevokedCertificate代表一个同名的ASN.1结构体,参见[RFC 5280](http://tools.ietf.org/html/rfc5280), section 5.1。
## type [TBSCertificateList](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#161 "View Source")
```
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](http://tools.ietf.org/html/rfc5280), section 5.1。
## type [AttributeTypeAndValue](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#28 "View Source")
```
type AttributeTypeAndValue struct {
Type asn1.ObjectIdentifier
Value interface{}
}
```
AttributeTypeAndValue代表一个同名的ASN.1结构体,参见[http://tools.ietf.org/html/rfc5280#section-4.1.2.4](http://tools.ietf.org/html/rfc5280#section-4.1.2.4)。
## type [AttributeTypeAndValueSET](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#35 "View Source")
```
type AttributeTypeAndValueSET struct {
Type asn1.ObjectIdentifier
Value [][]AttributeTypeAndValue `asn1:"set"`
}
```
AttributeTypeAndValueSET代表AttributeTypeAndValue序列表示的ASN.1序列的集合,参见[RFC 2986](http://tools.ietf.org/html/rfc2986) (PKCS #10)。
## type [CertificateList](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#148 "View Source")
```
type CertificateList struct {
TBSCertList TBSCertificateList
SignatureAlgorithm AlgorithmIdentifier
SignatureValue asn1.BitString
}
```
CertificateList代表一个同名的ASN.1结构体,参见[RFC 5280](http://tools.ietf.org/html/rfc5280), section 5.1。用于认证签名。
### func (\*CertificateList) [HasExpired](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#155 "View Source")
```
func (certList *CertificateList) HasExpired(now time.Time) bool
```
HasExpired报告证书列表是否已过期。
## type [RelativeDistinguishedNameSET](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#24 "View Source")
```
type RelativeDistinguishedNameSET []AttributeTypeAndValue
```
## type [RDNSequence](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#22 "View Source")
```
type RDNSequence []RelativeDistinguishedNameSET
```
## type [Name](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#50 "View Source")
```
type Name struct {
Country, Organization, OrganizationalUnit []string
Locality, Province []string
StreetAddress, PostalCode []string
SerialNumber, CommonName string
Names []AttributeTypeAndValue
}
```
Name代表一个X.509识别名。只包含识别名的公共属性,额外的属性被忽略。
### func (\*Name) [FillFromRDNSequence](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#59 "View Source")
```
func (n *Name) FillFromRDNSequence(rdns *RDNSequence)
```
### func (Name) [ToRDNSequence](http://code.google.com/p/go/source/browse/src/pkg/crypto/x509/pkix/pkix.go?name=release#127 "View Source")
```
func (n Name) ToRDNSequence() (ret RDNSequence)
```
- 库
- package achive
- package tar
- package zip
- package bufio
- package builtin
- package bytes
- package compress
- package bzip2
- package flate
- package gzip
- package lzw
- package zlib
- package container
- package heap
- package list
- package ring
- package crypto
- package aes
- package cipher
- package des
- package dsa
- package ecdsa
- package elliptic
- package hmac
- package md5
- package rand
- package rc4
- package rsa
- package sha1
- package sha256
- package sha512
- package subtle
- package tls
- package x509
- package pkix
- package database
- package sql
- package driver
- package encoding
- package ascii85
- package asn1
- package base32
- package base64
- package binary
- package csv
- package gob
- package hex
- package json
- package pem
- package xml
- package errors
- package expvar
- package flag
- package fmt
- package go
- package doc
- package format
- package parser
- package printer
- package hash
- package adler32
- package crc32
- package crc64
- package fnv
- package html
- package template
- package image
- package color
- package palette
- package draw
- package gif
- package jpeg
- package png
- package index
- package suffixarray
- package io
- package ioutil
- package log
- package syslog
- package math
- package big
- package cmplx
- package rand
- package mime
- package multipart
- package net
- package http
- package cgi
- package cookiejar
- package fcgi
- package httptest
- package httputil
- package pprof
- package mail
- package rpc
- package jsonrpc
- package smtp
- package textproto
- package url
- package os
- package exec
- package signal
- package user
- package path
- package filepath
- package reflect
- package regexp
- package runtime
- package cgo
- package debug
- package pprof
- package race
- package sort
- package strconv
- package strings
- package sync
- package atomic
- package text
- package scanner
- package tabwriter
- package template
- package time
- package unicode
- package utf16
- package utf8
- package unsafe