key

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package key defines cobra commands to manage private and public keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd(pather command.Pather) *cobra.Command

Cmd creates a new cobra command to manage keys

func EncodePEMPrivateKey

func EncodePEMPrivateKey(key crypto.PrivateKey) ([]byte, error)

EncodePEMPrivateKey encodes the private key in PEM format.

func LoadPrivateKey

func LoadPrivateKey(filename string) (crypto.Signer, error)

LoadPrivate key loads a private key from file.

func NewPrivateCmd

func NewPrivateCmd(pather command.Pather) *cobra.Command

NewPrivateCmd returns a cobra command that generates new private keys.

func NewPublicCmd

func NewPublicCmd(pather command.Pather) *cobra.Command

NewPublicCmd returns a cobra command that returns the public key for a given private key.

func NewSymmetricCmd

func NewSymmetricCmd(pather command.Pather) *cobra.Command

NewSymmetricCmd returns a cobra command that generates new symmetric keys.

Types

type PrivateKey

type PrivateKey interface {
	Public() crypto.PublicKey
}

func GeneratePrivateKey

func GeneratePrivateKey(curve string) (PrivateKey, error)

GeneratePrivateKey generates a new private key.

Jump to

Keyboard shortcuts

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