Documentation ¶
Index ¶
- func ArmoredKeyIngest(input RawKeyData) (*openpgp.Entity, error)
- func Decrypt(in []byte, secretKeyring openpgp.EntityList) ([]byte, error)
- func Encrypt(in []byte, publicKeyring openpgp.EntityList, id string, ...) ([]byte, error)
- func EntityID(e *openpgp.Entity) string
- func Fingerprint(e *openpgp.Entity) string
- func KeyArrayToEntityList(ka []RawKeyData) (openpgp.EntityList, error)
- type RawKeyData
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 Fingerprint ¶
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.