Documentation ¶
Index ¶
- Variables
- type Conn
- func (conn *Conn) Close() error
- func (conn *Conn) Key(keygrip string) (Key, error)
- func (conn *Conn) Keys() ([]Key, error)
- func (conn *Conn) Raw(f ResponseFunc, format string, a ...interface{}) error
- func (conn *Conn) ReadKey(keygrip string) (crypto.PublicKey, error)
- func (conn *Conn) Version() (string, error)
- type Error
- type Key
- type KeyProtection
- type KeyType
- type ResponseFunc
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownFormat = errors.New("s-expression is in unknown format") ErrNotPublicKey = errors.New("s-expression is not a public key") ErrNotSignature = errors.New("s-expression is not a signature") )
These errors may be returned from the functions related to s-expression encoding and decoding.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a single connection to a GPG agent.
func Dial ¶
Dial connects to the specified unix domain socket and checks if there is a live GPG agent on the other end.
func (*Conn) Raw ¶
func (conn *Conn) Raw(f ResponseFunc, format string, a ...interface{}) error
Raw executes a command and pipes its results to the specified ResponseFunc parameter.
type Key ¶
type Key struct { Keygrip string Type KeyType SerialNo string CardID string Cached bool Protection KeyProtection Fingerprint string TimeToLive string // contains filtered or unexported fields }
Key describes the information gpg-agent exposes about a key.
func (Key) Decrypt ¶
func (key Key) Decrypt(rand io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error)
Decrypt decrypts ciphertext with this key. If opts is nil or of type *PKCS1v15DecryptOptions then PKCS#1 v1.5 decryption is performed. Otherwise opts must have type *OAEPOptions and OAEP decryption is done.
This function is basically a copy of rsa.Decrypt().
func (Key) Sign ¶
func (key Key) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) (signature []byte, err error)
Sign signs msg with this key, possibly using entropy from rand. If opts is a *PSSOptions then the PSS algorithm will be used, otherwise PKCS#1 v1.5 will be used.
This function is basically a copy of rsa.Sign().
type KeyProtection ¶
type KeyProtection int
KeyProtection describes the key project type.
const ( ProtByPassphrase KeyProtection = iota ProtByNothing ProtUnknown )
These constants define the possible KeyProtection values.
type ResponseFunc ¶
ResponseFunc defines the function handler for the Raw function.