encryption

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EncryptionAlgFromProto = map[proto.EncryptionAlg]EncryptionAlg{
		0: AES256GCM,
		1: RSA,
		2: ECIES,
	}
	EncryptionAlgToProto = map[EncryptionAlg]proto.EncryptionAlg{
		AES256GCM: 0,
		RSA:       1,
		ECIES:     2,
	}
)

Functions

This section is empty.

Types

type AesDecrypter

type AesDecrypter struct {
	Alg  proto.EncryptionAlg
	Args DecrypterArgs
}

func NewAesDecrypter

func NewAesDecrypter(args DecrypterArgs) AesDecrypter

func (AesDecrypter) ToProto

func (s AesDecrypter) ToProto() *proto.Decrypter

type AesEncrypter

type AesEncrypter struct {
	Alg  proto.EncryptionAlg
	Args EncrypterArgs
}

func NewAesEncrypter

func NewAesEncrypter(args EncrypterArgs) AesEncrypter

func (AesEncrypter) ToProto

func (s AesEncrypter) ToProto() *proto.Encrypter

type Decrypter

type Decrypter interface {
	ToProto() *proto.Decrypter
}

type DecrypterArgs

type DecrypterArgs struct {
	Key        string
	LocalKey   *key.LocalKey
	ManagedKey *key.ManagedKey
}

type Encrypter

type Encrypter interface {
	ToProto() *proto.Encrypter
}

type EncrypterArgs

type EncrypterArgs struct {
	Key        string
	LocalKey   *key.LocalKey
	ManagedKey *key.ManagedKey
}

type EncryptionAlg

type EncryptionAlg int32
const (
	AES256GCM                   EncryptionAlg = iota
	RSA                         EncryptionAlg = iota
	ECIES                       EncryptionAlg = iota
	UNRECOGNIZED_ENCRYPTION_ALG EncryptionAlg = -1
)

type RsaDecrypter

type RsaDecrypter struct {
	Alg  proto.EncryptionAlg
	Args DecrypterArgs
}

func NewRsaDecrypter

func NewRsaDecrypter(args DecrypterArgs) RsaDecrypter

func (RsaDecrypter) ToProto

func (s RsaDecrypter) ToProto() *proto.Decrypter

type RsaEncrypter

type RsaEncrypter struct {
	Alg  proto.EncryptionAlg
	Args EncrypterArgs
}

func NewRsaEncrypter

func NewRsaEncrypter(args EncrypterArgs) RsaEncrypter

func (RsaEncrypter) ToProto

func (s RsaEncrypter) ToProto() *proto.Encrypter

Jump to

Keyboard shortcuts

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