本文整理汇总了C#中net.getSignature方法的典型用法代码示例。如果您正苦于以下问题:C# net.getSignature方法的具体用法?C# net.getSignature怎么用?C# net.getSignature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net
的用法示例。
在下文中一共展示了net.getSignature方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: verifySignature
/// <summary>
/// Check the type of signature and use the publicKeyDer to verify the
/// signedBlob using the appropriate signature algorithm.
/// </summary>
///
/// <param name="signature"></param>
/// <param name="signedBlob">the SignedBlob with the signed portion to verify.</param>
/// <param name="publicKeyDer"></param>
/// <returns>True if the signature is verified, false if failed.</returns>
/// <exception cref="System.Security.SecurityException">if the signature type is not recognized or ifpublicKeyDer can't be decoded.</exception>
protected internal static bool verifySignature(
net.named_data.jndn.Signature signature, SignedBlob signedBlob,
Blob publicKeyDer)
{
if (signature is Sha256WithRsaSignature) {
if (publicKeyDer.isNull())
return false;
return verifySha256WithRsaSignature(signature.getSignature(),
signedBlob, publicKeyDer);
} else if (signature is Sha256WithEcdsaSignature) {
if (publicKeyDer.isNull())
return false;
return verifySha256WithEcdsaSignature(signature.getSignature(),
signedBlob, publicKeyDer);
} else if (signature is DigestSha256Signature)
return verifyDigestSha256Signature(signature.getSignature(),
signedBlob);
else
// We don't expect this to happen.
throw new SecurityException(
"PolicyManager.verify: Signature type is unknown");
}