Documentation ¶
Overview ¶
Package enclave provides enclaves for the secure storage and propagation of transactions.
Index ¶
- func DoKeyGeneration(keyFile string) error
- type SecureEnclave
- func (s *SecureEnclave) Delete(digestHash *[]byte) error
- func (s *SecureEnclave) GetEncodedPartyInfo() []byte
- func (s *SecureEnclave) GetEncodedPartyInfoGrpc() []byte
- func (s *SecureEnclave) GetPartyInfo() (string, map[[nacl.KeySize]byte]string, map[string]bool)
- func (s *SecureEnclave) Retrieve(digestHash *[]byte, to *[]byte) ([]byte, error)
- func (s *SecureEnclave) RetrieveAllFor(reqRecipient *[]byte) error
- func (s *SecureEnclave) RetrieveDefault(digestHash *[]byte) ([]byte, error)
- func (s *SecureEnclave) RetrieveFor(digestHash *[]byte, reqRecipient *[]byte) (*[]byte, error)
- func (s *SecureEnclave) Store(message *[]byte, sender []byte, recipients [][]byte) ([]byte, error)
- func (s *SecureEnclave) StorePayload(encoded []byte) ([]byte, error)
- func (s *SecureEnclave) StorePayloadGrpc(epl api.EncryptedPayload, encoded []byte) ([]byte, error)
- func (s *SecureEnclave) UpdatePartyInfo(encoded []byte)
- func (s *SecureEnclave) UpdatePartyInfoGrpc(url string, recipients map[[nacl.KeySize]byte]string, parties map[string]bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoKeyGeneration ¶
DoKeyGeneration is used to generate new public and private key-pairs, writing them to the provided file locations. Public keys have the "pub" suffix, whereas private keys have the "key" suffix.
Types ¶
type SecureEnclave ¶
type SecureEnclave struct { Db storage.DataStore // The underlying key-value datastore for encrypted transactions PubKeys []nacl.Key // Public keys associated with this enclave PrivKeys []nacl.Key // Private keys associated with this enclave PartyInfo api.PartyInfo // Details of all other nodes (or parties) on the network // contains filtered or unexported fields }
SecureEnclave is the secure transaction enclave.
func Init ¶
func Init( db storage.DataStore, pubKeyFiles, privKeyFiles []string, pi api.PartyInfo, client utils.HttpClient, grpc bool) *SecureEnclave
Init creates a new instance of the SecureEnclave.
func (*SecureEnclave) Delete ¶
func (s *SecureEnclave) Delete(digestHash *[]byte) error
Delete deletes the payload associated with the given digestHash from the SecureEnclave's store.
func (*SecureEnclave) GetEncodedPartyInfo ¶
func (s *SecureEnclave) GetEncodedPartyInfo() []byte
GetEncodedPartyInfo provides this SecureEnclaves PartyInfo details in a binary encoded format.
func (*SecureEnclave) GetEncodedPartyInfoGrpc ¶
func (s *SecureEnclave) GetEncodedPartyInfoGrpc() []byte
func (*SecureEnclave) GetPartyInfo ¶
func (*SecureEnclave) Retrieve ¶
func (s *SecureEnclave) Retrieve(digestHash *[]byte, to *[]byte) ([]byte, error)
Retrieve is used to retrieve the provided payload. If the payload cannot be found, or decrypted successfully an error is returned.
func (*SecureEnclave) RetrieveAllFor ¶
func (s *SecureEnclave) RetrieveAllFor(reqRecipient *[]byte) error
RetrieveAllFor retrieves all payloads that the specified recipient was an original recipient for. Each payload found is published to the specified recipient.
func (*SecureEnclave) RetrieveDefault ¶
func (s *SecureEnclave) RetrieveDefault(digestHash *[]byte) ([]byte, error)
RetrieveDefault is used to retrieve the provided payload. It attempts to use a default key value of the first public key associated with this SecureEnclave instance. If the payload cannot be found, or decrypted successfully an error is returned.
func (*SecureEnclave) RetrieveFor ¶
func (s *SecureEnclave) RetrieveFor(digestHash *[]byte, reqRecipient *[]byte) (*[]byte, error)
RetrieveFor retrieves a payload with the given digestHash for a specific recipient who was one of the original recipients specified on the payload.
func (*SecureEnclave) Store ¶
Store a payload submitted via an Ethereum node. This function encrypts the payload, and distributes the encrypted payload to the other specified recipients in the network. The hash of the encrypted payload is returned to the sender.
func (*SecureEnclave) StorePayload ¶
func (s *SecureEnclave) StorePayload(encoded []byte) ([]byte, error)
Store a binary encoded payload within this SecureEnclave. This will be a payload that has been propagated to this node as it is a party on the transaction. I.e. it is not the original recipient of the transaction, but one of the recipients it is intended for.
func (*SecureEnclave) StorePayloadGrpc ¶
func (s *SecureEnclave) StorePayloadGrpc(epl api.EncryptedPayload, encoded []byte) ([]byte, error)
func (*SecureEnclave) UpdatePartyInfo ¶
func (s *SecureEnclave) UpdatePartyInfo(encoded []byte)
UpdatePartyInfo applies the provided binary encoded party details to the SecureEnclave's own party details store.