Documentation ¶
Index ¶
- Constants
- func DecodePubKey(pubKeyStr string) ([]byte, error)
- func DecryptAes(data *CipherData, password string) (string, error)
- func DecryptByKey(data string, key []byte) (string, error)
- func Ed2CurvePriKey(privateKey []byte) []byte
- func Ed2CurvePubKey(edPub []byte) []byte
- func EncryptByKey(plainTxt string, key []byte) (string, error)
- func VerifySig(obj any, sig, peerAddr string) error
- type CipherData
- type MailAddr
- type MailKey
- type Wallet
- func (w *Wallet) DecryptData(peerAddr, msg string) (string, error)
- func (w *Wallet) EncryptData(peerAddr, msg string) (string, error)
- func (w *Wallet) KeyFromPeerAddr(addr string) ([]byte, error)
- func (w *Wallet) OpenWallet(pwd string) bool
- func (w *Wallet) SignMessage(msg []byte) (string, error)
- func (w *Wallet) String() string
Constants ¶
View Source
const ( CryptoKeyLen = 32 // 256 bits ScryptN = 1024 )
View Source
const BMailAddrPrefix = "BM"
View Source
const (
BMailPrefix = "BM"
)
Variables ¶
This section is empty.
Functions ¶
func DecodePubKey ¶
func DecryptAes ¶
func DecryptAes(data *CipherData, password string) (string, error)
func Ed2CurvePriKey ¶
func Ed2CurvePubKey ¶
Types ¶
type CipherData ¶
type CipherData struct { CipherTxt string `json:"cipher_txt"` Iv string `json:"iv"` Salt string `json:"salt"` KeySize int `json:"key_size"` Iterations int `json:"iterations"` }
func EncryptAes ¶
func EncryptAes(plainTxt, password string) (*CipherData, error)
type MailAddr ¶
type MailKey ¶
type MailKey struct { Address *MailAddr // contains filtered or unexported fields }
func NewMailKey ¶
func NewMailKey() *MailKey
func NewMailKeyFromSeed ¶
func (*MailKey) SignMessage ¶
type Wallet ¶
type Wallet struct { Address *MailAddr `json:"address"` CipherData *CipherData `json:"cipher_data"` Version int `json:"version"` // contains filtered or unexported fields }
func LoadWallet ¶
func ParseWallet ¶
func (*Wallet) DecryptData ¶ added in v1.0.3
func (*Wallet) EncryptData ¶ added in v1.0.3
func (*Wallet) KeyFromPeerAddr ¶ added in v1.0.3
func (*Wallet) OpenWallet ¶
func (*Wallet) SignMessage ¶ added in v1.0.3
Click to show internal directories.
Click to hide internal directories.