當前位置: 首頁>>代碼示例>>C#>>正文


C# ECCurve.DecodePoint方法代碼示例

本文整理匯總了C#中Org.BouncyCastle.Math.EC.ECCurve.DecodePoint方法的典型用法代碼示例。如果您正苦於以下問題:C# ECCurve.DecodePoint方法的具體用法?C# ECCurve.DecodePoint怎麽用?C# ECCurve.DecodePoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Org.BouncyCastle.Math.EC.ECCurve的用法示例。


在下文中一共展示了ECCurve.DecodePoint方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: X9ECPoint

		public X9ECPoint(
            ECCurve			c,
            Asn1OctetString	s)
        {
            this.p = c.DecodePoint(s.GetOctets());
        }
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:6,代碼來源:X9ECPoint.cs

示例2: DeserializeECPoint

        public static ECPoint DeserializeECPoint(byte[] ecPointFormats, ECCurve curve, byte[] encoding)
        {
            if (encoding == null || encoding.Length < 1)
                throw new TlsFatalAlert(AlertDescription.illegal_parameter);

            byte actualFormat;
            switch (encoding[0])
            {
            case 0x02: // compressed
            case 0x03: // compressed
            {
                if (ECAlgorithms.IsF2mCurve(curve))
                {
                    actualFormat = ECPointFormat.ansiX962_compressed_char2;
                }
                else if (ECAlgorithms.IsFpCurve(curve))
                {
                    actualFormat = ECPointFormat.ansiX962_compressed_prime;
                }
                else
                {
                    throw new TlsFatalAlert(AlertDescription.illegal_parameter);
                }
                break;
            }
            case 0x04: // uncompressed
            {
                actualFormat = ECPointFormat.uncompressed;
                break;
            }
            case 0x00: // infinity
            case 0x06: // hybrid
            case 0x07: // hybrid
            default:
                throw new TlsFatalAlert(AlertDescription.illegal_parameter);
            }

            if (actualFormat != ECPointFormat.uncompressed
                && (ecPointFormats == null || !Arrays.Contains(ecPointFormats, actualFormat)))
            {
                throw new TlsFatalAlert(AlertDescription.illegal_parameter);
            }

            return curve.DecodePoint(encoding);
        }
開發者ID:ALange,項目名稱:OutlookPrivacyPlugin,代碼行數:45,代碼來源:TlsEccUtilities.cs


注:本文中的Org.BouncyCastle.Math.EC.ECCurve.DecodePoint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。