Documentation
¶
Index ¶
- func ConvertPemToPrivateKey(skPem string) (*rsa.PrivateKey, error)
- func CreateThreshold(skBytes []byte, operators []*Operator) (map[uint64]*IShare, error)
- func DecodeKey(sk *rsa.PrivateKey, hashBase64 string) (string, error)
- func ExtractPublicKey(sk *rsa.PrivateKey) (string, error)
- func GenerateKeys() ([]byte, []byte, error)
- func GenerateKeysBase64() (string, string, error)
- func KeystoreShareV2ForJson(validatorPublicKey, version, ssvAmount string, skBytes []byte, ...) (string, error)
- func PrivateKeyToByte(sk *rsa.PrivateKey) []byte
- type IShare
- type KeystoreShareData
- type KeystoreShareInfo
- type KeystoreShareRes
- type Operator
- type Payload
- type Shares
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertPemToPrivateKey ¶
func ConvertPemToPrivateKey(skPem string) (*rsa.PrivateKey, error)
ConvertPemToPrivateKey return rsa private key from secret key
func CreateThreshold ¶
CreateThreshold receives a bls.SecretKey hex and count. Will split the secret key into count shares
func DecodeKey ¶
func DecodeKey(sk *rsa.PrivateKey, hashBase64 string) (string, error)
DecodeKey with secret key (base64) and hash (base64), return the encrypted key string
func ExtractPublicKey ¶
func ExtractPublicKey(sk *rsa.PrivateKey) (string, error)
ExtractPublicKey get public key from private key and return base64 encoded public key
func GenerateKeys ¶
GenerateKeys using rsa random generate keys and return []byte bas64
func GenerateKeysBase64 ¶
GenerateKeysBase64 ssv 公私钥生成
func KeystoreShareV2ForJson ¶
func KeystoreShareV2ForJson(validatorPublicKey, version, ssvAmount string, skBytes []byte, operators []*Operator) (string, error)
KeystoreShareV2ForJson keystore 分片json结果
func PrivateKeyToByte ¶
func PrivateKeyToByte(sk *rsa.PrivateKey) []byte
PrivateKeyToByte converts privateKey to []byte
Types ¶
type KeystoreShareData ¶
type KeystoreShareData struct {}
type KeystoreShareInfo ¶
type KeystoreShareInfo struct { uint64 PublicKey string // 分片加密后的私钥 Operator *Operator // contains filtered or unexported fields }ID
KeystoreShareInfo ssv KeystoreShare 业务计算结构
func EncryptShares ¶
func EncryptShares(skBytes []byte, operators []*Operator) ([]*KeystoreShareInfo, error)
EncryptShares 构造分片的加密公私钥对
type KeystoreShareRes ¶
type KeystoreShareRes struct { Payload `json:"readable"` Raw string `json:"raw"` } `json:"payload"` }Readable *
KeystoreShareRes keystore分片返回的最终结果
func KeystoreShareV2 ¶
func KeystoreShareV2(validatorPublicKey, version, ssvAmount string, skBytes []byte, operators []*Operator) (*KeystoreShareRes, error)
KeystoreShareV2 keystore 分片结果
type Operator ¶
type Operator struct { Id int `json:"id"` PublicKey string `json:"publicKey"` Fee uint64 `json:"-"` }
Operator ssv operator 信息