Documentation ¶
Index ¶
- Constants
- Variables
- func GenEdKey() (PubKey, PrivKey)
- func GenEdKeyWithSecret(secret []byte) (PubKey, PrivKey)
- func GenKeyPair(keyType string) (PubKey, PrivKey, error)
- func GenKeyPairWithSecret(keyType string, secret []byte) (PubKey, PrivKey, error)
- func GenSecpKey() (PubKey, PrivKey)
- func GenSecpKeyWithSecret(secret []byte) (PubKey, PrivKey)
- func GenSrKey() (PubKey, PrivKey)
- func GenSrKeyWithSecret(secret []byte) (PubKey, PrivKey)
- type EdPrivkey
- func (epr *EdPrivkey) Bytes() []byte
- func (epr *EdPrivkey) BytesWithType() []byte
- func (epr *EdPrivkey) Equals(key Key) bool
- func (epr *EdPrivkey) SignData(data []byte) ([]byte, error)
- func (epr *EdPrivkey) String() string
- func (epr *EdPrivkey) StringWithType() string
- func (epr *EdPrivkey) Type() string
- type EdPubkey
- func (epb *EdPubkey) Address() Address
- func (epb *EdPubkey) Bytes() []byte
- func (epb *EdPubkey) BytesWithType() []byte
- func (epb *EdPubkey) Equals(key Key) bool
- func (epb *EdPubkey) String() string
- func (epb *EdPubkey) StringWithType() string
- func (epb *EdPubkey) Type() string
- func (epb *EdPubkey) VerifySignature(msg, sig []byte) bool
- type FreePrivkey
- func (f *FreePrivkey) Bytes() []byte
- func (f *FreePrivkey) BytesWithType() []byte
- func (f *FreePrivkey) Equals(key Key) bool
- func (f *FreePrivkey) SignData(bytes []byte) ([]byte, error)
- func (f *FreePrivkey) String() string
- func (f *FreePrivkey) StringWithType() string
- func (f *FreePrivkey) Type() string
- type FreePubkey
- func (s *FreePubkey) Address() Address
- func (s *FreePubkey) Bytes() []byte
- func (s *FreePubkey) BytesWithType() []byte
- func (s *FreePubkey) Equals(key Key) bool
- func (s *FreePubkey) String() string
- func (s *FreePubkey) StringWithType() string
- func (s *FreePubkey) Type() string
- func (s *FreePubkey) VerifySignature(msg, sig []byte) bool
- type Key
- type PrivKey
- type PubKey
- type SecpPrivkey
- func (spr *SecpPrivkey) Bytes() []byte
- func (spr *SecpPrivkey) BytesWithType() []byte
- func (spr *SecpPrivkey) Equals(key Key) bool
- func (spr *SecpPrivkey) GenPubkey() []byte
- func (spr *SecpPrivkey) SignData(data []byte) ([]byte, error)
- func (spr *SecpPrivkey) String() string
- func (spr *SecpPrivkey) StringWithType() string
- func (spr *SecpPrivkey) Type() string
- type SecpPubkey
- func (spb *SecpPubkey) Address() Address
- func (spb *SecpPubkey) Bytes() []byte
- func (spb *SecpPubkey) BytesWithType() []byte
- func (spb *SecpPubkey) Equals(key Key) bool
- func (spb *SecpPubkey) String() string
- func (spb *SecpPubkey) StringWithType() string
- func (spb *SecpPubkey) Type() string
- func (spb *SecpPubkey) VerifySignature(msg, sig []byte) bool
- type SrPrivkey
- func (spr *SrPrivkey) Bytes() []byte
- func (spr *SrPrivkey) BytesWithType() []byte
- func (spr *SrPrivkey) Equals(key Key) bool
- func (spr *SrPrivkey) SignData(data []byte) ([]byte, error)
- func (spr *SrPrivkey) String() string
- func (spr *SrPrivkey) StringWithType() string
- func (spr *SrPrivkey) Type() string
- type SrPubkey
- func (spb *SrPubkey) Address() Address
- func (spb *SrPubkey) Bytes() []byte
- func (spb *SrPubkey) BytesWithType() []byte
- func (spb *SrPubkey) Equals(key Key) bool
- func (spb *SrPubkey) String() string
- func (spb *SrPubkey) StringWithType() string
- func (spb *SrPubkey) Type() string
- func (spb *SrPubkey) VerifySignature(msg, sig []byte) bool
Constants ¶
View Source
const ( SecretFree = "secret-free" Sr25519 = "sr25519" Ed25519 = "ed25519" Secp256k1 = "secp256k1" SecretFreeIdx = "0" Sr25519Idx = "1" Ed25519Idx = "2" Secp256k1Idx = "3" )
Variables ¶
View Source
var KeyTypeBytLen = 1
Functions ¶
func GenEdKeyWithSecret ¶
func GenKeyPairWithSecret ¶
func GenSecpKey ¶
func GenSecpKeyWithSecret ¶
func GenSrKeyWithSecret ¶
Types ¶
type EdPrivkey ¶
type EdPrivkey struct {
// contains filtered or unexported fields
}
func (*EdPrivkey) BytesWithType ¶
func (*EdPrivkey) StringWithType ¶
type EdPubkey ¶
type EdPubkey struct {
// contains filtered or unexported fields
}
func EdPubKeyFromBytes ¶
func (*EdPubkey) BytesWithType ¶
func (*EdPubkey) StringWithType ¶
func (*EdPubkey) VerifySignature ¶
type FreePrivkey ¶
type FreePrivkey struct{}
func (*FreePrivkey) Bytes ¶
func (f *FreePrivkey) Bytes() []byte
func (*FreePrivkey) BytesWithType ¶
func (f *FreePrivkey) BytesWithType() []byte
func (*FreePrivkey) Equals ¶
func (f *FreePrivkey) Equals(key Key) bool
func (*FreePrivkey) String ¶
func (f *FreePrivkey) String() string
func (*FreePrivkey) StringWithType ¶
func (f *FreePrivkey) StringWithType() string
func (*FreePrivkey) Type ¶
func (f *FreePrivkey) Type() string
type FreePubkey ¶
type FreePubkey struct{}
func (*FreePubkey) Address ¶
func (s *FreePubkey) Address() Address
func (*FreePubkey) Bytes ¶
func (s *FreePubkey) Bytes() []byte
func (*FreePubkey) BytesWithType ¶
func (s *FreePubkey) BytesWithType() []byte
func (*FreePubkey) Equals ¶
func (s *FreePubkey) Equals(key Key) bool
func (*FreePubkey) String ¶
func (s *FreePubkey) String() string
func (*FreePubkey) StringWithType ¶
func (s *FreePubkey) StringWithType() string
func (*FreePubkey) Type ¶
func (s *FreePubkey) Type() string
func (*FreePubkey) VerifySignature ¶
func (s *FreePubkey) VerifySignature(msg, sig []byte) bool
type SecpPrivkey ¶
type SecpPrivkey struct {
// contains filtered or unexported fields
}
func SecpPrivkeyFromBytes ¶
func SecpPrivkeyFromBytes(data []byte) *SecpPrivkey
func (*SecpPrivkey) Bytes ¶
func (spr *SecpPrivkey) Bytes() []byte
func (*SecpPrivkey) BytesWithType ¶
func (spr *SecpPrivkey) BytesWithType() []byte
func (*SecpPrivkey) Equals ¶
func (spr *SecpPrivkey) Equals(key Key) bool
func (*SecpPrivkey) GenPubkey ¶
func (spr *SecpPrivkey) GenPubkey() []byte
func (*SecpPrivkey) String ¶
func (spr *SecpPrivkey) String() string
func (*SecpPrivkey) StringWithType ¶
func (spr *SecpPrivkey) StringWithType() string
func (*SecpPrivkey) Type ¶
func (spr *SecpPrivkey) Type() string
type SecpPubkey ¶
type SecpPubkey struct {
// contains filtered or unexported fields
}
func SecpPubkeyFromBytes ¶
func SecpPubkeyFromBytes(data []byte) *SecpPubkey
func (*SecpPubkey) Address ¶
func (spb *SecpPubkey) Address() Address
func (*SecpPubkey) Bytes ¶
func (spb *SecpPubkey) Bytes() []byte
func (*SecpPubkey) BytesWithType ¶
func (spb *SecpPubkey) BytesWithType() []byte
func (*SecpPubkey) Equals ¶
func (spb *SecpPubkey) Equals(key Key) bool
func (*SecpPubkey) String ¶
func (spb *SecpPubkey) String() string
func (*SecpPubkey) StringWithType ¶
func (spb *SecpPubkey) StringWithType() string
func (*SecpPubkey) Type ¶
func (spb *SecpPubkey) Type() string
func (*SecpPubkey) VerifySignature ¶
func (spb *SecpPubkey) VerifySignature(msg, sig []byte) bool
type SrPrivkey ¶
type SrPrivkey struct {
// contains filtered or unexported fields
}
func (*SrPrivkey) BytesWithType ¶
func (*SrPrivkey) StringWithType ¶
type SrPubkey ¶
type SrPubkey struct {
// contains filtered or unexported fields
}
func SrPubKeyFromBytes ¶
func (*SrPubkey) BytesWithType ¶
func (*SrPubkey) StringWithType ¶
func (*SrPubkey) VerifySignature ¶
Click to show internal directories.
Click to hide internal directories.