Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeWakuMessage ¶
func DecodeWakuMessage(message *pb.WakuMessage, keyInfo *KeyInfo) error
func EncodeWakuMessage ¶
func EncodeWakuMessage(message *pb.WakuMessage, keyInfo *KeyInfo) error
Types ¶
type DecodedPayload ¶
type DecodedPayload struct { Data []byte // Decoded message payload Padding []byte // Used to align data size, since data size alone might reveal important metainformation. PubKey *ecdsa.PublicKey // The public key that signed the payload Signature []byte }
DecodedPayload contains the data of the received message after decrypting it
func DecodePayload ¶
func DecodePayload(message *pb.WakuMessage, keyInfo *KeyInfo) (*DecodedPayload, error)
DecodePayload decodes a WakuMessage depending on the version parameter. 0 for raw unencrypted data, and 1 for using WakuV1 decoding
type KeyInfo ¶
type KeyInfo struct { Kind KeyKind // Indicates the type of encryption to use SymKey []byte // If the encryption is Symmetric, a Symmetric key must be specified PubKey ecdsa.PublicKey // If the encryption is Asymmetric, the public key of the message receptor must be specified PrivKey *ecdsa.PrivateKey // Set a privkey if the message requires a signature }
type Payload ¶
type Payload struct { Data []byte // Raw message payload Padding []byte // Used to align data size, since data size alone might reveal important metainformation. Key *KeyInfo // Contains the type of encryption to apply and the private key to use for signing the message }
Payload contains the data of the message to encode
Click to show internal directories.
Click to hide internal directories.