Documentation ¶
Index ¶
- Constants
- Variables
- func AESKey(salt []byte, password string) ([]byte, error)
- func Decrypt(key []byte, cipherTxt []byte) ([]byte, error)
- func Encrypt(key []byte, plainTxt []byte) ([]byte, error)
- func PrivateKeyToCurve25519(curve25519Private *[32]byte, privateKey *[64]byte)
- func RecoverPub(addr Address, suffix string) ([]byte, error)
- func VerifyStamp(stamp Stamp) error
- type Address
- type CipherData
- type KeyParam
- type RawStamp
- type Stamp
- type StampSig
- type Wallet
- func (sw *Wallet) Address() Address
- func (sw *Wallet) Close()
- func (sw *Wallet) IsOpen() bool
- func (sw *Wallet) Name() string
- func (sw *Wallet) Open(auth string) error
- func (sw *Wallet) SetName(newName string)
- func (sw *Wallet) Sign(s *RawStamp) *StampSig
- func (sw *Wallet) String() string
- func (sw *Wallet) Verbose() string
Constants ¶
View Source
const ( AccPrefix = "BS" AccLen = 20 )
View Source
const (
WalletVersion = "2"
)
Variables ¶
View Source
var ( WOpenErr = errors.New("open wallet failed") WVerifyErr = errors.New("verify signature failed") WInvalidSig = errors.New("invalid signature data") )
View Source
var (
InvalidAddr = errors.New("invalid address")
)
View Source
var KP = KeyParam{
S: 8,
N: 1 << 15,
R: 8,
P: 1,
L: 32,
}
Functions ¶
func PrivateKeyToCurve25519 ¶
func VerifyStamp ¶
Types ¶
type CipherData ¶
type Wallet ¶
type Wallet struct { NickName string `json:"nick_name"` Version string `json:"version"` Addr Address `json:"address"` Cipher *CipherData `json:"cipher"` // contains filtered or unexported fields }
func CreateWallet ¶
func LoadByFile ¶
func LoadByJsonData ¶
Click to show internal directories.
Click to hide internal directories.