gpg

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: GPL-3.0 Imports: 10 Imported by: 3

README

* gpg

Golang bindings to GnuPG.

* TODO Functions

* TODO Examples

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearSignData

func ClearSignData(data string) (bytes.Buffer, error)

ClearSignData make clear signature

func ClearSignDataNoBatch

func ClearSignDataNoBatch(data string) ([]byte, error)

ClearSignDataNoBatch make clear signature with interactive terminal

func ClearSignDataWithNoBatch

func ClearSignDataWithNoBatch(data, gpgid string) ([]byte, error)

ClearSignDataWithNoBatch make clear signature with provided gpgid and interactive terminal

func DecryptDataWithPass

func DecryptDataWithPass(data string, password string) (bytes.Buffer, error)

DecryptDataWithPass ...

func DecryptFile

func DecryptFile(path, output string) error

DecryptFile in provided path return error

func DeleteKey

func DeleteKey(id string) error

DeleteKey Delete key from gpg db

func DetachSign

func DetachSign(data string) (bytes.Buffer, error)

DetachSign return detached signature as bytes.Buffer

func DetachSignWithPass

func DetachSignWithPass(data string, password string) (bytes.Buffer, error)

DetachSignWithPass return detached signature as bytes.Buffer

func EncryptArmorData

func EncryptArmorData(gpgid string, data string) (string, error)

EncryptArmorData ...

func EncryptArmorDataWithPassword

func EncryptArmorDataWithPassword(gpgid, data, password string) (string, error)

EncryptArmorDataWithPassword ...

func EncryptArmorFile

func EncryptArmorFile(gpgid, path, output string) error

EncryptArmorFile in provided path return error

func EncryptArmorFileRecipientSelf

func EncryptArmorFileRecipientSelf(path, output string) error

EncryptArmorFileRecipientSelf in provided path return error

func EncryptData

func EncryptData(gpgid string, data string) (string, error)

EncryptData ...

func EncryptFile

func EncryptFile(gpgid, path, output string) error

EncryptFile in provided path return error

func EncryptFileRecipientSelf

func EncryptFileRecipientSelf(path, output string) error

EncryptFileRecipientSelf in provided path return error

func ExtractDataFromSigned

func ExtractDataFromSigned(data string) (bytes.Buffer, error)

ExtractDataFromSigned extract data from clear signed data

func ExtractPubKey

func ExtractPubKey(id string) (string, error)

ExtractPubKey ...

func ImportPubkey

func ImportPubkey(pubkey string) (string, error)

ImportPubkey ...

func RecvKeyFromSKS

func RecvKeyFromSKS(gpgid string, sks string) error

RecvKeyFromSKS Recieve pubkey from SKS

func RecvKeyFromSKSAndSign

func RecvKeyFromSKSAndSign(id string, sks string) error

RecvKeyFromSKSAndSign Recieve pubkey from sks and sign it

func RecvKeyFromSKSAndSignWithPass

func RecvKeyFromSKSAndSignWithPass(gpgid string, password string, sks string) error

RecvKeyFromSKSAndSignWithPass Recieve pubkey from sks and sign it

func SendKeyToSKS

func SendKeyToSKS(gpgid, sks string) error

SendKeyToSKS send pubkey to remote keyserver

func SignData

func SignData(data string) (bytes.Buffer, error)

SignData make gpg signature

func SignDataNoBatch

func SignDataNoBatch(data string) ([]byte, error)

SignDataNoBatch make gpg signature with interactive terminal

func SignDataWithPass

func SignDataWithPass(data string, password string) (bytes.Buffer, error)

SignDataWithPass make gpg signature with provided password

func SignKey

func SignKey(gpgid string) error

SignKey ...

func SignKeyWithPassword

func SignKeyWithPassword(gpgid string, password string) error

SignKeyWithPassword ...

func Verify

func Verify(data string) (string, error)

Verify signature

func VerifyFile

func VerifyFile(signaturePath string) (bool, error)

VerifyFile runs gpg --verify /path/to/signature.asc

Types

type Key

type Key struct {
	Created string
	Size    int
	ID      string
	UID     string
}

Key GPG key information

func ListSecretKeys

func ListSecretKeys() ([]Key, error)

ListSecretKeys list secret keys from ~/.gnupg/

func ShowKey

func ShowKey(id string) (Key, error)

ShowKey Get key from db

type SubKey

type SubKey struct {
	Created string
	Size    int
	ID      string
}

SubKey GPG subkey information

func GetSubkey

func GetSubkey(id string) (SubKey, error)

GetSubkey Extract subkey info by secret key ID

Jump to

Keyboard shortcuts

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