Versions in this module Expand all Collapse all v1 v1.5.99 Aug 25, 2017 v1.5.97 Apr 24, 2017 Changes in this version + const AESNonceMaxLength + const DefaultTTL + const EnvelopeVersion + const MaxMessageLength + const MinimumPoW + const NumberOfMessageCodes + const ProtocolName + const ProtocolVersion + const ProtocolVersionStr + const SynchAllowance + const TopicLength + func BytesToIntBigEndian(b []byte) (res uint64) + func DeriveOneTimeKey(key []byte, salt []byte, version uint64) ([]byte, error) + func IsPubKeyEqual(a, b *ecdsa.PublicKey) bool + func ValidatePublicKey(k *ecdsa.PublicKey) bool + type Envelope struct + AESNonce []byte + Data []byte + EnvNonce uint64 + Expiry uint32 + Salt []byte + TTL uint32 + Topic TopicType + Version []byte + func NewEnvelope(ttl uint32, topic TopicType, salt []byte, aesNonce []byte, msg *SentMessage) *Envelope + func (e *Envelope) DecodeRLP(s *rlp.Stream) error + func (e *Envelope) Hash() common.Hash + func (e *Envelope) IsSymmetric() bool + func (e *Envelope) Open(watcher *Filter) (msg *ReceivedMessage) + func (e *Envelope) OpenAsymmetric(key *ecdsa.PrivateKey) (*ReceivedMessage, error) + func (e *Envelope) OpenSymmetric(key []byte) (msg *ReceivedMessage, err error) + func (e *Envelope) PoW() float64 + func (e *Envelope) Seal(options *MessageParams) error + func (e *Envelope) Ver() uint64 + type Filter struct + AcceptP2P bool + KeyAsym *ecdsa.PrivateKey + KeySym []byte + Messages map[common.Hash]*ReceivedMessage + PoW float64 + Src *ecdsa.PublicKey + SymKeyHash common.Hash + Topics []TopicType + func (f *Filter) MatchEnvelope(envelope *Envelope) bool + func (f *Filter) MatchMessage(msg *ReceivedMessage) bool + func (f *Filter) MatchTopic(topic TopicType) bool + func (f *Filter) Retrieve() (all []*ReceivedMessage) + func (f *Filter) Trigger(msg *ReceivedMessage) + type Filters struct + func NewFilters(w *Whisper) *Filters + func (fs *Filters) Get(i uint32) *Filter + func (fs *Filters) Install(watcher *Filter) uint32 + func (fs *Filters) NotifyWatchers(env *Envelope, p2pMessage bool) + func (fs *Filters) Uninstall(id uint32) + type MailServer interface + Archive func(env *Envelope) + DeliverMail func(whisperPeer *Peer, request *Envelope) + type MessageParams struct + Dst *ecdsa.PublicKey + KeySym []byte + Padding []byte + Payload []byte + PoW float64 + Src *ecdsa.PrivateKey + TTL uint32 + Topic TopicType + WorkTime uint32 + type Peer struct + func (p *Peer) ID() []byte + type ReceivedMessage struct + Dst *ecdsa.PublicKey + EnvelopeHash common.Hash + EnvelopeVersion uint64 + Padding []byte + Payload []byte + PoW float64 + Raw []byte + Sent uint32 + Signature []byte + Src *ecdsa.PublicKey + SymKeyHash common.Hash + TTL uint32 + Topic TopicType + func (msg *ReceivedMessage) SigToPubKey() *ecdsa.PublicKey + func (msg *ReceivedMessage) Validate() bool + type SentMessage struct + Raw []byte + func NewSentMessage(params *MessageParams) *SentMessage + func (msg *SentMessage) Wrap(options *MessageParams) (envelope *Envelope, err error) + type TopicType [TopicLength]byte + func BytesToTopic(b []byte) (t TopicType) + func (t *TopicType) UnmarshalJSON(input []byte) error + func (topic *TopicType) String() string + type Whisper struct + func NewWhisper(server MailServer) *Whisper + func (w *Whisper) AddSymKey(name string, key []byte) error + func (w *Whisper) DeleteIdentity(key string) + func (w *Whisper) DeleteSymKey(name string) + func (w *Whisper) Envelopes() []*Envelope + func (w *Whisper) GenerateSymKey(name string) error + func (w *Whisper) GetFilter(id uint32) *Filter + func (w *Whisper) GetIdentity(pubKey string) *ecdsa.PrivateKey + func (w *Whisper) GetSymKey(name string) []byte + func (w *Whisper) HasIdentity(pubKey string) bool + func (w *Whisper) HasSymKey(name string) bool + func (w *Whisper) MarkPeerTrusted(peerID []byte) error + func (w *Whisper) Messages(id uint32) []*ReceivedMessage + func (w *Whisper) NewIdentity() *ecdsa.PrivateKey + func (w *Whisper) Protocols() []p2p.Protocol + func (w *Whisper) RequestHistoricMessages(peerID []byte, envelope *Envelope) error + func (w *Whisper) Send(envelope *Envelope) error + func (w *Whisper) SendP2PDirect(peer *Peer, envelope *Envelope) error + func (w *Whisper) SendP2PMessage(peerID []byte, envelope *Envelope) error + func (w *Whisper) Start(*p2p.Server) error + func (w *Whisper) Stop() error + func (w *Whisper) Unwatch(id uint32) + func (w *Whisper) Version() uint + func (w *Whisper) Watch(f *Filter) uint32 + func (wh *Whisper) HandlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error