pkix

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2017 License: Apache-2.0, ISC Imports: 7 Imported by: 1

Documentation

Overview

Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgorithmIdentifier

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

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

type AttributeTypeAndValue

type AttributeTypeAndValue struct {
	Type  asn1.ObjectIdentifier `json:"type"`
	Value interface{}           `json:"value"`
}

AttributeTypeAndValue mirrors the ASN.1 structure of the same name in http://tools.ietf.org/html/rfc5280#section-4.1.2.4

func (*AttributeTypeAndValue) MarshalJSON

func (a *AttributeTypeAndValue) MarshalJSON() ([]byte, error)

type AttributeTypeAndValueSET

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

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

type AuxOID added in v0.0.2

type AuxOID []int

AuxOID behaves similar to asn1.ObjectIdentifier, except encodes to JSON as a string in dot notation. It is a type synonym for []int, and can be converted to an asn1.ObjectIdentifier by going through []int and back.

func (*AuxOID) AsSlice added in v0.0.2

func (aux *AuxOID) AsSlice() []int

AsSlice returns a slice over the inner-representation

func (*AuxOID) CopyAsSlice added in v0.0.2

func (aux *AuxOID) CopyAsSlice() []int

CopyAsSlice returns a copy of the inter-representation as a slice

func (*AuxOID) Equal added in v0.0.2

func (aux *AuxOID) Equal(other *AuxOID) bool

Equal tests (deep) equality of two AuxOIDs

func (*AuxOID) MarshalJSON added in v0.0.2

func (aux *AuxOID) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*AuxOID) UnmarshalJSON added in v0.0.2

func (aux *AuxOID) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type CertificateList

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

CertificateList represents the ASN.1 structure of the same name. See RFC 5280, section 5.1. Use Certificate.CheckCRLSignature to verify the signature.

func (*CertificateList) HasExpired

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

HasExpired reports whether now is past the expiry time of certList.

type EDIPartyName added in v0.0.2

type EDIPartyName struct {
	NameAssigner string `asn1:"tag:0,optional,explicit" json:"name_assigner,omitempty"`
	PartyName    string `asn1:"tag:1,explicit" json:"party_name"`
}

EDIPartyName represents the ASN.1 structure of the same name. See RFC 5280, section 4.2.1.6.

type Extension

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

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

func (*Extension) MarshalJSON

func (e *Extension) MarshalJSON() ([]byte, error)

type Name

type Name struct {
	Country, Organization, OrganizationalUnit  []string `json:"omitempty"`
	Locality, Province                         []string `json:"omitempty"`
	StreetAddress, PostalCode, DomainComponent []string `json:"omitempty"`
	SerialNumber, CommonName                   string   `json:"omitempty"`

	Names      []AttributeTypeAndValue `json:"omitempty"`
	ExtraNames []AttributeTypeAndValue `json:"omitempty"`
}

Name represents an X.509 distinguished name. This only includes the common elements of a DN. Additional elements in the name are ignored.

func (*Name) FillFromRDNSequence

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

func (*Name) MarshalJSON

func (n *Name) MarshalJSON() ([]byte, error)

func (*Name) String added in v0.0.2

func (n *Name) String() string

func (Name) ToRDNSequence

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

func (*Name) UnmarshalJSON added in v0.0.2

func (n *Name) UnmarshalJSON(b []byte) error

type OIDName added in v0.0.2

type OIDName struct {
	ShortName string `json:"short_name"`
	LongName  string `json:"long_name"`
}

OIDName stores the short and long version of the name of an IANA-assigned OID

type OtherName added in v0.0.2

type OtherName struct {
	Typeid asn1.ObjectIdentifier
	Value  asn1.RawValue `asn1:"explicit"`
}

OtherName represents the ASN.1 structure of the same name. See RFC 5280, section 4.2.1.6.

func (*OtherName) MarshalJSON added in v0.0.2

func (o *OtherName) MarshalJSON() ([]byte, error)

func (*OtherName) UnmarshalJSON added in v0.0.2

func (o *OtherName) UnmarshalJSON(b []byte) (err error)

type RDNSequence

type RDNSequence []RelativeDistinguishedNameSET

type RelativeDistinguishedNameSET

type RelativeDistinguishedNameSET []AttributeTypeAndValue

type RevokedCertificate

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

RevokedCertificate represents the ASN.1 structure of the same name. See 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            `asn1:"optional"`
	RevokedCertificates []RevokedCertificate `asn1:"optional"`
	Extensions          []Extension          `asn1:"tag:0,optional,explicit"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL