tlsutils

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotRSAPrivateKey = errors.New("private key is not an RSA key")
)

Functions

func GenerateCACertificate

func GenerateCACertificate(org string, bits int) ([]byte, []byte, error)

GenerateCACertificate generates a new certificate authority from the specified org and bit size and returns the certificate and key as []byte, []byte

func GenerateCert

func GenerateCert(hosts []string, caCert []byte, caKey []byte, org string, bits int) ([]byte, []byte, error)

GenerateCert generates a new certificate signed using the provided certificate authority certificate and key byte arrays. It will return the generated certificate and key as []byte, []byte

func GetPublicKey

func GetPublicKey(priv interface{}) (*rsa.PublicKey, error)

GetPublicKey returns the RSA public key for the specified private key

func GetServerTLSConfig

func GetServerTLSConfig(caCert, serverCert, serverKey []byte, allowInsecure bool) (*tls.Config, error)

GetServerTLSConfig returns a TLS config for using with ListenAndServeTLS This sets up the Root and Client CAs for verification

Types

This section is empty.

Jump to

Keyboard shortcuts

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