gpg

package
v0.0.0-...-be47510 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gpg provides an interface and an abstraction with which to sign and verify review requests and comments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(key string, s Signable) error

Sign uses gpg to sign the contents of a request and deposit it into the signature key of the request.

func Verify

func Verify(s Signable) error

Verify verifies the signatures on the request and its comments with the given key.

Types

type Sig

type Sig struct {
	// Sig holds an object's content's signature.
	Sig string `json:"signature,omitempty"`
}

Sig provides an abstraction around shelling out to GPG to sign the content it's given.

func (*Sig) Signature

func (s *Sig) Signature() *string

Signature is `Sig`'s implementation of `Signable`. Through this function, an object which needs to implement `Signable` need only embed `Sig` anonymously. See, e.g., review/request.go.

type Signable

type Signable interface {
	Signature() *string
}

Signable is an interfaces which provides the pointer to the signable object's stringified signature.

This pointer is used by `Sign` and `Verify` to replace its contents with `placeholder` or the signature itself for the purposes of signing or verifying.

Jump to

Keyboard shortcuts

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