bmp

package
v0.0.0-...-56464ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2020 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BMailModeUnknown = iota
	BMailModeP2P
	BMailModeP2S

	RcpTypeTo = iota
	RcpTypeCC
	RcpTypeBcc
	RcpMonitor
)
View Source
const BMailSNSize = 16

Variables

This section is empty.

Functions

This section is empty.

Types

type BMailConn

type BMailConn struct {
	*net.TCPConn
}

func NewBMConn

func NewBMConn(ip net.IP) (*BMailConn, error)

func (*BMailConn) Helo

func (bc *BMailConn) Helo() error

func (*BMailConn) ReadWithHeader

func (bc *BMailConn) ReadWithHeader(v EnvelopeMsg) error

func (*BMailConn) SendWithHeader

func (bc *BMailConn) SendWithHeader(v EnvelopeMsg) error

type BMailEnvelope

type BMailEnvelope struct {
	Eid           string        `json:"eid"`
	FromName      string        `json:"fromName"`
	FromAddr      bmail.Address `json:"fromAddr"`
	RCPTs         []*Recipient  `json:"rcpts"`
	DateSince1970 uint64        `json:"timeSince1970"`
	Subject       string        `json:"subject"`
	MailBody      string        `json:"mailBody"`
	SessionID     string        `json:"sessionID"`
}

func (*BMailEnvelope) Hash

func (re *BMailEnvelope) Hash() []byte

func (*BMailEnvelope) ToString

func (re *BMailEnvelope) ToString() string

type BMailIV

type BMailIV [aes.BlockSize]byte

func NewIV

func NewIV() *BMailIV

func (*BMailIV) Bytes

func (iv *BMailIV) Bytes() []byte

type BMailSN

type BMailSN [BMailSNSize]byte

func (*BMailSN) Bytes

func (sn *BMailSN) Bytes() []byte

type EnvelopeAck

type EnvelopeAck struct {
	NextSN    BMailSN `json:"nextSN"`
	Hash      []byte  `json:"hash"`
	Sig       []byte  `json:"sig"`
	ErrorCode int     `json:"errorCode"`
}

func (*EnvelopeAck) GetBytes

func (ha *EnvelopeAck) GetBytes() ([]byte, error)

func (*EnvelopeAck) MsgType

func (ea *EnvelopeAck) MsgType() uint16

func (*EnvelopeAck) VerifyHeader

func (ea *EnvelopeAck) VerifyHeader(header *Header) bool

type EnvelopeMsg

type EnvelopeMsg interface {
	MsgType() uint16
	VerifyHeader(header *Header) bool
	GetBytes() ([]byte, error)
}

type EnvelopeSyn

type EnvelopeSyn struct {
	SN   BMailSN        `json:"sn"`
	Sig  []byte         `json:"sig"`
	Hash []byte         `json:"hash"`
	Env  *BMailEnvelope `json:"env"`
}

func (*EnvelopeSyn) GetBytes

func (ha *EnvelopeSyn) GetBytes() ([]byte, error)

func (*EnvelopeSyn) MsgType

func (es *EnvelopeSyn) MsgType() uint16

func (*EnvelopeSyn) VerifyHeader

func (es *EnvelopeSyn) VerifyHeader(header *Header) bool

type HELO

type HELO struct {
}

type HELOACK

type HELOACK struct {
	SN             BMailSN       `json:"sn"`
	SrvBca         bmail.Address `json:"srv"`
	ErrCode        int           `json:"errCode"`
	SupportVersion []uint16      `json:"support_version"`
}

func (*HELOACK) GetBytes

func (ha *HELOACK) GetBytes() ([]byte, error)

func (*HELOACK) MsgType

func (ha *HELOACK) MsgType() uint16

func (*HELOACK) VerifyHeader

func (ha *HELOACK) VerifyHeader(header *Header) bool
type Header struct {
	Ver    uint16 `json:"ver"`
	MsgTyp uint16 `json:"t"`
	MsgLen int    `json:"l"`
}

func (*Header) Derive

func (h *Header) Derive(data []byte) (int, error)

func (*Header) GetBytes

func (h *Header) GetBytes() []byte

func (*Header) GetLen

func (h *Header) GetLen() int8

type Recipient

type Recipient struct {
	ToName   string        `json:"to"`
	ToAddr   bmail.Address `json:"toAddr"`
	RcptType int8          `json:"rcptType"`
	AESKey   []byte        `json:"aesKey"`
}

func (*Recipient) ToString

func (r *Recipient) ToString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL