Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ReadContract reads a contract document from a YAML file, parses and validates it // and returns it as a strongly typed data structure ReadContract = F.Flow2( file.ReadFile, IOE.ChainEitherK(SE.ParseAndValidateContract), ) )
Functions ¶
func EncryptAndSignContract ¶
func EncryptAndSignContract( enc func(data []byte) IOE.IOEither[error, string], signer func([]byte) func([]byte) IOE.IOEither[error, []byte], pubKey func([]byte) E.Either[error, []byte], ) func(privKey []byte) ContractEncrypter
EncryptAndSignContract returns a function that signs the workload and env part of a contract and that adds the public key of the signature
- enc encrypts a piece of data - signer signs a piece of data - pubKey extracts the public key from the private key
func EncryptContract ¶
func EncryptContract(encBasic func(pubKey []byte) func(data []byte) IOE.IOEither[error, string]) func(pubkey []byte) ContractEncrypter
EncryptContract encrypts the field in a contract with the given public key
Types ¶
type ContractEncrypter ¶
ContractEncrypter is the type of a function that takes a contract and that encrypts it
Click to show internal directories.
Click to hide internal directories.