pgp

package
v0.0.0-...-f8c8cd4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// NonceHexLen is the length of a hexadecimal nonce in bytes.
	NonceHexLen = 2 * nonceLen
)

Variables

This section is empty.

Functions

func EncryptArmored

func EncryptArmored(public, plain io.Reader) ([]byte, error)

EncryptArmored encrypts plaintext for one recipient by proving a plaintext and an armored public key. Returns an armored, encrypted PGP message.

The recipient is hidden using a speculative key ID.

func FingerprintArmored

func FingerprintArmored(public io.Reader) ([]byte, error)

FingerprintArmored gets the fingerprint from an armored public key.

func NonceHex

func NonceHex() (nonce []byte, err error)

NonceHex generates a random nonce encoded as hex.

func VerifyArmoredSig

func VerifyArmoredSig(public, sig, file io.Reader) (t time.Time, err error)

VerifyArmoredSig uses an armored public key to verify an armored, detached signature. Returns the signature creation time.

func VerifyEncryptedArmored

func VerifyEncryptedArmored(input io.Reader) (bool, error)

VerifyEncryptedArmored tries to validate that input is indeed an armored, encrypted PGP message.

func VerifyHexFingerprint

func VerifyHexFingerprint(fingerprint string) bool

VerifyHexFingerprint does rough checks to see if the input fingerprint is valid.

func VerifyPublicArmored

func VerifyPublicArmored(input io.Reader) (bool, error)

VerifyPublicArmored tries to validate that input is indeed an armored public key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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