keys

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPEMCipher = x509.PEMCipherAES128
	// DefaultKeyType is the default type of a private key.
	DefaultKeyType = "EC"
	// DefaultKeySize is the default size (in # of bits) of a private key.
	DefaultKeySize = 2048
	// DefaultKeyCurve is the default curve of a private key.
	DefaultKeyCurve = "P-256"
)

DefaultPEMCipher is the default algorithm used when encrypting PEM blocks by the CA.

Functions

func GenerateDefaultKey

func GenerateDefaultKey() (interface{}, error)

GenerateDefaultKey generates a public/private key pair using sane defaults for key type, curve, and size.

func GenerateDefaultKeyPair

func GenerateDefaultKeyPair() (interface{}, interface{}, error)

GenerateDefaultKeyPair generates a public/private key pair using configured default values for key type, curve, and size.

func GenerateKey

func GenerateKey(kty, crv string, size int) (interface{}, error)

GenerateKey generates a key of the given type (kty).

func GenerateKeyPair

func GenerateKeyPair(kty, crv string, size int) (interface{}, interface{}, error)

GenerateKeyPair creates an asymmetric crypto keypair using input configuration.

func PublicKey

func PublicKey(priv interface{}) (interface{}, error)

PublicKey extracts a public key from a private key.

func PublicPEM

func PublicPEM(pub interface{}) (*pem.Block, error)

PublicPEM returns the public key in PEM block format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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