Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultVersion = 1 DefaultCipher = "aes-128-ctr" DefaultDsa = "secp256k1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct { Version byte // current version Dsa string // digital signature algorithm Cipher string // symmetric-key algorithm Payload []byte // symmetric encryped content Mac []byte // mac to verify decrypted plain content Key []byte // public key encryped symmetric-key Iv []byte // iv of cipher Sig []byte // signature signed by sender with field above }
func DecodeFromRLPBytes ¶
DecodeFromRLPBytes unmarshal raw to an Envelope
func NewEnvelope ¶
NewEnvelope create an envelope, with content and public key of receiver
func (*Envelope) EncodeToRLPBytes ¶
func (e *Envelope) EncodeToRLPBytes(prv *ecdsa.PrivateKey) ([]byte, error)
EncodeToRLPBytes marshal an Envelope to raw with signature
Click to show internal directories.
Click to hide internal directories.