MCPcopy Create free account
hub / github.com/LanceLRQ/deer-executor / RSA2048Sign

Function RSA2048Sign

common/persistence/utils.go:62–68  ·  view source on GitHub ↗

RSA2048Sign 用RSA2048运算签名

(hash []byte, privateKey *rsa.PrivateKey)

Source from the content-addressed store, hash-verified

60
61// RSA2048Sign 用RSA2048运算签名
62func RSA2048Sign(hash []byte, privateKey *rsa.PrivateKey) ([]byte, error) {
63 sign, err := rsa.SignPKCS1v15(rand.Reader, privateKey, crypto.SHA256, hash)
64 if err != nil {
65 return nil, err
66 }
67 return sign, nil
68}
69
70// RSA2048VerifyString 用RSA2048运算校验文本签名
71func RSA2048VerifyString(body string, sign []byte, publicKey *rsa.PublicKey) error {

Callers 4

PersistentJudgeResultFunction · 0.92
PackProblemsAsZipFunction · 0.92
PackProblemsFunction · 0.92
RSA2048SignBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected