Documentation ¶
Index ¶
- func IsNetworkNotSupportedError(err error) bool
- func ReadMessage(txData []byte, decrypter cipher.Decrypter) (*mail.Message, error)
- func SendMessage(ctx context.Context, msg *mail.Message, recipientKey keys.PublicKey, ...) error
- type PubKeyFinder
- type Receiver
- type Sender
- type SenderOpts
- type Signer
- type SignerOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNetworkNotSupportedError ¶
IsNetworkNotSupportedError network not supported errors can be resolved by selecting a different client or configuring the network.
func ReadMessage ¶
ReadMessage gets the messages, decrypts and checks to see if it's valid - Check transaction data - Decrypt location - Get message - Decrypt message - Check hash
func SendMessage ¶
func SendMessage(ctx context.Context, msg *mail.Message, recipientKey keys.PublicKey, sender Sender, sent stores.Sent, signer Signer) error
SendMessage performs all the actions required to send a message. - Create a hash of encoded message - Encrypt message - Store sent message - Encrypt message location - Create transaction data with encrypted location and message hash - Send transaction
Types ¶
type PubKeyFinder ¶
type PubKeyFinder interface {
PublicKeyFromAddress(ctx context.Context, network string, address []byte) ([]byte, error)
}
PubKeyFinder find public key to encrypt message with
type Receiver ¶
type Receiver interface {
Receive(ctx context.Context, network string, address []byte) ([]cipher.EncryptedContent, error)
}
Receiver gets encrypted data from blockchain.
type Sender ¶
type Sender interface {
Send(ctx context.Context, to []byte, from []byte, data []byte, signer Signer, opts SenderOpts) (err error)
}
Sender signs a transaction the sends it
type Signer ¶
type Signer interface {
Sign(opts SignerOpts) (signedTransaction interface{}, err error)
}
Signer return a signed transaction