Documentation ¶
Overview ¶
Package key defines cobra commands to manage private and public keys.
Index ¶
- func Cmd(pather command.Pather) *cobra.Command
- func EncodePEMPrivateKey(key crypto.PrivateKey) ([]byte, error)
- func GeneratePrivateKey(curve string) (crypto.Signer, error)
- func IsX509Signer(signer crypto.Signer) bool
- func LoadPrivateKey(kms, name string) (crypto.Signer, error)
- func NewFingerprintCmd(pather command.Pather) *cobra.Command
- func NewPrivateCmd(pather command.Pather) *cobra.Command
- func NewPublicCmd(pather command.Pather) *cobra.Command
- func NewSymmetricCmd(pather command.Pather) *cobra.Command
- type PrivateKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePEMPrivateKey ¶
func EncodePEMPrivateKey(key crypto.PrivateKey) ([]byte, error)
EncodePEMPrivateKey encodes the private key in PEM format.
func GeneratePrivateKey ¶
GeneratePrivateKey generates a new private key.
func IsX509Signer ¶ added in v0.12.0
IsX509Signer returns true if the given signer is supported by Go's crypto/x509 package to sign X509 certificates. This methods returns true for ECDSA, RSA and Ed25519 keys.
func LoadPrivateKey ¶
LoadPrivate key loads a private key from file.
func NewFingerprintCmd ¶ added in v0.9.0
NewFingerprintCmd returns a cobra command that returns the subject key ID of a public key. If a private key is given, the subject key ID is computed for the corresponding public key. For certificated or certificates chains, the subject key ID is computed with respect to the public key of the first certificate in the file.
func NewPrivateCmd ¶
NewPrivateCmd returns a cobra command that generates new private keys.
func NewPublicCmd ¶
NewPublicCmd returns a cobra command that returns the public key for a given private key.