openpgp

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArmorMetadata added in v1.9.1

type ArmorMetadata struct {
	Body []byte
	Type string
}

type Entity added in v0.9.4

type Entity struct {
	PublicKey  string
	PrivateKey string
	Passphrase string
}

type FastOpenPGP

type FastOpenPGP struct {
}

func NewFastOpenPGP

func NewFastOpenPGP() *FastOpenPGP

func (*FastOpenPGP) ArmorDecode added in v1.9.1

func (o *FastOpenPGP) ArmorDecode(message string) (*ArmorMetadata, error)

func (*FastOpenPGP) ArmorEncode added in v1.4.0

func (o *FastOpenPGP) ArmorEncode(packet []byte, messageType string) (string, error)

func (*FastOpenPGP) ConvertPrivateKeyToPublicKey added in v1.5.0

func (o *FastOpenPGP) ConvertPrivateKeyToPublicKey(key string) (string, error)

func (*FastOpenPGP) Decrypt

func (o *FastOpenPGP) Decrypt(message, privateKey, passphrase string, options *KeyOptions) (string, error)

func (*FastOpenPGP) DecryptBytes added in v0.6.0

func (o *FastOpenPGP) DecryptBytes(message []byte, privateKey, passphrase string, options *KeyOptions) ([]byte, error)

func (*FastOpenPGP) DecryptFile added in v1.1.0

func (o *FastOpenPGP) DecryptFile(input, output, privateKey, passphrase string, options *KeyOptions) (int, error)

func (*FastOpenPGP) DecryptSymmetric

func (o *FastOpenPGP) DecryptSymmetric(message, passphrase string, options *KeyOptions) (string, error)

func (*FastOpenPGP) DecryptSymmetricBytes added in v0.6.0

func (o *FastOpenPGP) DecryptSymmetricBytes(message []byte, passphrase string, options *KeyOptions) ([]byte, error)

func (*FastOpenPGP) DecryptSymmetricFile added in v1.1.0

func (o *FastOpenPGP) DecryptSymmetricFile(input, output string, passphrase string, options *KeyOptions) (int, error)

func (*FastOpenPGP) Encrypt

func (o *FastOpenPGP) Encrypt(message, publicKey string, signedEntity *Entity, fileHints *FileHints, options *KeyOptions) (string, error)

func (*FastOpenPGP) EncryptBytes added in v0.6.0

func (o *FastOpenPGP) EncryptBytes(message []byte, publicKey string, signedEntity *Entity, fileHints *FileHints, options *KeyOptions) ([]byte, error)

func (*FastOpenPGP) EncryptFile added in v1.1.0

func (o *FastOpenPGP) EncryptFile(input, output, publicKey string, signedEntity *Entity, fileHints *FileHints, options *KeyOptions) (int, error)

func (*FastOpenPGP) EncryptSymmetric

func (o *FastOpenPGP) EncryptSymmetric(message, passphrase string, fileHints *FileHints, options *KeyOptions) (string, error)

func (*FastOpenPGP) EncryptSymmetricBytes added in v0.6.0

func (o *FastOpenPGP) EncryptSymmetricBytes(message []byte, passphrase string, fileHints *FileHints, options *KeyOptions) ([]byte, error)

func (*FastOpenPGP) EncryptSymmetricFile added in v1.1.0

func (o *FastOpenPGP) EncryptSymmetricFile(input, output string, passphrase string, fileHints *FileHints, options *KeyOptions) (int, error)

func (*FastOpenPGP) Generate

func (o *FastOpenPGP) Generate(options *Options) (*KeyPair, error)

func (*FastOpenPGP) GetPrivateKeyMetadata added in v0.6.0

func (o *FastOpenPGP) GetPrivateKeyMetadata(key string) (*PrivateKeyMetadata, error)

func (*FastOpenPGP) GetPublicKeyMetadata added in v0.6.0

func (o *FastOpenPGP) GetPublicKeyMetadata(key string) (*PublicKeyMetadata, error)

func (*FastOpenPGP) ReadPrivateKeys added in v0.9.2

