crypto

package
v1.85.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArmoredSign

func ArmoredSign(in io.Reader, out io.Writer, key Key) error

ArmoredSign signs message with the private key and writes an armored signature to out. Note that PrivateKey must have been decrypted if it is encrypted. See FindPrivateKey for more details.

func Verify

func Verify(in, sig io.Reader, key Key) error

Verify returns nil if sig is a valid signature of in and made by public key in pubKeyFile.

Types

type Key

type Key openpgp.Key

Key identifies a specific public key in an Entity. This is either the Entity's primary key or a subkey. See openpgp.Key for more details.

func FindKeysInArmoredKeyRing

func FindKeysInArmoredKeyRing(keyringFile, ID, passphrase string) (e []Key, err error)

FindKeysInKeyRing finds the key with ID in keyringFile. If passphrase is not an empty string and a private key that needs decrypting is founds, the passphrase will be used to decrypt it. It returns an error if no keys are found in keyring.

func (Key) PrimaryIdentity

func (k Key) PrimaryIdentity() *openpgp.Identity

PrimaryIdentity returns the Identity marked as primary or the first identity if none are so marked.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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