keyManager

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecSuffix = "_sec.pem"
	KeyAlgo   = "keyAlgo"
	KeyPhase  = "keyPhase"

	HexEncoding = "hexEncoding"
)

Variables

This section is empty.

Functions

func DecryptKey

func DecryptKey(keyPath, name, pwd string) (*pem.Block, error)

DecryptKey decryptes the private key stored at keyPath/name with pwd and returns it in pem format.

func GenerateKey

func GenerateKey(keyPath, name, description, algo, pwd string, phase int) error

GenerateKey generates a keypair according to algo and stores them separately at keyPath/name in pem format. The suffix of the filename is either PublicKey or PrivateKey. The private key is encrypted using pwd. Both pem blocks contain the description and the key phase in the header. The private key pem block additionally has a salt and iv value in the header required for decryption. Returns the public key in pem format or an error

func LoadPublicKeys

func LoadPublicKeys(keyPath string) ([]*pem.Block, error)

LoadPublicKeys returns all public keys stored in the directory at keypath in pem format.

func PemToKeyID

func PemToKeyID(block *pem.Block) (keyID keys.PublicKeyID, pkey interface{}, err error)

PemToKeyID decodes a pem encoded private key into a publicKeyID and a privateKey Object

func SelfSignedDelegation

func SelfSignedDelegation(srcPath, dstPath, pwd, zone, context string, validityPeriod time.Duration) error

SelfSignedDelegation creates, self signs, and stores a delgation assertion for the key pair with name at path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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