Skip to content
Discussion options

You must be logged in to vote

Hi. You have to lock after generating the keys.

Copied from the examples:


func ExamplePGPHandle_LockKey() {
	// Encrypt secret material in a private key with a passphrase.
	privateKey, err := NewKeyFromArmored(examplePrivKey)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer privateKey.ClearPrivateParams()
	pgp := PGP()
	lockedKey, err := pgp.LockKey(privateKey, []byte("password"))
	if err != nil {
		fmt.Println(err)
		return
	}
	locked, _ := lockedKey.IsLocked()
	fmt.Println(locked)
	// Output: true
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tcllib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants