pgp

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompressionLevel = 9        // 9 is the highest compression level
	RSABits          = 4096     // 4096 bits
	YearInSeconds    = 31536000 // 1 year in seconds -> 60 * 60 * 24 * 365 = 31,536,000
)

Variables

View Source
var (
	PreferredHashSHA256 = []uint8{8} // SHA-256
)

Functions

func Decrypt

func Decrypt(entity *openpgp.Entity, encrypted []byte) ([]byte, error)

func Encrypt

func Encrypt(entity *openpgp.Entity, message []byte) ([]byte, error)

func GetEntity

func GetEntity(publicKey []byte, privateKey []byte) (*openpgp.Entity, error)

GetEntity creates an OpenPGP entity from the provided public and private keys.

func Sign

func Sign(entity *openpgp.Entity, message []byte) ([]byte, error)

func Verify

func Verify(publicKeyEntity *openpgp.Entity, message []byte, signature []byte) error

Types

type KeyPair added in v0.1.1

type KeyPair struct {
	PublicKey  string
	PrivateKey string
}

func GenerateKeyPair

func GenerateKeyPair(fullname string, comment string, email string) (KeyPair, error)

Jump to

Keyboard shortcuts

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