certificate

package
v0.0.0-...-3c86fcf Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCertificate

func CheckCertificate(dnsName string, caBytes, interCaBytes, clientBytes []byte) bool

func CreateCertificateTemplate

func CreateCertificateTemplate(data Certificate) *x509.Certificate

NOTE: If an SSL certificate has a Subject Alternative Name (SAN) field, then SSL clients are supposed to ignore the common name value and seek a match in the SAN list. This is why the Cert always repeats the common name as the first SAN in the certificate.

func Sign

func Sign(cert *x509.Certificate, signer *x509.Certificate, certPubKey, signerPrivateKey interface{}) []byte

func WritePemToFile

func WritePemToFile(b []byte, fileName string)

Types

type Certificate

type Certificate struct {
	Id                 string
	Country            string
	Organization       string
	OrganizationalUnit string
	CommonName         string
	AlternativeNames   []string
	Usage              []string
	CA                 bool
	PrivateKey         interface{}
	SignatureAlg       string
	ValidFrom          time.Time
	ValidTo            time.Time
}

Jump to

Keyboard shortcuts

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