crypto

package
v0.0.0-...-6f5a26a Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(cipher Cipher, dst, ciphertext []byte) ([]byte, error)

func Encrypt

func Encrypt(cipher Cipher, plaintext []byte) ([]byte, error)

Types

type Cipher

type Cipher cipher.AEAD

type PrivKey

type PrivKey []byte

func DecodePrivKey

func DecodePrivKey(b64 string) (PrivKey, error)

func GeneratePrivKey

func GeneratePrivKey() (PrivKey, error)

func (PrivKey) Cipher

func (priv PrivKey) Cipher(pub PubKey) (Cipher, error)

func (PrivKey) Encode

func (priv PrivKey) Encode() string

func (PrivKey) PubKey

func (priv PrivKey) PubKey() (PubKey, error)

type PubKey

type PubKey []byte

func DecodePubKey

func DecodePubKey(b64 string) (PubKey, error)

func (PubKey) Encode

func (pub PubKey) Encode() string

Jump to

Keyboard shortcuts

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