keygen

package
v0.0.0-...-947b840 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyPairExists

func KeyPairExists(dir, keyName string) bool

Returns true if key pair with a given name exists in a specified directory.

Types

type Key

type Key interface {
	Write(path string) error
}

type KeyFileError

type KeyFileError struct {
	// contains filtered or unexported fields
}

func NewKeyFileError

func NewKeyFileError(keyType, fileName string, err error) KeyFileError

func (KeyFileError) Error

func (e KeyFileError) Error() string

type KeyPair

type KeyPair interface {
	PublicKey() Key
	PrivateKey() Key
	Write(dir, keyName string) error
}

func NewKeyPair

func NewKeyPair(bitSize int) (KeyPair, error)

NewKeyPair generates new private and public key pair.

func ReadKeyPair

func ReadKeyPair(dir, keyName string) (KeyPair, error)

ReadKeyPair reads public and private keys with a given name from the specified directory.

Jump to

Keyboard shortcuts

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