raw

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package raw contains Raw Master Key implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyFactory

type KeyFactory struct{}

KeyFactory is a factory for creating RawMasterKey.

func (*KeyFactory) NewMasterKey

func (f *KeyFactory) NewMasterKey(args ...interface{}) (model.MasterKey, error)

NewMasterKey factory method returns a new instance of Raw MasterKey.

type KeyHandler

type KeyHandler interface {
	model.MasterKey
	// contains filtered or unexported methods
}

KeyHandler is an interface specific to the RawMasterKey which is used by Raw Master Key Provider.

type MasterKey

type MasterKey struct {
	keys.BaseKey

	Encrypter model.GcmCrypter
	// contains filtered or unexported fields
}

MasterKey contains the Raw Master Key and implements the model.MasterKey interface.

func (*MasterKey) DecryptDataKey

func (rawMK *MasterKey) DecryptDataKey(_ context.Context, encryptedDataKey model.EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.DataKeyI, error)

DecryptDataKey decrypts the encrypted data key and returns the data key.

func (*MasterKey) EncryptDataKey

EncryptDataKey encrypts the data key and returns the encrypted data key.

func (*MasterKey) GenerateDataKey

func (rawMK *MasterKey) GenerateDataKey(_ context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.DataKeyI, error)

GenerateDataKey generates a new data key and returns it.

func (*MasterKey) OwnsDataKey

func (rawMK *MasterKey) OwnsDataKey(key model.Key) bool

OwnsDataKey returns true if key is owned by the master key. In other words, the key was encrypted with the master key.

Jump to

Keyboard shortcuts

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