Tpm2Lib.Tpm2.VerifySignature C# (CSharp) Method

VerifySignature() private method

private VerifySignature ( TpmHandle keyHandle, byte digest, ISignatureUnion signature ) : TkVerified
keyHandle TpmHandle
digest byte
signature ISignatureUnion
return TkVerified
        public TkVerified VerifySignature(
            TpmHandle keyHandle,
            byte[] digest,
            ISignatureUnion signature
        )
        {
            Tpm2VerifySignatureRequest inS = new Tpm2VerifySignatureRequest();
            inS.keyHandle = keyHandle;
            inS.digest = digest;
            inS.signature = signature;
            TpmStructureBase outSBase;
            DispatchMethod(TpmCc.VerifySignature, (TpmStructureBase) inS, typeof(Tpm2VerifySignatureResponse), out outSBase, 1, 0);
            Tpm2VerifySignatureResponse outS = (Tpm2VerifySignatureResponse) outSBase;
            return outS.validation;
        }
        /// <summary>

Usage Example

Exemplo n.º 1
0
        TkVerified SignApproval(Tpm2 tpm, byte[] approvedPolicy, byte[] policyRef,
                                TpmHandle hSigKey, ISigSchemeUnion scheme = null)
        {
            byte[]    name, qname;
            TpmPublic pub = tpm.ReadPublic(hSigKey, out name, out qname);

            byte[] dataToSign = Globs.Concatenate(approvedPolicy, policyRef);
            byte[] aHash      = CryptoLib.HashData(pub.nameAlg, dataToSign);

            // Create an authorization certificate for the "approvedPolicy"
            var sig = tpm.Sign(hSigKey, aHash, scheme, new TkHashcheck());

            return(tpm.VerifySignature(hSigKey, aHash, sig));
        }
All Usage Examples Of Tpm2Lib.Tpm2::VerifySignature
Tpm2