Version: v1.0.0-...-9f5453b Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2018 License: AGPL-3.0 Imports: 7 Imported by: 1



Package jsonhkp defines an arbitrary, Hockeypuck-specific, JSON-friendly document model for representation of OpenPGP key material. Intended to be used by front-end Javascript as well as server-side HTML template developers.



This section is empty.


This section is empty.


This section is empty.


type Packet

type Packet struct {
	Tag    uint8  `json:"tag"`
	Data   []byte `json:"data"`
	Parsed bool   `json:"parsed"`

func NewPacket

func NewPacket(from *openpgp.Packet) *Packet

type Photo

type Photo struct {
	MIMEType string `json:"mimeType"`
	Contents []byte `json:"contents"`

func NewPhoto

func NewPhoto(image []byte) *Photo

func (*Photo) DataURI

func (p *Photo) DataURI() (*url.URL, error)

type PrimaryKey

type PrimaryKey struct {

	MD5       string           `json:"md5"`
	SHA256    string           `json:"sha256,omitempty"`
	SubKeys   []*SubKey        `json:"subKeys,omitempty"`
	UserIDs   []*UserID        `json:"userIDs,omitempty"`
	UserAttrs []*UserAttribute `json:"userAttrs,omitempty"`

func NewPrimaryKey

func NewPrimaryKey(from *openpgp.PrimaryKey) *PrimaryKey

func NewPrimaryKeys

func NewPrimaryKeys(froms []*openpgp.PrimaryKey) []*PrimaryKey

func (*PrimaryKey) Bytes

func (pk *PrimaryKey) Bytes() []byte

func (*PrimaryKey) Serialize

func (pk *PrimaryKey) Serialize(w io.Writer) error

type PublicKey

type PublicKey struct {
	Fingerprint  string       `json:"fingerprint"`
	LongKeyID    string       `json:"longKeyID"`
	ShortKeyID   string       `json:"shortKeyID"`
	Creation     string       `json:"creation,omitempty"`
	Expiration   string       `json:"expiration,omitempty"`
	NeverExpires bool         `json:"neverExpires,omitempty"`
	Algorithm    algorithm    `json:"algorithm"`
	BitLength    int          `json:"bitLength"`
	Signatures   []*Signature `json:"signatures,omitempty"`
	Unsupported  []*Packet    `json:"unsupported,omitempty"`
	Packet       *Packet      `json:"packet,omitempty"`

type Signature

type Signature struct {
	SigType      int     `json:"sigType"`
	Revocation   bool    `json:"revocation,omitempty"`
	Primary      bool    `json:"primary,omitempty"`
	IssuerKeyID  string  `json:"issuerKeyID,omitempty"`
	Creation     string  `json:"creation,omitempty"`
	Expiration   string  `json:"expiration,omitempty"`
	NeverExpires bool    `json:"neverExpires,omitempty"`
	Packet       *Packet `json:"packet,omitempty"`

func NewSignature

func NewSignature(from *openpgp.Signature) *Signature

type SubKey

type SubKey struct {

func NewSubKey

func NewSubKey(from *openpgp.SubKey) *SubKey

type UserAttribute

type UserAttribute struct {
	Photos      []*Photo     `json:"photos,omitempty"`
	Packet      *Packet      `json:"packet,omitempty"`
	Signatures  []*Signature `json:"signatures,omitempty"`
	Unsupported []*Packet    `json:"unsupported,omitempty"`

func NewUserAttribute

func NewUserAttribute(from *openpgp.UserAttribute) *UserAttribute

type UserID

type UserID struct {
	Keywords    string       `json:"keywords"`
	Packet      *Packet      `json:"packet,omitempty"`
	Signatures  []*Signature `json:"signatures,omitempty"`
	Unsupported []*Packet    `json:"unsupported,omitempty"`

func NewUserID

func NewUserID(from *openpgp.UserID) *UserID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL