Help us shape the future of Go! Take the 2026 Go Developer Survey

pki

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonNameForCertificate

func CommonNameForCertificate(crt *v1alpha1.Certificate) string

func DNSNamesForCertificate

func DNSNamesForCertificate(crt *v1alpha1.Certificate) []string

func DecodeDERCertificateBytes added in v0.1.0

func DecodeDERCertificateBytes(derBytes []byte) (*x509.Certificate, error)

func DecodePKCS1PrivateKeyBytes

func DecodePKCS1PrivateKeyBytes(keyBytes []byte) (*rsa.PrivateKey, error)

func DecodeX509CertificateBytes

func DecodeX509CertificateBytes(certBytes []byte) (*x509.Certificate, error)

func EncodeCSR

func EncodeCSR(template *x509.CertificateRequest, key interface{}) ([]byte, error)

func EncodePKCS1PrivateKey

func EncodePKCS1PrivateKey(pk *rsa.PrivateKey) []byte

func GenerateRSAPrivateKey

func GenerateRSAPrivateKey(keySize int) (*rsa.PrivateKey, error)

func GenerateTemplate

func GenerateTemplate(issuer v1alpha1.GenericIssuer, crt *v1alpha1.Certificate, serialNo *big.Int) (*x509.Certificate, error)

GenerateTemplate will create a x509.Certificate for the given Certificate resource. This should create a Certificate template that is equivalent to the CertificateRequest generated by GenerateCSR. The PublicKey field must be populated by the caller.

func SignCertificate

func SignCertificate(template *x509.Certificate, issuerCert *x509.Certificate, publicKey interface{}, signerKey interface{}) ([]byte, *x509.Certificate, error)

SignCertificate returns a signed x509.Certificate object for the given *v1alpha1.Certificate crt. publicKey is the public key of the signee, and signerKey is the private key of the signer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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