{"record":{"id":"5aafc45ee33d4bf6","repo":"hyperledger/fabric","slug":"the-signature-is-invalid","errorCode":null,"errorMessage":"The signature is invalid","messagePattern":"The signature is invalid","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"msp/identities.go","lineNumber":202,"sourceCode":"\n\t\tdigestOrMsg, err = id.msp.bccsp.Hash(msg, hashOpt)\n\t\tif err != nil {\n\t\t\treturn errors.WithMessage(err, \"failed computing digest\")\n\t\t}\n\t}\n\n\tif mspIdentityLogger.IsEnabledFor(zapcore.DebugLevel) {\n\t\tmspIdentityLogger.Debugf(\"Verify: signer identity (certificate subject=%s issuer=%s serialnumber=%d)\", id.cert.Subject, id.cert.Issuer, id.cert.SerialNumber)\n\t\t// mspIdentityLogger.Debugf(\"Verify: digest = %s\", hex.Dump(digest))\n\t\t// mspIdentityLogger.Debugf(\"Verify: sig = %s\", hex.Dump(sig))\n\t}\n\n\tvalid, err := id.msp.bccsp.Verify(id.pk, sig, digestOrMsg, nil)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"could not determine the validity of the signature\")\n\t} else if !valid {\n\t\tmspIdentityLogger.Warnf(\"The signature is invalid for (certificate subject=%s issuer=%s serialnumber=%d)\", id.cert.Subject, id.cert.Issuer, id.cert.SerialNumber)\n\t\treturn errors.New(\"The signature is invalid\")\n\t}\n\n\treturn nil\n}\n\n// Serialize returns a byte array representation of this identity\nfunc (id *identity) Serialize() ([]byte, error) {\n\tpb := &pem.Block{Bytes: id.cert.Raw, Type: \"CERTIFICATE\"}\n\tpemBytes := pem.EncodeToMemory(pb)\n\tif pemBytes == nil {\n\t\treturn nil, errors.New(\"encoding of identity failed\")\n\t}\n\n\t// We serialize identities by prepending the MSPID and appending the ASN.1 DER content of the cert\n\tsId := &msp.SerializedIdentity{Mspid: id.id.Mspid, IdBytes: pemBytes}\n\tidBytes, err := proto.Marshal(sId)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"could not marshal a SerializedIdentity structure for identity %s\", id.id)","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/msp/identities.go#L184-L220","documentation":"identity.Verify: the BCCSP signature verification completed without transport error but returned valid=false, i.e., the signature over the message/digest does not match the identity's public key. The subject/issuer/serial of the offending cert are warned in logs.","triggerScenarios":"Thrown at msp/identities.go:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the message bytes and signature come from the same signer","Check the identity certificate matches the key used to sign","Reject the proposal/transaction and re-authenticate the client"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}