Documentation ¶
Index ¶
- Constants
- Variables
- func DecodePayloadV2(message *pb.WakuMessage) (*n.PayloadV2, error)
- func EncodePayloadV2(payload2 *n.PayloadV2) (*pb.WakuMessage, error)
- type NoiseMessenger
- type NoiseWakuRelay
- type Pairing
- func (p *Pairing) AuthCode() <-chan string
- func (p *Pairing) ConfirmAuthCode(confirmed bool) error
- func (p *Pairing) Decrypt(msg *pb.WakuMessage) ([]byte, error)
- func (p *Pairing) Encrypt(plaintext []byte) (*pb.WakuMessage, error)
- func (p *Pairing) Execute(ctx context.Context) error
- func (p *Pairing) HandshakeComplete() bool
- func (p *Pairing) PairingInfo() (qrString string, qrMessageNametag n.MessageNametag)
- type PairingParameterOption
- type PairingParameters
- type QR
- type Receiver
- type Sender
Constants ¶
View Source
const DefaultApplicationName = "waku-noise-sessions"
View Source
const DefaultApplicationVersion = "0.1"
View Source
const DefaultShardID = "10"
Variables ¶
View Source
var ErrPairingTimeout = errors.New("pairing has timed out")
Functions ¶
func DecodePayloadV2 ¶
func DecodePayloadV2(message *pb.WakuMessage) (*n.PayloadV2, error)
DecodePayloadV2 decodes a WakuMessage to a PayloadV2 Currently, this is just a wrapper over deserializePayloadV2 and encryption/decryption is done on top (no KeyInfo)
func EncodePayloadV2 ¶
func EncodePayloadV2(payload2 *n.PayloadV2) (*pb.WakuMessage, error)
EncodePayloadV2 encodes a PayloadV2 to a WakuMessage Currently, this is just a wrapper over serializePayloadV2 and encryption/decryption is done on top (no KeyInfo)
Types ¶
type NoiseMessenger ¶
type NoiseWakuRelay ¶
type NoiseWakuRelay struct { NoiseMessenger // contains filtered or unexported fields }
func NewWakuRelayMessenger ¶
func NewWakuRelayMessenger(ctx context.Context, r *relay.WakuRelay, pubsubTopic *string, timesource timesource.Timesource) (*NoiseWakuRelay, error)
func (*NoiseWakuRelay) Stop ¶
func (r *NoiseWakuRelay) Stop()
func (*NoiseWakuRelay) Subscribe ¶
func (r *NoiseWakuRelay) Subscribe(ctx context.Context, contentTopic string) <-chan *pb.WakuMessage
type Pairing ¶
func NewPairing ¶
func NewPairing(myStaticKey n.Keypair, myEphemeralKey n.Keypair, opts PairingParameterOption, messenger NoiseMessenger, logger *zap.Logger) (*Pairing, error)
func (*Pairing) ConfirmAuthCode ¶
func (*Pairing) Encrypt ¶
func (p *Pairing) Encrypt(plaintext []byte) (*pb.WakuMessage, error)
Returns a WakuMessage with version 2 and encrypted payload
func (*Pairing) HandshakeComplete ¶
func (*Pairing) PairingInfo ¶
func (p *Pairing) PairingInfo() (qrString string, qrMessageNametag n.MessageNametag)
type PairingParameterOption ¶
type PairingParameterOption func(*PairingParameters) error
func WithDefaultResponderParameters ¶
func WithDefaultResponderParameters() PairingParameterOption
func WithInitiatorParameters ¶
func WithInitiatorParameters(qrString string, qrMessageNametag n.MessageNametag) PairingParameterOption
func WithResponderParameters ¶
func WithResponderParameters(applicationName, applicationVersion, shardID string, qrMessageNameTag *n.MessageNametag) PairingParameterOption
type PairingParameters ¶
type PairingParameters struct {
// contains filtered or unexported fields
}
type QR ¶
type QR struct {
// contains filtered or unexported fields
}
func StringToQR ¶
StringToQR deserializes input string in base64 to the corresponding (applicationName, applicationVersion, shardId, ephemeralKey, committedStaticKey)
Click to show internal directories.
Click to hide internal directories.