func (o *FastOpenPGP) ReadPrivateKeys(key, passphrase string) error

ReadPrivateKeys will only be used to check if something is wrong with the key

func (*FastOpenPGP) Sign

func (o *FastOpenPGP) Sign(message, privateKey, passphrase string, options *KeyOptions) (string, error)

func (*FastOpenPGP) SignBytes added in v0.6.0

func (o *FastOpenPGP) SignBytes(message []byte, privateKey, passphrase string, options *KeyOptions) ([]byte, error)

func (*FastOpenPGP) SignBytesToString added in v0.6.1

func (o *FastOpenPGP) SignBytesToString(message []byte, privateKey, passphrase string, options *KeyOptions) (string, error)

func (*FastOpenPGP) SignData added in v1.9.0

func (o *FastOpenPGP) SignData(message, privateKey, passphrase string, options *KeyOptions) (string, error)

func (*FastOpenPGP) SignDataBytes added in v1.9.0

func (o *FastOpenPGP) SignDataBytes(message []byte, privateKey, passphrase string, options *KeyOptions) ([]byte, error)

func (*FastOpenPGP) SignDataBytesToString added in v1.9.0

func (o *FastOpenPGP) SignDataBytesToString(message []byte, privateKey, passphrase string, options *KeyOptions) (string, error)

func (*FastOpenPGP) SignFile added in v1.1.0

func (o *FastOpenPGP) SignFile(input, privateKey, passphrase string, options *KeyOptions) (string, error)

func (*FastOpenPGP) Verify

func (o *FastOpenPGP) Verify(signature, message, publicKey string) (bool, error)

func (*FastOpenPGP) VerifyBytes added in v0.6.0

func (o *FastOpenPGP) VerifyBytes(signature string, message []byte, publicKey string) (bool, error)

func (*FastOpenPGP) VerifyData added in v1.9.0

func (o *FastOpenPGP) VerifyData(signature, publicKey string) (bool, error)

func (*FastOpenPGP) VerifyDataBytes added in v1.9.0

func (o *FastOpenPGP) VerifyDataBytes(signature []byte, publicKey string) (bool, error)

func (*FastOpenPGP) VerifyFile added in v1.1.0

func (o *FastOpenPGP) VerifyFile(signature, input, publicKey string) (bool, error)

type FileHints added in v0.9.4

type FileHints struct {
	IsBinary bool
	FileName string
	ModTime  string
}

type Identity added in v1.5.3

type Identity struct {
	ID      string
	Name    string
	Comment string
	Email   string
}

type KeyOptions

type KeyOptions struct {
	Algorithm        string
	Curve            string
	Hash             string
	Cipher           string
	Compression      string
	CompressionLevel int
	RSABits          int
}

func (*KeyOptions) SetCompressionLevelFromString added in v0.6.0

func (k *KeyOptions) SetCompressionLevelFromString(value string)

func (*KeyOptions) SetRSABitsFromString added in v0.6.0

func (k *KeyOptions) SetRSABitsFromString(value string)

type KeyPair

type KeyPair struct {
	PublicKey  string
	PrivateKey string
}

type Options

type Options struct {
	KeyOptions *KeyOptions
	Name       string
	Comment    string
	Email      string
	Passphrase string
}

type PrivateKeyMetadata added in v0.6.0

type PrivateKeyMetadata struct {
	KeyID        string
	KeyIDShort   string
	CreationTime string
	Fingerprint  string
	KeyIDNumeric string
	IsSubKey     bool
	Encrypted    bool
	CanSign      bool
	Identities   []Identity
	SubKeys      []PrivateKeyMetadata
}

type PublicKeyMetadata added in v0.6.0

type PublicKeyMetadata struct {
	Algorithm    string
	KeyID        string
	KeyIDShort   string
	CreationTime string
	Fingerprint  string
	KeyIDNumeric string
	IsSubKey     bool
	CanSign      bool
	CanEncrypt   bool
	Identities   []Identity
	SubKeys      []PublicKeyMetadata
}

Jump to

Keyboard shortcuts

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