Documentation ¶
Overview ¶
Package hkp implements the OpenPGP HTTP Keyserver Protocol, as described in the Internet-Draft, http://ietfreport.isoc.org/idref/draft-shaw-openpgp-hkp/.
hkp provides a few extensions to the protocol, such as SKS hashquery, server statistics and JSON-formatted search results.
Index ¶
- Variables
- func ErrorInvalidMethod(method string) error
- func ErrorMissingParam(param string) error
- func ErrorUnknownOperation(op string) error
- type Add
- type AllStatesReq
- type DeleteReq
- type HashQuery
- type Lookup
- type OTLVerify
- type Operation
- type Option
- type Request
- type RequestChan
- type Response
- type ResponseChan
- type Router
- func (r *Router) HandleAll()
- func (r *Router) HandleDeleteRequest()
- func (r *Router) HandleGetAllStates()
- func (r *Router) HandleOTLVerify()
- func (r *Router) HandlePksAdd()
- func (r *Router) HandlePksHashQuery()
- func (r *Router) HandlePksLookup()
- func (r *Router) HandleWebUI()
- func (r *Router) Respond(w http.ResponseWriter, req Request)
- type Service
- type Settings
Constants ¶
This section is empty.
Variables ¶
var AddFormTemplate *template.Template
AddFormTemplate is used to render the form to add a key.
var AddResultTemplate *template.Template
AddResultTemplate displays the fingerprints of updated keys.
var BaseTemplateSrcs = []string{
headTmplSrc, headerTmplSrc, footerTmplSrc,
layoutTmplSrc}
baseTmplSrcs contains common templates that need to be defined for all PRL PKS HKP templates.
var DeleteFormTemplate *template.Template
PRC START DeleteFormTemplate is used to render the form to delete a key.
var DeleteResultTemplate *template.Template
AddResultTemplate displays the fingerprints of updated keys.
var PksIndexTemplate *template.Template
PksIndexTemplate is used to render the op=index and op=vindex responses when not in machine readable mode.
var SearchFormTemplate *template.Template
SearchFormTemplate is used to render the default search form at '/'
var StatsTemplate *template.Template
StatsTemplate renders the op=stats page
Functions ¶
func ErrorInvalidMethod ¶
ErrorMissingParam constructs an informative error when an invalid HTTP method was requested for the given HKP endpoint.
func ErrorMissingParam ¶
ErrorMissingParam constructs an informative error when a required parameter was missing from a request.
func ErrorUnknownOperation ¶
ErrorMissingParam constructs an informative error when an unknown operation was requested.
Types ¶
type Add ¶
type Add struct { *http.Request Keytext string Option Option ShaOfTarget string // contains filtered or unexported fields }
An HKP "add" request.
func (*Add) Response ¶
func (a *Add) Response() ResponseChan
Get the response channel for sending a response to an add request.
type AllStatesReq ¶
PRC Start New GetState Request
func NewAllStatesReq ¶
func NewAllStatesReq() *AllStatesReq
func (*AllStatesReq) Parse ¶
func (allStatesReq *AllStatesReq) Parse() (err error)
func (*AllStatesReq) Response ¶
func (allStatesReq *AllStatesReq) Response() ResponseChan
Get the response channel for sending a response to AllStatus Request
func (*AllStatesReq) SetResponse ¶
func (allStatesReq *AllStatesReq) SetResponse(respChan ResponseChan)
type DeleteReq ¶
type DeleteReq struct { *http.Request EmailToDelete string KeyID string // contains filtered or unexported fields }
PRC START
func NewDeleteReq ¶
func NewDeleteReq() *DeleteReq
func (*DeleteReq) Response ¶
func (delReq *DeleteReq) Response() ResponseChan
Get the response channel for sending a response to an OTL verify request.
func (*DeleteReq) SetResponse ¶
func (delReq *DeleteReq) SetResponse(respChan ResponseChan)
type HashQuery ¶
func NewHashQuery ¶
func NewHashQuery() *HashQuery
func (*HashQuery) Response ¶
func (hq *HashQuery) Response() ResponseChan
type Lookup ¶
type Lookup struct { *http.Request Op Operation Search string Option Option Fingerprint bool Exact bool Hash bool // contains filtered or unexported fields }
An HKP "lookup" request.
func (*Lookup) MachineReadable ¶
func (*Lookup) Response ¶
func (l *Lookup) Response() ResponseChan
Get the response channel that a worker processing a lookup request will use to send the response back to the web server.
type OTLVerify ¶
PRC START
func NewOTLVerify ¶
func NewOTLVerify() *OTLVerify
func (*OTLVerify) Response ¶
func (otlv *OTLVerify) Response() ResponseChan
Get the response channel for sending a response to an OTL verify request.
type Operation ¶
type Operation int
Operation enumerates the supported HKP operations (op parameter) in the request.
type Request ¶
type Request interface { // Response returns a channel through which to send the response. Response() ResponseChan // Parse interprets the URL and POST parameters according to the HKP draft specification. Parse() error }
Request defines an interface for all HKP web requests.
type Response ¶
type Response interface { Error() error WriteTo(http.ResponseWriter) error }
Worker responses.
type ResponseChan ¶
type ResponseChan chan Response
Response channel to which the workers send their results.
type Router ¶
func (*Router) HandlePksAdd ¶
func (r *Router) HandlePksAdd()
func (*Router) HandlePksHashQuery ¶
func (r *Router) HandlePksHashQuery()
func (*Router) HandlePksLookup ¶
func (r *Router) HandlePksLookup()
func (*Router) HandleWebUI ¶
func (r *Router) HandleWebUI()
type Service ¶
type Service struct {
Requests RequestChan
}
func NewService ¶
func NewService() *Service