Documentation ¶
Index ¶
- Variables
- func ExtractKey(in interface{}) (interface{}, error)
- func GenerateDefaultKey() (interface{}, error)
- func GenerateDefaultKeyPair() (interface{}, interface{}, error)
- func GenerateKey(kty, crv string, size int) (interface{}, error)
- func GenerateKeyPair(kty, crv string, size int) (interface{}, interface{}, error)
- func PublicKey(priv interface{}) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 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" )
Functions ¶
func ExtractKey ¶ added in v0.8.4
func ExtractKey(in interface{}) (interface{}, error)
ExtractKey returns the given public or private key or extracts the public key if a x509.Certificate or x509.CertificateRequest is given.
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 ¶
GenerateKey generates a key of the given type (kty).
func GenerateKeyPair ¶
GenerateKeyPair creates an asymmetric crypto keypair using input configuration.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.