Documentation ¶
Index ¶
- Constants
- func Decrypt(pri *ecdsa.PrivateKey, cipherText string) (string, error)
- func PEM2PrivateKey(pemData []byte) (*ecdsa.PrivateKey, error)
- func Sign(private *ecdsa.PrivateKey, message string) (string, error)
- func Verify(public *ecdsa.PublicKey, message, signature string) bool
- type CallbackService
- type CallbackServiceConfig
- type Check
- type ExtraInfo
- type RequestDetail
- type Response
- type ResponseData
Constants ¶
View Source
const ( Approve = "APPROVE" Reject = "REJECT" Wait = "WAIT" )
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
func Decrypt(pri *ecdsa.PrivateKey, cipherText string) (string, error)
Decrypt decrypts an ECIES ciphertext.
func PEM2PrivateKey ¶
func PEM2PrivateKey(pemData []byte) (*ecdsa.PrivateKey, error)
Types ¶
type CallbackService ¶
type CallbackService struct { PrivateKey *ecdsa.PrivateKey PublicKey *ecdsa.PublicKey DecryptSigKey *ecdsa.PrivateKey MPCNodePublicKey *ecdsa.PublicKey RandomReject bool // contains filtered or unexported fields }
func NewCallBackService ¶
func NewCallBackService(cfg *CallbackServiceConfig) (*CallbackService, error)
func (*CallbackService) Check ¶
func (c *CallbackService) Check(g *gin.Context)
func (*CallbackService) RawDataSignature ¶
func (c *CallbackService) RawDataSignature(g *gin.Context)
func (*CallbackService) Start ¶
func (c *CallbackService) Start() error
func (*CallbackService) Stop ¶
func (c *CallbackService) Stop() error
type CallbackServiceConfig ¶
type Check ¶
type Check struct { CallbackId string `json:"callback_id,omitempty"` // 由mpc-node生成,每次请求callback server时生成一个新的 RequestType string `json:"request_type,omitempty"` RequestDetail `json:"request_detail,omitempty"` ExtraInfo `json:"extra_info,omitempty"` }
type RequestDetail ¶
type RequestDetail struct { T int `json:"t,omitempty"` N int `json:"n,omitempty"` Cryptography string `json:"cryptography,omitempty"` PartyIds []string `json:"party_ids,omitempty"` SignType string `json:"sign_type,omitempty" form:"sign_type"` PublicKey string `json:"public_key,omitempty"` Path string `json:"path,omitempty"` Message string `json:"message,omitempty"` Signature string `json:"signature,omitempty"` TxInfo json.RawMessage `json:"tx_info,omitempty" form:"tx_info"` }
Click to show internal directories.
Click to hide internal directories.