contract

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyEnv                  = "env"
	KeyWorkload             = "workload"
	KeyAttestationPublicKey = "attestationPublicKey"
	KeySigningKey           = "signingKey"
	KeyEnvWorkloadSignature = "envWorkloadSignature"

	ParseRawMapE     = Y.Parse[RawMap]
	StringifyRawMapE = Y.Stringify[RawMap]
	MapDerefRawMapE  = E.Map[error](F.Deref[RawMap])
	MapRefRawMapE    = E.Map[error](F.Ref[RawMap])
)

Functions

func CryptoEncryptAndSignContract

func CryptoEncryptAndSignContract(cert []byte) func([]byte) func(RawMap) E.Either[error, RawMap]

CryptoEncryptAndSignContract returns the crypto implementation of the encryption and signer

func EncryptAndSignContract

func EncryptAndSignContract(
	enc func(data []byte) E.Either[error, string],
	signer func([]byte) func([]byte) E.Either[error, []byte],
	pubKey func([]byte) E.Either[error, []byte],
) func([]byte) func(RawMap) E.Either[error, RawMap]

EncryptAndSignContract returns a function that signs the workload and env part of a contract and that adds the public key of the signature to the map - enc encrypts a piece of data - signer signs a piece of data - pubKey extracts the public key from the private key

func OpenSSLEncryptAndSignContract

func OpenSSLEncryptAndSignContract(cert []byte) func([]byte) func(RawMap) E.Either[error, RawMap]

OpenSSLEncryptAndSignContract returns the OpenSSL implementation of the encryption and signer

Types

type RawMap

type RawMap = map[string]any

Jump to

Keyboard shortcuts

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