Documentation ¶
Index ¶
- func AddKeyToKeyRingFromReader(keyring *KeyRing, name string, reader io.Reader) error
- func Verify(keyring openpgp.KeyRing, signed string) (string, error)
- type KeyRing
- func (keyring *KeyRing) AddEntities(name string, input openpgp.EntityList)
- func (keyring *KeyRing) Close() error
- func (keyring *KeyRing) DecryptionKeys() []openpgp.Key
- func (keyring *KeyRing) GetSignerByName(name string) (*openpgp.Entity, error)
- func (keyring *KeyRing) KeysById(id uint64) []openpgp.Key
- func (keyring *KeyRing) KeysByIdUsage(id uint64, requiredUsage byte) []openpgp.Key
- func (keyring *KeyRing) Sign(checkName, body string) (string, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKeyToKeyRingFromReader ¶
AddKeyToKeyRingFromReader imports the PGP keys stored in a Reader into the passed KeyRing.
Types ¶
type KeyRing ¶
type KeyRing struct {
// contains filtered or unexported fields
}
KeyRing wraps an OpenPGP EntityList (which implements openpgp.KeyRing), adding support for determining which key is associated with which check. KeyRing implements openpgp.KeyRing, thus can be used in place of it where appropriate.
func NewKeyRing ¶
func NewKeyRing() *KeyRing
NewKeyRing creates a new keyring from the passed EntityList. The keys in the input EntityList are then associated with the
func (*KeyRing) AddEntities ¶
func (keyring *KeyRing) AddEntities(name string, input openpgp.EntityList)
AddEntities adds new keys from the passed EntityList to the keyring for use.
func (*KeyRing) Close ¶
Close closes the open PGP signer. This function does nothing but satisifies the interface.
func (*KeyRing) DecryptionKeys ¶
DecryptionKeys returns all private keys that are valid for decryption.
func (*KeyRing) GetSignerByName ¶
GetSignerByName gets the first available signing key associated with the passed name.
func (*KeyRing) KeysByIdUsage ¶
KeysByIdUsage returns the set of keys with the given id that also meet the key usage given by requiredUsage. The requiredUsage is expressed as the bitwise-OR of packet.KeyFlag* values.