x509

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	Subject            Subject
	Issuer             Issuer
	NotBefore          string    `js:"notBefore"`
	NotAfter           string    `js:"notAfter"`
	AltNames           []string  `js:"altNames"`
	SignatureAlgorithm string    `js:"signatureAlgorithm"`
	FingerPrint        []byte    `js:"fingerPrint"`
	PublicKey          PublicKey `js:"publicKey"`
}

Certificate is an X.509 certificate

type Issuer

type Issuer struct {
	CommonName          string `js:"commonName"`
	Country             string
	StateOrProvinceName string `js:"stateOrProvinceName"`
	LocalityName        string `js:"localityName"`
	OrganizationName    string `js:"organizationName"`
	Names               []RDN
}

Issuer is a certificate issuer

type PublicKey

type PublicKey struct {
	Algorithm string
	Key       interface{}
}

PublicKey is used for decryption and signature verification

type RDN

type RDN struct {
	Type  string
	Value string
}

RDN is a component of an X.509 distinguished name

type Subject

type Subject struct {
	CommonName             string `js:"commonName"`
	Country                string
	PostalCode             string   `js:"postalCode"`
	StateOrProvinceName    string   `js:"stateOrProvinceName"`
	LocalityName           string   `js:"localityName"`
	StreetAddress          string   `js:"streetAddress"`
	OrganizationName       string   `js:"organizationName"`
	OrganizationalUnitName []string `js:"organizationalUnitName"`
	Names                  []RDN
}

Subject is a certificate subject

type X509

type X509 struct{}

X509 certificate functionality

func New

func New() *X509

New constructs the X509 interface

func (X509) GetAltNames

func (X509) GetAltNames(ctx context.Context, encoded []byte) []string

GetAltNames extracts alt names

func (X509) GetIssuer

func (X509) GetIssuer(ctx context.Context, encoded []byte) Issuer

GetIssuer extracts certificate issuer

func (X509) GetSubject

func (X509) GetSubject(ctx context.Context, encoded []byte) Subject

GetSubject extracts certificate subject

func (X509) Parse

func (X509) Parse(ctx context.Context, encoded []byte) Certificate

Parse produces an entire X.509 certificate

Jump to

Keyboard shortcuts

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