MCPcopy Create free account
hub / github.com/chanify/chanify / verifySign

Function verifySign

core/utils.go:61–71  ·  view source on GitHub ↗
(key string, sign []byte, data []byte)

Source from the content-addressed store, hash-verified

59}
60
61func verifySign(key string, sign []byte, data []byte) bool {
62 kd, err := crypto.Base64Encode.DecodeString(key)
63 if err != nil {
64 return false
65 }
66 pk, err := crypto.LoadPublicKey(kd)
67 if err != nil {
68 return false
69 }
70 return pk.Verify(data, sign)
71}
72
73func (c *Core) parseToken(token string) (*model.Token, error) {
74 tk, err := model.ParseToken(token)

Callers 3

TestVerifyFunction · 0.85
verifyUserFunction · 0.85
verifyDeviceFunction · 0.85

Calls 2

LoadPublicKeyFunction · 0.92
VerifyMethod · 0.80

Tested by 1

TestVerifyFunction · 0.68