certificate

package
v0.0.0-...-f5bbbf4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(block []byte, typ string) ([][]byte, error)

func GenerateCertificate

func GenerateCertificate(keyPEMBlock []byte, template *x509.Certificate) (*tls.Certificate, error)

func ParsePrivateKey

func ParsePrivateKey(der []byte) (crypto.PrivateKey, error)

ParsePrivateKey attempts to parse the given private key DER block. OpenSSL 0.9.8 generates PKCS#1 private keys by default, while OpenSSL 1.0.0 generates PKCS#8 keys. OpenSSL ecparam generates SEC1 EC private keys for ECDSA. We try all three.

func ParsePublicKey

func ParsePublicKey(priv interface{}) interface{}

func X509

func X509(pair *KeyPair) (tls.Certificate, error)

func X509KeyPair

func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (tls.Certificate, error)

Types

type KeyPair

type KeyPair struct {
	Cert []byte `json:"cert,omitempty" toml:"cert,omitempty" yaml:"cert,omitempty"`
	Key  []byte `json:"key,omitempty" toml:"key,omitempty" yaml:"key,omitempty"`
}

Jump to

Keyboard shortcuts

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