Documentation ¶
Index ¶
- Constants
- Variables
- type AEAD
- type AlgorithmSeriliser
- type AlogorithmDeserialiser
- type HashType
- type Key
- type KeyData
- type KeyFactory
- type KeyFormat
- type KeyID
- type KeyMaterialType
- type KeyOperation
- type OnqlaveStructure
- type TypeResolver
- type Unwrapping
- type WrappingKeyFactory
- type WrappingKeyOperation
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 ¶
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 Key ¶
type Key interface { KeyID() KeyID Operation() KeyOperation Data() KeyData }
type KeyFactory ¶
type KeyFactory interface { NewKey(operation KeyOperation) (Key, error) NewKeyFromData(operation KeyOperation, keyData []byte) (Key, error) Primitive(key Key) (AEAD, error) }
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 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 WrappingKeyFactory ¶
type WrappingKeyFactory interface {
Primitive(operation WrappingKeyOperation) (Unwrapping, error)
}
type WrappingKeyOperation ¶
type WrappingKeyOperation interface { GetFormat() KeyFormat GetFactory() WrappingKeyFactory }
Click to show internal directories.
Click to hide internal directories.