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

Method PublicKeyEncrypt

model/user.go:33–40  ·  view source on GitHub ↗

PublicKeyEncrypt return encrypted public key

(data []byte)

Source from the content-addressed store, hash-verified

31
32// PublicKeyEncrypt return encrypted public key
33func (u *User) PublicKeyEncrypt(data []byte) []byte {
34 pk, err := crypto.LoadPublicKey(u.PublicKey)
35 if err != nil {
36 return []byte{}
37 }
38 out, _ := pk.Encrypt(data) // nolint: errcheck
39 return out
40}

Callers 2

TestPublicKeyEncryptFunction · 0.95
handleBindUserMethod · 0.80

Calls 2

LoadPublicKeyFunction · 0.92
EncryptMethod · 0.80

Tested by 1

TestPublicKeyEncryptFunction · 0.76