encryption

package
v2.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 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: AES256GCM_M,
		2: RSA,
		3: RSA_M,
	}
	EncryptionAlgToProto = map[EncryptionAlg]proto.EncryptionAlg{
		AES256GCM:   0,
		AES256GCM_M: 0,
		RSA:         1,
		RSA_M:       1,
	}
)

Functions

This section is empty.

Types

type Encrypter

type Encrypter struct {
	LocalKey           *key.LocalKey
	ManagedKey         *key.ManagedKey
	ManagedCertificate *key.ManagedCertificate
	LocalCertificate   *key.LocalCertificate
	AccessControl      *key.AccessControl
}

Encrypter represents an encryption configuration with various key types and access control.

func NewEncrypterWithLocalCertificate added in v2.7.0

func NewEncrypterWithLocalCertificate(key key.LocalCertificate) Encrypter

NewEncrypterWithLocalCertificate creates a new Encrypter instance with a local certificate for encryption.

func NewEncrypterWithLocalKey added in v2.7.0

func NewEncrypterWithLocalKey(key key.LocalKey) Encrypter

NewEncrypterWithLocalKey creates a new Encrypter instance with a local encryption key.

func NewEncrypterWithManagedCertificate added in v2.7.0

func NewEncrypterWithManagedCertificate(key key.ManagedCertificate, accessControl *key.AccessControl) Encrypter

NewEncrypterWithManagedCertificate creates a new Encrypter instance with a managed certificate for encryption and access control.

func NewEncrypterWithManagedKey added in v2.7.0

func NewEncrypterWithManagedKey(key key.ManagedKey, accessControl *key.AccessControl) Encrypter

NewEncrypterWithManagedKey creates a new Encrypter instance with a managed encryption key and access control.

func (Encrypter) ToProto

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

type EncrypterArgs

type EncrypterArgs struct {
	LocalKey           *key.LocalKey
	ManagedKey         *key.ManagedKey
	ManagedCertificate *key.ManagedCertificate
	LocalCertificate   *key.LocalCertificate
}

EncrypterArgs represents the arguments for an encrypter.

type EncryptionAlg

type EncryptionAlg int32

EncryptionAlg represents encryption algorithm types.

const (
	// AES256GCM represents the AES-256-GCM encryption algorithm.
	AES256GCM EncryptionAlg = iota
	// AES256GCM_M represents the AES-256-GCM with managed key encryption algorithm.
	AES256GCM_M EncryptionAlg = iota
	// RSA represents the RSA encryption algorithm.
	RSA EncryptionAlg = iota
	// RSA_M represents the RSA with managed key encryption algorithm.
	RSA_M EncryptionAlg = iota
	// UNRECOGNIZED_ENCRYPTION_ALG represents an unrecognized encryption algorithm.
	UNRECOGNIZED_ENCRYPTION_ALG EncryptionAlg = -1
)

Jump to

Keyboard shortcuts

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