crypto

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToPGPKey

func ByteToPGPKey(pubKey []byte) (*crypto.Key, error)

ByteToPGPKey unmarshals unarmored pgp key

func GenerateIDPem

func GenerateIDPem() (string, error)

func GeneratePGPKey

func GeneratePGPKey(name string) (string, error)

GeneratePGPKey generate pgp key armored format

func MarshalIDPrivateKey

func MarshalIDPrivateKey(prvKey crypto.PrivKey) (string, error)

MarshalIDPrivateKey will return the p2p id private key in pem encoded

func NewKeyPair

func NewKeyPair() (crypto.PrivKey, crypto.PubKey, error)

NewKeyPair generate p2p id key pair

func UnmarshalIDPrivateKey

func UnmarshalIDPrivateKey(pemEncoded string) (crypto.PrivKey, error)

UnmarshalIDPrivateKey receive p2p id private key in pem encoded

func UnmarshalPGPKey

func UnmarshalPGPKey(armoredPrivkey string, passphrase *[]byte) (*crypto.Key, error)

UnmarshalPGPKey unmarshals armored pgp key

Types

type PGPDecrypter

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

func NewPGPDecrypter

func NewPGPDecrypter(privKey *crypto.Key) (*PGPDecrypter, error)

func (*PGPDecrypter) DecryptMessage

func (g *PGPDecrypter) DecryptMessage(encrypted []byte) ([]byte, error)

type PGPEncrypter

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

func NewPGPEncrypter

func NewPGPEncrypter(pubKey *crypto.Key) (*PGPEncrypter, error)

func (*PGPEncrypter) EncryptMessage

func (g *PGPEncrypter) EncryptMessage(message []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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