encryption

package
v0.0.0-...-e902457 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arbiter

type Arbiter struct {
	Key []byte
	GCM cipher.AEAD
}

func NewArbiter

func NewArbiter(key []byte) (*Arbiter, error)

func (*Arbiter) Decrypt

func (a *Arbiter) Decrypt(text []byte) ([]byte, error)

func (*Arbiter) Encrypt

func (a *Arbiter) Encrypt(text []byte) ([]byte, error)

type KeyPair

type KeyPair struct {
	Private *rsa.PrivateKey
	Public  *rsa.PublicKey
}

func GenerateRsaKeyPair

func GenerateRsaKeyPair() (*KeyPair, error)

func (*KeyPair) DecryptWithPrivateKey

func (kp *KeyPair) DecryptWithPrivateKey(text []byte) ([]byte, error)

func (*KeyPair) EncryptWithPublicKey

func (kp *KeyPair) EncryptWithPublicKey(text []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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