Documentation ¶
Index ¶
- Constants
- Variables
- func Encode(ma MetaAddr) (string, error)
- func GenerateKey() (PrivKey, PubKey)
- func ShareKey(privKey PrivKey, peerPub PubKey) []byte
- func Sign(message []byte, priv *PrivKey) ([]byte, error)
- func VerifySignature(message []byte, sig []byte, pk *PubKey) bool
- type Account
- func (a *Account) Addr() MetaAddr
- func (a *Account) GetPrivBytes() []byte
- func (a *Account) MetaChainAddr() string
- func (a *Account) SetPriv(priv PrivKey)
- func (a *Account) ShareKey(peer PubKey) []byte
- func (a *Account) Sign(message []byte) ([]byte, error)
- func (a *Account) VerifySignature(message []byte, sig []byte) bool
- type MetaAddr
- type PrivKey
- type PubKey
Constants ¶
Variables ¶
View Source
var New = func() *Account { priv, pub := GenerateKey() a := &Account{ priv: priv, pub: pub, } addr, err := PubKey2Addr(pub) if err != nil { return nil } a.addr = addr return a }
Functions ¶
func GenerateKey ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func (*Account) GetPrivBytes ¶
func (*Account) MetaChainAddr ¶
type MetaAddr ¶
type MetaAddr [MetaAddrLen]byte
func PubKey2Addr ¶
func (*MetaAddr) UnmarshalText ¶
FOR JSON UNMARSHAL
Click to show internal directories.
Click to hide internal directories.