autograph: go.mozilla.org/autograph/signer/gpg2 Index | Files

package gpg2

import "go.mozilla.org/autograph/signer/gpg2"

Index

Package Files

gpg2.go

Constants

const (
    // Type of this signer is "gpg2" represents a signer that
    // shells out to gpg2 to sign artifacts since the golang "pgp"
    // signer doesn't support signing with subkeys
    // https://godoc.org/golang.org/x/crypto/openpgp#ArmoredDetachSign
    // or loading keys exported with gnu-dummy s2k encrypted
    // passphrases https://github.com/golang/go/issues/13605
    Type = "gpg2"
)

func Unmarshal Uses

func Unmarshal(sigstr string) (signer.Signature, error)

Unmarshal also does very little. It simply converts the armored signature from a string to an []byte, but doesn't attempt to parse it, and returns it as a Signature

type GPG2Signer Uses

type GPG2Signer struct {
    signer.Configuration

    // KeyID is the fingerprint of the gpg key or subkey to use
    // e.g. 0xA2B637F535A86009
    KeyID string
    // contains filtered or unexported fields
}

GPG2Signer holds the configuration of the signer

func New Uses

func New(conf signer.Configuration) (s *GPG2Signer, err error)

New initializes a pgp signer using a configuration

func (*GPG2Signer) AtExit Uses

func (s *GPG2Signer) AtExit() error

AtExit removes the temp dir containing the signer key and sec rings when the app is shut down gracefully

func (*GPG2Signer) Config Uses

func (s *GPG2Signer) Config() signer.Configuration

Config returns the configuration of the current signer

func (*GPG2Signer) GetDefaultOptions Uses

func (s *GPG2Signer) GetDefaultOptions() interface{}

GetDefaultOptions returns default options of the signer

func (*GPG2Signer) SignData Uses

func (s *GPG2Signer) SignData(data []byte, options interface{}) (signer.Signature, error)

SignData takes data and returns an armored signature with pgp header and footer

type Options Uses

type Options struct {
}

Options are not implemented for this signer

type Signature Uses

type Signature struct {
    Data []byte
}

Signature is a PGP signature

func (*Signature) Marshal Uses

func (sig *Signature) Marshal() (string, error)

Marshal doesn't do much for this signer. sig.Data already contains an armored signature, so we simply convert it to a string and return it

Package gpg2 imports 11 packages (graph) and is imported by 2 packages. Updated 2019-09-17. Refresh now. Tools for package owners.