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


C# HashAlgorithm.GetType方法代码示例

本文整理汇总了C#中HashAlgorithm.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# HashAlgorithm.GetType方法的具体用法?C# HashAlgorithm.GetType怎么用?C# HashAlgorithm.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HashAlgorithm的用法示例。


在下文中一共展示了HashAlgorithm.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LogVerifySignedInfo

        /// <summary>
        ///     Log the verification parameters when verifying the SignedInfo section of a signature using an
        ///     asymmetric key
        /// </summary>
        /// <param name="signedXml">SignedXml object doing the verification</param>
        /// <param name="key">key being used to verify the signed info</param>
        /// <param name="signatureDescription">type of signature description class used</param>
        /// <param name="hashAlgorithm">type of hash algorithm used</param>
        /// <param name="asymmetricSignatureDeformatter">type of signature deformatter used</param>
        /// <param name="actualHashValue">hash value of the signed info</param>
        /// <param name="signatureValue">raw signature value</param>
        internal static void LogVerifySignedInfo(SignedXml signedXml,
                                                 AsymmetricAlgorithm key,
                                                 SignatureDescription signatureDescription,
                                                 HashAlgorithm hashAlgorithm,
                                                 AsymmetricSignatureDeformatter asymmetricSignatureDeformatter,
                                                 byte[] actualHashValue,
                                                 byte[] signatureValue) {
            Debug.Assert(signedXml != null, "signedXml != null");
            Debug.Assert(signatureDescription != null, "signatureDescription != null");
            Debug.Assert(hashAlgorithm != null, "hashAlgorithm != null");
            Debug.Assert(asymmetricSignatureDeformatter != null, "asymmetricSignatureDeformatter != null");

            if (InformationLoggingEnabled) {
                string logMessage = String.Format(CultureInfo.InvariantCulture,
                                                  SecurityResources.GetResourceString("Log_VerifySignedInfoAsymmetric"),
                                                  GetKeyName(key),
                                                  signatureDescription.GetType().Name,
                                                  hashAlgorithm.GetType().Name,
                                                  asymmetricSignatureDeformatter.GetType().Name);
                WriteLine(signedXml,
                          TraceEventType.Information,
                          SignedXmlDebugEvent.VerifySignedInfo,
                          logMessage);
            }

            if (VerboseLoggingEnabled) {
                string hashLog = String.Format(CultureInfo.InvariantCulture,
                                               SecurityResources.GetResourceString("Log_ActualHashValue"),
                                               FormatBytes(actualHashValue));
                WriteLine(signedXml, TraceEventType.Verbose, SignedXmlDebugEvent.VerifySignedInfo, hashLog);

                string signatureLog = String.Format(CultureInfo.InvariantCulture,
                                                    SecurityResources.GetResourceString("Log_RawSignatureValue"),
                                                    FormatBytes(signatureValue));
                WriteLine(signedXml, TraceEventType.Verbose, SignedXmlDebugEvent.VerifySignedInfo, signatureLog);
            }
        }
开发者ID:mind0n,项目名称:hive,代码行数:48,代码来源:SignedXmlDebugLog.cs

示例2: method_16

		private Class1.Class13.Enum1 method_16(HashAlgorithm hashAlgorithm_0)
		{
			Type type = hashAlgorithm_0.GetType();
			if (object.ReferenceEquals(type, typeof(MD5CryptoServiceProvider)))
			{
				return (Class1.Class13.Enum1)5;
			}
			if (!object.ReferenceEquals(type, typeof(SHA1CryptoServiceProvider)))
			{
				throw new ArgumentException("unknown HashAlgorithm");
			}
			return (Class1.Class13.Enum1)1;
		}
开发者ID:akordowski,项目名称:Source-Code-Nitriq,代码行数:13,代码来源:Class1.cs

示例3: LogSigning

        /// <summary>
        ///     Log the computation of a signature value when signing with an asymmetric algorithm
        /// </summary>
        /// <param name="signedXml">SignedXml object calculating the signature</param>
        /// <param name="key">key used for signing</param>
        /// <param name="signatureDescription">signature description being used to create the signature</param>
        /// <param name="hash">hash algorithm used to digest the output</param>
        /// <param name="asymmetricSignatureFormatter">signature formatter used to do the signing</param>
        internal static void LogSigning(SignedXml signedXml,
                                        object key,
                                        SignatureDescription signatureDescription,
                                        HashAlgorithm hash,
                                        AsymmetricSignatureFormatter asymmetricSignatureFormatter) {
            Debug.Assert(signedXml != null, "signedXml != null");
            Debug.Assert(signatureDescription != null, "signatureDescription != null");
            Debug.Assert(hash != null, "hash != null");
            Debug.Assert(asymmetricSignatureFormatter != null, "asymmetricSignatureFormatter != null");

            if (InformationLoggingEnabled) {
                string logMessage = String.Format(CultureInfo.InvariantCulture,
                                                  SecurityResources.GetResourceString("Log_SigningAsymmetric"),
                                                  GetKeyName(key),
                                                  signatureDescription.GetType().Name,
                                                  hash.GetType().Name,
                                                  asymmetricSignatureFormatter.GetType().Name);

                WriteLine(signedXml,
                          TraceEventType.Information,
                          SignedXmlDebugEvent.Signing,
                          logMessage);
            }
        }
开发者ID:mind0n,项目名称:hive,代码行数:32,代码来源:SignedXmlDebugLog.cs


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