extra

package
v0.0.0-...-822dead Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const KeyType_OpenPGP = 5

Variables

View Source
var PGPDefaultConf = &packet.Config{
	DefaultHash: c.SHA256,
}

Functions

func ArmoredEntityReader

func ArmoredEntityReader(armored io.Reader) (*openpgp.Entity, error)

func DecodeBase64String

func DecodeBase64String(message string) []byte

func DecryptPrivateKey

func DecryptPrivateKey(ent *openpgp.Entity, passphrase string)

func EncodeBytesToBase64

func EncodeBytesToBase64(buf *bytes.Buffer) string

func GeneratePGPKeyPair

func GeneratePGPKeyPair(name string, comment string, email string) (crypto.PrivKey, crypto.PubKey, error)

func PGPPrivUnmarshaller

func PGPPrivUnmarshaller(data []byte) (crypto.PrivKey, error)

func PGPPubUnmarshaller

func PGPPubUnmarshaller(data []byte) (crypto.PubKey, error)

func ReadArmoredPrivateFile

func ReadArmoredPrivateFile(name, passphrase string) (p2pc.PrivKey, error)

Open and parse private or public armored file

func ReadArmoredPubFile

func ReadArmoredPubFile(name string) (p2pc.PubKey, error)

Open and parse private or public armored file

func ReadPubAndPrivateArmorKeyFile

func ReadPubAndPrivateArmorKeyFile(pub, priv, pass string) (p2pc.PrivKey, p2pc.PubKey)

func RegisterOpenPGPBinding

func RegisterOpenPGPBinding()

Types

type PGPPrivateKey

type PGPPrivateKey struct {
	// contains filtered or unexported fields
}

func (*PGPPrivateKey) Bytes

func (k *PGPPrivateKey) Bytes() ([]byte, error)

func (*PGPPrivateKey) DecryptMessage

func (k *PGPPrivateKey) DecryptMessage(encString string) (decrypted string, err error)

func (*PGPPrivateKey) Equals

func (k *PGPPrivateKey) Equals(key crypto.Key) bool

func (*PGPPrivateKey) GetPublic

func (k *PGPPrivateKey) GetPublic() crypto.PubKey

func (*PGPPrivateKey) Raw

func (k *PGPPrivateKey) Raw() ([]byte, error)

func (*PGPPrivateKey) Sign

func (k *PGPPrivateKey) Sign(data []byte) ([]byte, error)

func (*PGPPrivateKey) Type

func (k *PGPPrivateKey) Type() pb.KeyType

type PGPPublicKey

type PGPPublicKey struct {
	Ent openpgp.Entity
}

Ed25519PublicKey is an ed25519 public pair.

func (*PGPPublicKey) Bytes

func (k *PGPPublicKey) Bytes() ([]byte, error)

func (*PGPPublicKey) EncryptMessage

func (k *PGPPublicKey) EncryptMessage(secretString string) (encrypted string)

if outEncryptedFile file is not nil, the file will also be stored return the string value

func (*PGPPublicKey) Equals

func (k *PGPPublicKey) Equals(key crypto.Key) bool

func (*PGPPublicKey) Raw

func (k *PGPPublicKey) Raw() ([]byte, error)

func (*PGPPublicKey) Type

func (k *PGPPublicKey) Type() pb.KeyType

func (*PGPPublicKey) Verify

func (k *PGPPublicKey) Verify(data []byte, sig []byte) (bool, error)

Jump to

Keyboard shortcuts

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