当前位置: 首页>>代码示例>>C#>>正文


C# net.getSignature方法代码示例

本文整理汇总了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");
        }
开发者ID:named-data,项目名称:ndn-dot-net,代码行数:32,代码来源:PolicyManager.cs


注:本文中的net.getSignature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。