kms

package
v1.107.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("kms")

Error is the default error class for the package.

Functions

This section is empty.

Types

type Config

type Config struct {
	SecretVersion  string `` /* 140-byte string literal not displayed */
	SecretChecksum int64  `help:"checksum of the master key in Google Secret Manager" default:"0"`
	TestMasterKey  string `help:"a fake master key to be used for the purpose of testing" default:"test-master-key" hidden:"true"`
}

Config is a configuration struct for secret management Service.

type SecretsService

type SecretsService interface {
	// Initialize gets and validates the master key.
	Initialize(ctx context.Context) error

	// Close closes the service.
	Close() error
	// contains filtered or unexported methods
}

SecretsService is a service for retrieving the master key.

architecture: Service

type Service

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

Service is a service for encrypting/decrypting project passphrases.

architecture: Service

func NewService

func NewService(config Config) *Service

NewService creates a new Service.

func (*Service) Close

func (s *Service) Close() error

Close closes the service.

func (*Service) DecryptPassphrase

func (s *Service) DecryptPassphrase(ctx context.Context, encryptedPassphrase []byte) ([]byte, error)

DecryptPassphrase decrypts the provided encrypted passphrase using the masterKey.

func (*Service) EncryptPassphrase

func (s *Service) EncryptPassphrase(ctx context.Context, passphrase []byte) ([]byte, error)

EncryptPassphrase encrypts the provided passphrase using the masterKey in an XSalsa20 and Poly1305 encryption.

func (*Service) GenerateEncryptedPassphrase

func (s *Service) GenerateEncryptedPassphrase(ctx context.Context) ([]byte, error)

GenerateEncryptedPassphrase generates a cryptographically random passphrase, returning its encrypted form.

func (*Service) Initialize

func (s *Service) Initialize(ctx context.Context) (err error)

Initialize initializes the service.

Jump to

Keyboard shortcuts

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