Documentation ¶
Overview ¶
Package hkp implements OpenPGP HTTP Keyserver Protocol (HKP), as defined in https://tools.ietf.org/html/draft-shaw-openpgp-hkp-00
Index ¶
Examples ¶
Constants ¶
View Source
const Base = "/pks"
Base is the base path for the HTTP API.
Variables ¶
View Source
var ( ErrNotFound = errors.New("hkp: not found") ErrForbidden = errors.New("hkp: forbidden") )
Functions ¶
This section is empty.
Types ¶
type Adder ¶
type Adder interface {
Add(el openpgp.EntityList) error
}
type Client ¶
Example ¶
c := hkp.Client{Host: "https://pgp.mit.edu"} req := hkp.LookupRequest{Search: "0x2C6464AF2A8E4C02"} index, err := c.Index(&req) if err != nil { log.Fatal(err) } log.Println(index) keys, err := c.Get(&req) if err != nil { log.Fatal(err) } log.Println(keys)
Output:
func (*Client) Get ¶
func (c *Client) Get(req *LookupRequest) (openpgp.EntityList, error)
type IndexFlags ¶
type IndexFlags int
const ( IndexKeyRevoked IndexFlags = 1 << iota IndexKeyDisabled IndexKeyExpired )
type IndexIdentity ¶
type IndexKey ¶
type IndexKey struct { CreationTime time.Time ExpirationTime time.Time Algo packet.PublicKeyAlgorithm Fingerprint []byte BitLength int Flags IndexFlags Identities []IndexIdentity }
type KeyIDSearch ¶
type KeyIDSearch []byte
func ParseKeyIDSearch ¶
func ParseKeyIDSearch(search string) KeyIDSearch
ParseKeyIDSearch parses a key ID search prefixed with "0x". If the supplied search isn't a key ID, returns nil.
func (KeyIDSearch) Fingerprint ¶
func (search KeyIDSearch) Fingerprint() []byte
Fingerprint extracts a fingerprint from a key ID search. It returns nil if the search doesn't contain a fingerprint.
func (KeyIDSearch) KeyId ¶
func (search KeyIDSearch) KeyId() *uint64
KeyId extracts a 64-bit key ID from a key ID search. It returns nil if the search doesn't contain a 64-bit key ID.
func (KeyIDSearch) KeyIdShort ¶
func (search KeyIDSearch) KeyIdShort() *uint32
KeyIdShort extracts a 32-bit key ID from a key ID search. It returns nil if the search doesn't contain a 32-bit key ID.
type LookupOptions ¶
type LookupOptions struct {
NoModification bool
}
type LookupRequest ¶
type LookupRequest struct { Search string Options LookupOptions Exact bool }
type Lookuper ¶
type Lookuper interface { Get(req *LookupRequest) (openpgp.EntityList, error) Index(req *LookupRequest) ([]IndexKey, error) }
Click to show internal directories.
Click to hide internal directories.