Documentation ¶
Index ¶
- Constants
- Variables
- func NewEntity(name, email, outFile string) (ne *openpgp.Entity, err error)
- func ParanoidDefaultConfig() *packet.Config
- func SetKeyRingDir(dir string)
- type KeyRing
- func (keyRing *KeyRing) Entity(keyID string) (e *openpgp.Entity)
- func (keyRing *KeyRing) Export(keyID string) (armoured string, err error)
- func (keyRing *KeyRing) Import(armoured string) (n int, err error)
- func (keyRing *KeyRing) Private() bool
- func (keyRing *KeyRing) Sign(message []byte, keyID string) (sig []byte, err error)
- func (keyRing *KeyRing) Store() (err error)
- func (keyRing *KeyRing) Unlock(keyID string) (err error)
Constants ¶
View Source
const Version = "0.1.0"
Variables ¶
View Source
var ( DefaultPublicKeyRing = filepath.Join(os.Getenv("HOME"), ".gnupg", "pubring.gpg") DefaultSecretKeyRing = filepath.Join(os.Getenv("HOME"), ".gnupg", "secring.gpg") )
View Source
var ( ErrPubRing = errors.New("openpgp: public keyring") ErrSecRing = errors.New("openpgp: secret keyring") ErrSecStore = errors.New("openpgp: exporting secret keyring isn't supported'") ErrKeyNotFound = errors.New("openpgp: key not found") ErrInvalidPublicKey = errors.New("openpgp: invalid public key") )
View Source
var ( PubRingPath = DefaultPublicKeyRing SecRingPath = DefaultSecretKeyRing )
Paths to the public and secret keyrings.
View Source
var DefaultConfig *packet.Config
Functions ¶
func ParanoidDefaultConfig ¶
SaneDefaultConfig is a more secure default config than the defaults.
func SetKeyRingDir ¶
func SetKeyRingDir(dir string)
Types ¶
type KeyRing ¶
type KeyRing struct { Entities map[string]*openpgp.Entity // contains filtered or unexported fields }
A KeyRing contains a list of entities and the state required to maintain the key ring.
func LoadKeyRing ¶
LoadKeyRing reads the unarmoured keyring stored at the named path.
func (*KeyRing) Export ¶
Export writes out the named public key, or all public keys if keyID is empty. The result is an ASCII-armoured public key.
Click to show internal directories.
Click to hide internal directories.