gpg

package module
v0.0.0-...-0b99b45 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArmoredKeyIngest

func ArmoredKeyIngest(input RawKeyData) (*openpgp.Entity, error)

ArmoredKeyIngest extracts a single entity, public or private, from an array of bytes. Theoretically we could use openpgp's ReadArmoredKeyRing, but we can't really build our own keyring that way, and we're storing these keys in separate database records.

func Decrypt

func Decrypt(in []byte, secretKeyring openpgp.EntityList) ([]byte, error)

Decrypt decrypts an input byte array with keys in secretkeyring

func Encrypt

func Encrypt(in []byte, publicKeyring openpgp.EntityList, id string, masterKeyFilePath string) ([]byte, error)

Encrypt encrypts an input byte array using an opengpg.EntityList and a specific key identifier. It can optionally read a file containing keys if specified in masterKeyFilePath. It returns encrypted data or an error if one is encountered.

func EntityID

func EntityID(e *openpgp.Entity) string

EntityID extracts the short name string for the ID for an entity.

func Fingerprint

func Fingerprint(e *openpgp.Entity) string

Fingerprint returns the 40-byte fingerprint name associated with an entity

func KeyArrayToEntityList

func KeyArrayToEntityList(ka []RawKeyData) (openpgp.EntityList, error)

KeyArrayToEntityList converts an array of armored GPG key data into an opengpg.EntityList, throwing errors if no keys are found or errors are encountered during the ingest process.

Types

type RawKeyData

type RawKeyData []byte

RawKeyData is a convenience type for []byte, used for ingesting raw GPG key data.

Jump to

Keyboard shortcuts

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