aeadutils

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateInsecureHandleAndAead

func CreateInsecureHandleAndAead(rawKeyset string) (*keyset.Handle, tink.AEAD, error)

func CreateInsecureHandleAndDeterministicAead

func CreateInsecureHandleAndDeterministicAead(rawKeyset string) (*keyset.Handle, tink.DeterministicAEAD, error)

func CreateNewAead

func CreateNewAead() (*keyset.Handle, tink.AEAD, error)

func CreateNewDeterministicAead

func CreateNewDeterministicAead() (*keyset.Handle, tink.DeterministicAEAD, error)

func ExtractInsecureKeySetFromKeyhandle

func ExtractInsecureKeySetFromKeyhandle(kh *keyset.Handle) (string, error)

func GetEncryptionKey

func GetEncryptionKey(fieldName string, AEAD_CONFIG cmap.ConcurrentMap, setDepth ...int) (interface{}, bool)

func GetKeyPrefix

func GetKeyPrefix(fieldName string, potentialAEADKey string, kh *keyset.Handle) string

func IsKeyHandleDeterministic

func IsKeyHandleDeterministic(kh *keyset.Handle) bool

func IsKeyJsonDeterministic

func IsKeyJsonDeterministic(encryptionkey interface{}) (string, bool)

func IsSecretAnAEADKeyset added in v0.1.5

func IsSecretAnAEADKeyset(secret interface{}, fName string) (string, *keyset.Handle, error)

func MuteKeyMaterial

func MuteKeyMaterial(theKey string) string

func PivotMap

func PivotMap(originalMap map[string]map[string]string, newMap map[string]map[string]string)

func PivotMapInt

func PivotMapInt(mo map[string]interface{}, nmo map[string]interface{})

func RemoveKeyPrefix

func RemoveKeyPrefix(fieldName string) string

func ReverseKeyPrefix

func ReverseKeyPrefix(fieldName string) string

func RotateKeys

func RotateKeys(kh *keyset.Handle, deterministic bool)

func UpdateKeyID

func UpdateKeyID(kh *keyset.Handle, keyId string, newKeyId string) (*keyset.Handle, error)

func UpdateKeyMaterial

func UpdateKeyMaterial(kh *keyset.Handle, keyId string, material string) (*keyset.Handle, error)

func UpdateKeyStatus

func UpdateKeyStatus(kh *keyset.Handle, keyId string, status string) (*keyset.Handle, error)

func UpdatePrimaryKeyID

func UpdatePrimaryKeyID(kh *keyset.Handle, keyId string) (*keyset.Handle, error)

func ValidateB64Key

func ValidateB64Key(base64Keyset string) (string, error)

func ValidateKeySetJson

func ValidateKeySetJson(keySetJson string) (*keyset.Handle, error)

Types

type KeySetStruct

type KeySetStruct struct {
	PrimaryKeyID int `json:"primaryKeyId"`
	Key          []struct {
		KeyData struct {
			TypeURL         string `json:"typeUrl"`
			Value           string `json:"value"`
			KeyMaterialType string `json:"keyMaterialType"`
		} `json:"keyData"`
		Status           string `json:"status"`
		KeyID            int    `json:"keyId"`
		OutputPrefixType string `json:"outputPrefixType"`
	} `json:"key"`
}

func (*KeySetStruct) GetKeyID

func (k *KeySetStruct) GetKeyID(keyId int) (int, error)

func (*KeySetStruct) UpdateExistingKeyID

func (k *KeySetStruct) UpdateExistingKeyID(keyID int, newkeyID int)

func (*KeySetStruct) UpdateExistingKeyMaterial

func (k *KeySetStruct) UpdateExistingKeyMaterial(keyID int, keyMaterial string)

func (*KeySetStruct) UpdateExistingKeyStatus

func (k *KeySetStruct) UpdateExistingKeyStatus(keyID int, enabled string)

func (*KeySetStruct) UpdateExistingPrimaryKeyID

func (k *KeySetStruct) UpdateExistingPrimaryKeyID(keyID int)

Jump to

Keyboard shortcuts

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