Documentation
¶
Overview ¶
The PGP package is a helper around Golang's OpenPGP implementation
Index ¶
- func ArmorPubKey(pubkey []byte) (armoredPubKey []byte, err error)
- func ArmoredKeysToKeyring(keys [][]byte) (keyring io.ReadSeeker, keycount int, err error)
- func CachePassphrase(s string)
- func GenerateKeyPair(name, desc, email string) (pubkey, privkey []byte, fp string, err error)
- func GetArmoredKeyFromKeyServer(keyid, keyserver string) (key []byte, err error)
- func GetFingerprintFromSignature(data string, signature string, keyring io.Reader) (fingerprint string, err error)
- func KeyringToArmoredPubKeys(keyring io.ReadCloser) (armoredkeys map[string][]byte, err error)
- func LoadArmoredPubKey(pubkey []byte) (pgpfingerprint string, err error)
- func Sign(data, keyid string, secringFile io.Reader) (sig string, err error)
- func Verify(data string, signature string, keyring io.Reader) (valid bool, entity *openpgp.Entity, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArmorPubKey ¶
func ArmoredKeysToKeyring ¶
func ArmoredKeysToKeyring(keys [][]byte) (keyring io.ReadSeeker, keycount int, err error)
ArmoredKeysToKeyring takes a list of PGP keys in armored form and transforms it into a keyring that can be used in other openpgp's functions
func CachePassphrase ¶
func CachePassphrase(s string)
CachePassphrase() can be used to pre-cache a passphrase and avoid asking for it. This would normally be called from the MIG client API.
func GenerateKeyPair ¶
func KeyringToArmoredPubKeys ¶
func KeyringToArmoredPubKeys(keyring io.ReadCloser) (armoredkeys map[string][]byte, err error)
KeyringToArmoredPubKeys reads all public keys from a keyring and returned their armored format into map of keys indexed by key fingerprint
func LoadArmoredPubKey ¶
LoadArmoredPubKey takes a single public key as a byte slice, validates it, and returns its its fingerprint or an error
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
Package gpgagent interacts with the local GPG Agent.
|
Package gpgagent interacts with the local GPG Agent. |
Package pinentry interfaces with the pinentry(1) command to securely prompt the user for a password using whichever user interface the user is currently using.
|
Package pinentry interfaces with the pinentry(1) command to securely prompt the user for a password using whichever user interface the user is currently using. |
Click to show internal directories.
Click to hide internal directories.