Documentation ¶
Index ¶
- Constants
- func DecryptKey(keyPath, name, pwd string) (*pem.Block, error)
- func GenerateKey(keyPath, name, description, algo, pwd string, phase int) error
- func LoadPublicKeys(keyPath string) ([]*pem.Block, error)
- func PemToKeyID(block *pem.Block) (keyID keys.PublicKeyID, pkey interface{}, err error)
- func SelfSignedDelegation(srcPath, dstPath, pwd, zone, context string, validityPeriod time.Duration) error
Constants ¶
const ( SecSuffix = "_sec.pem" KeyAlgo = "keyAlgo" KeyPhase = "keyPhase" HexEncoding = "hexEncoding" )
Variables ¶
This section is empty.
Functions ¶
func DecryptKey ¶
DecryptKey decryptes the private key stored at keyPath/name with pwd and returns it in pem format.
func GenerateKey ¶
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 ¶
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
Types ¶
This section is empty.