x509

package
v0.0.0-...-a85b10e Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCATemplate

func CreateCATemplate(param TemplateParam) (*x509.Certificate, error)

CreateCATemplate creates certificate template for CA

func CreateCRL

func CreateCRL(caCert *x509.Certificate, param CRLParam) (*pkix.CertificateList, error)

CreateCRL with given parameter

func CreateClientTemplate

func CreateClientTemplate(param TemplateParam, authorityKeyID []byte) (*x509.Certificate, error)

CreateClientTemplate creates certificate template for server

func CreateServerTemplate

func CreateServerTemplate(param TemplateParam, authorityKeyID []byte) (*x509.Certificate, error)

CreateServerTemplate creates certificate template for server

func Sign

func Sign(signer *x509.Certificate, signerPrivate crypto.Signer, signee *x509.Certificate, signeePublic interface{}) (*x509.Certificate, error)

Sign certificate. The returned slice is the certificate in DER encoding

Types

type CRLParam

type CRLParam struct {
	Revoked    []pkix.RevokedCertificate
	PrivateKey crypto.Signer
	ThisUpdate time.Time
	NextUpdate time.Time
}

CRLParam is a struct for create CRL

type TemplateParam

type TemplateParam struct {
	SerialNumber *big.Int
	Subject      pkix.Name
	PublicKey    crypto.PublicKey
	HashFunction crypto.Hash
	NotBefore    time.Time
	NotAfter     time.Time
}

TemplateParam is a struct for create certificate template

Jump to

Keyboard shortcuts

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