Documentation ¶
Index ¶
- func DecryptVerify(decryptConfig *DecryptConfig, verifyConfig *VerifyConfig, cyphertext []byte) ([]byte, bool, error)
- func EncryptSign(encryptConfig *EncryptConfig, signatureConfig *SignatureConfig, ...) ([]byte, []byte, error)
- func GenerateKey(fullName string, email string, password string) ([]byte, error)
- func IsKeyLocked(key []byte) (bool, string, error)
- func ReadKey(key []byte, password string) (*openpgp.Entity, string, error)
- func Unarmor(data []byte) ([]byte, error)
- type DecryptConfig
- type EncryptConfig
- type SignatureConfig
- type VerifyConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptVerify ¶
func DecryptVerify( decryptConfig *DecryptConfig, verifyConfig *VerifyConfig, cyphertext []byte, ) ([]byte, bool, error)
DecryptVerify decrypts/verified plaintext
func EncryptSign ¶
func EncryptSign( encryptConfig *EncryptConfig, signatureConfig *SignatureConfig, plaintext []byte, ) ([]byte, []byte, error)
EncryptSign encrypts/signs plaintext
func GenerateKey ¶
GenerateKey generates a PGP key using x25519
func IsKeyLocked ¶
IsKeyLocked tests if a key is locked (i.e. if it is password protected)
Types ¶
type DecryptConfig ¶
DecryptConfig provides the information to decrypt something
type EncryptConfig ¶
type EncryptConfig struct { PublicKey *openpgp.Entity // The PGP public key ArmorCyphertext bool // Enables armoring the cyphertext }
EncryptConfig provides the information to encrypt something
type SignatureConfig ¶
type SignatureConfig struct { PrivateKey *openpgp.Entity // The PGP private key ArmorSignature bool // Enables armoring the signature DetachSignature bool // Enables creating a detached signature }
SignatureConfig provides the information to sign something
type VerifyConfig ¶
type VerifyConfig struct { PublicKey *openpgp.Entity // The PGP public key DetachedSignature []byte // The detached signature to use (may also be armored) }
VerifyConfig provides the information to verify something
Click to show internal directories.
Click to hide internal directories.