mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-08-30 12:12:40 +08:00
This commit is contained in:
@@ -32,6 +32,7 @@ type digitalVerifyResult struct {
|
||||
DataHashOK bool
|
||||
SignedOK bool
|
||||
CertOK bool
|
||||
CertInfo SignatureCertInfo
|
||||
}
|
||||
|
||||
// gbtSignedData GB/T 35275 SignedData结构
|
||||
@@ -86,6 +87,7 @@ func verifyRawDigitalSignature(signedValue, signedData []byte, options *signatur
|
||||
continue
|
||||
}
|
||||
result.CertOK = true
|
||||
result.CertInfo = signatureCertInfo(cert)
|
||||
if sm2VerifySignature(pub, nil, signedData, signedValue) {
|
||||
result.SignedOK = true
|
||||
return result, nil
|
||||
@@ -136,6 +138,7 @@ func verifyGBT35275SignedData(signedValue, signedData []byte, options *signature
|
||||
if cert == nil {
|
||||
return result, nil
|
||||
}
|
||||
result.CertInfo = signatureCertInfo(cert.Raw)
|
||||
if !isSM2SignatureMethod(signer.SignatureAlg) {
|
||||
return nil, fmt.Errorf("unsupported signature method")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user