jsonsign

package
v0.0.0-...-825e40b Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2013 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags

func AddFlags()

func ArmoredPublicKey

func ArmoredPublicKey(entity *openpgp.Entity) (string, error)

func DefaultSecRingPath

func DefaultSecRingPath() string

func EntityFromSecring

func EntityFromSecring(keyId, keyFile string) (*openpgp.Entity, error)

keyFile defaults to $HOME/.gnupg/secring.gpg

func NewEntity

func NewEntity() (*openpgp.Entity, error)

NewEntity returns a new OpenPGP entity.

func VerifyPublicKeyFile

func VerifyPublicKeyFile(file, keyid string) (bool, error)

func WriteKeyRing

func WriteKeyRing(w io.Writer, el openpgp.EntityList) error

Types

type CachingEntityFetcher

type CachingEntityFetcher struct {
	Fetcher EntityFetcher
	// contains filtered or unexported fields
}

func (*CachingEntityFetcher) FetchEntity

func (ce *CachingEntityFetcher) FetchEntity(keyId string) (*openpgp.Entity, error)

type EntityFetcher

type EntityFetcher interface {
	FetchEntity(keyId string) (*openpgp.Entity, error)
}

type FileEntityFetcher

type FileEntityFetcher struct {
	File string
}

func FlagEntityFetcher

func FlagEntityFetcher() *FileEntityFetcher

func (*FileEntityFetcher) FetchEntity

func (fe *FileEntityFetcher) FetchEntity(keyId string) (*openpgp.Entity, error)

type SignRequest

type SignRequest struct {
	UnsignedJSON string
	Fetcher      interface{} // blobref.Fetcher or blobref.StreamingFetcher
	ServerMode   bool        // if true, can't use pinentry or gpg-agent, etc.

	// Optional signature time. If zero, time.Now() is used.
	SignatureTime time.Time

	// Optional function to return an entity (including decrypting
	// the PrivateKey, if necessary)
	EntityFetcher EntityFetcher

	// SecretKeyringPath is only used if EntityFetcher is nil,
	// in which case SecretKeyringPath is used if non-empty.
	// As a final resort, the flag value (defaulting to
	// ~/.gnupg/secring.gpg) is used.
	SecretKeyringPath string
}

func (*SignRequest) Sign

func (sr *SignRequest) Sign() (signedJSON string, err error)

type VerifyRequest

type VerifyRequest struct {
	CamliSigner     *blobref.BlobRef
	CamliSig        string
	PublicKeyPacket *packet.PublicKey

	// set if Verify() returns true:
	PayloadMap  map[string]interface{} // The JSON values from BPJ
	SignerKeyId string                 // e.g. "2931A67C26F5ABDA"

	Err error // last error encountered
	// contains filtered or unexported fields
}

See doc/json-signing/* for background and details on these variable names.

func NewVerificationRequest

func NewVerificationRequest(sjson string, fetcher blobref.StreamingFetcher) (vr *VerifyRequest)

func (*VerifyRequest) FindAndParsePublicKeyBlob

func (vr *VerifyRequest) FindAndParsePublicKeyBlob() bool

func (*VerifyRequest) ParsePayloadMap

func (vr *VerifyRequest) ParsePayloadMap() bool

func (*VerifyRequest) ParseSigMap

func (vr *VerifyRequest) ParseSigMap() bool

func (*VerifyRequest) Verify

func (vr *VerifyRequest) Verify() bool

TODO: turn this into (bool, os.Error) return, probably, or *Details, os.Error.

func (*VerifyRequest) VerifySignature

func (vr *VerifyRequest) VerifySignature() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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