types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Aesgcm128               = "aes-gcm-128"
	Aesgcm256               = "aes-gcm-256"
	XChacha20poly1305       = "xcha-cha-20-poly-1305"
	RsaSsapkcs12048sha256f4 = "RSA_SSA_PKCS1_2048_SHA256_F4"
)

Variables

View Source
var (
	AlgorithmTypeName = map[int32]string{
		0: "unknown_algorithm",
		1: "aes-gcm-128",
		2: "aes-gcm-256",
		3: "xcha-cha-20-poly-1305",
	}
	AlgorithmTypeValue = map[string]int32{
		"unknown_algorithm":     0,
		"aes-gcm-128":           1,
		"aes-gcm-256":           2,
		"xcha-cha-20-poly-1305": 3,
	}
)

Enum value maps for KeyStatusType.

View Source
var (
	HashTypeName = map[int32]string{
		0: "UNKNOWN_HASH",
		1: "SHA1",
		2: "SHA384",
		3: "SHA256",
		4: "SHA512",
		5: "SHA224",
	}
	HashTypeValue = map[string]int32{
		"UNKNOWN_HASH": 0,
		"SHA1":         1,
		"SHA384":       2,
		"SHA256":       3,
		"SHA512":       4,
		"SHA224":       5,
	}
)

Enum value maps for HashType.

View Source
var (
	KeyMaterialTypeName = map[int32]string{
		0: "UNKNOWN_KEYMATERIAL",
		1: "SYMMETRIC",
		2: "ASYMMETRIC_PRIVATE",
		3: "ASYMMETRIC_PUBLIC",
		4: "REMOTE",
	}
	KeyMaterialTypeValue = map[string]int32{
		"UNKNOWN_KEYMATERIAL": 0,
		"SYMMETRIC":           1,
		"ASYMMETRIC_PRIVATE":  2,
		"ASYMMETRIC_PUBLIC":   3,
		"REMOTE":              4,
	}
)

Enum value maps for KeyData_KeyMaterialType.

Functions

This section is empty.

Types

type AEAD

type AEAD interface {
	// Encrypt encrypts plaintext with associatedData as associated data.
	// The resulting ciphertext allows for checking authenticity and integrity of associated data
	// associatedData, but does not guarantee its secrecy.
	Encrypt(plaintext, associatedData []byte) ([]byte, error)

	// Decrypt decrypts ciphertext with associatedData as associated data.
	// The decryption verifies the authenticity and integrity of the associated data, but there are
	// no guarantees with respect to secrecy of that data.
	Decrypt(ciphertext, associatedData []byte) ([]byte, error)
}

AEAD is the interface for authenticated encryption with associated data. Implementations of this interface are secure against adaptive chosen ciphertext attacks. Encryption with associated data ensures authenticity and integrity of that data, but not its secrecy. (see RFC 5116, https://tools.ietf.org/html/rfc5116)

type AlgorithmSeriliser

type AlgorithmSeriliser interface {
	Serialise() ([]byte, error)
}

func NewAlgorithmSerialiser

func NewAlgorithmSerialiser(version byte, algo string, key []byte) AlgorithmSeriliser

type AlogorithmDeserialiser

type AlogorithmDeserialiser interface {
	Deserialise(buffer []byte) (int, error)
	Key() []byte
	Version() byte
	Algorithm() string
}

func NewAlgorithmDeserialiser

func NewAlgorithmDeserialiser() AlogorithmDeserialiser

type HashType

type HashType int32
const (
	HashTypeUNKNOWNHASH HashType = 0
	HashTypeSHA1        HashType = 1
	HashTypeSHA384      HashType = 2
	HashTypeSHA256      HashType = 3
	HashTypeSHA512      HashType = 4
	HashTypeSHA224      HashType = 5
)

type Key

type Key interface {
	KeyID() KeyID
	Operation() KeyOperation
	Data() KeyData
}

type KeyData

type KeyData interface {
	GetValue() ([]byte, error)
	FromValue(data []byte) error
	GetTypeURL() string
	GetKeyMaterialType() KeyMaterialType
	GetVersion() uint32
}

type KeyFactory

type KeyFactory interface {
	NewKey(operation KeyOperation) (Key, error)
	NewKeyFromData(operation KeyOperation, keyData []byte) (Key, error)
	Primitive(key Key) (AEAD, error)
}

type KeyFormat

type KeyFormat interface {
	Size() uint32
}

type KeyID

type KeyID uint32

type KeyMaterialType

type KeyMaterialType int32
const (
	KeyMaterialUNKNOWNKEYMATERIAL KeyMaterialType = 0
	KeyMaterialSYMMETRIC          KeyMaterialType = 1
	KeyMaterialASYMMETRICPRIVATE  KeyMaterialType = 2
	KeyMaterialASYMMETRICPUBLIC   KeyMaterialType = 3
	KeyMaterialREMOTE             KeyMaterialType = 4 // points to a remote key, i.e., in a KMS.
)

type KeyOperation

type KeyOperation interface {
	GetFormat() KeyFormat
	GetFactory() KeyFactory
}

type OnqlaveStructure

type OnqlaveStructure struct {
	Embeded map[string][]byte
	Edk     []byte
}

type TypeResolver

type TypeResolver interface {
	Serialise(name string, input interface{}) ([]byte, error)
	Deserialise(name string, input []byte) (interface{}, error)
}

func NewTypeResolver

func NewTypeResolver() TypeResolver

type Unwrapping

type Unwrapping interface {
	UnwrapKey(wdk []byte, epk []byte, fp []byte, password []byte) (dk []byte, err error)
}

type WrappingKeyFactory

type WrappingKeyFactory interface {
	Primitive(operation WrappingKeyOperation) (Unwrapping, error)
}

type WrappingKeyOperation

type WrappingKeyOperation interface {
	GetFormat() KeyFormat
	GetFactory() WrappingKeyFactory
}

Jump to

Keyboard shortcuts

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