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


C# ECPoint.GetEncoded方法代碼示例

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


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

示例1: PublicKey

 public PublicKey(ECPoint point)
 {
     this.IsCompressedPoint = point.IsCompressed;
     this.point = point;
     this.PublicKeyBytes = point.GetEncoded();
     if (validatePoint() == false) throw new ArgumentException("Not a valid public key");
 }
開發者ID:Groestlcoin,項目名稱:Groestlcoin-Address-Utility,代碼行數:7,代碼來源:PublicKey.cs

示例2: ECPublicBcpgKey

 protected ECPublicBcpgKey(
     DerObjectIdentifier oid,
     ECPoint point)
 {
     this.point = new BigInteger(1, point.GetEncoded());
     this.oid = oid;
 }
開發者ID:ALange,項目名稱:OutlookPrivacyPlugin,代碼行數:7,代碼來源:ECPublicBCPGKey.cs

示例3: X9ECPoint

 public X9ECPoint(ECPoint p, bool compressed)
 {
     this.p = p.Normalize();
     this.encoding = new DerOctetString(p.GetEncoded(compressed));
 }
開發者ID:KimikoMuffin,項目名稱:bc-csharp,代碼行數:5,代碼來源:X9ECPoint.cs

示例4: ImplTestEncoding

        /**
         * Test encoding with and without point compression.
         *
         * @param p
         *            The point to be encoded and decoded.
         */
        private void ImplTestEncoding(ECPoint p)
        {
            // Not Point Compression
            byte[] unCompBarr = p.GetEncoded(false);
            ECPoint decUnComp = p.Curve.DecodePoint(unCompBarr);
            AssertPointsEqual("Error decoding uncompressed point", p, decUnComp);

            // Point compression
            byte[] compBarr = p.GetEncoded(true);
            ECPoint decComp = p.Curve.DecodePoint(compBarr);
            AssertPointsEqual("Error decoding compressed point", p, decComp);
        }
開發者ID:jesusgarza,項目名稱:bc-csharp,代碼行數:18,代碼來源:ECPointTest.cs

示例5: ExternalizeKey

		static byte[] ExternalizeKey (ECPoint q)
		{
			// TODO Add support for compressed encoding and SPF extension

			/*
			 * RFC 4492 5.7. ...an elliptic curve point in uncompressed or compressed format.
			 * Here, the format MUST conform to what the server has requested through a
			 * Supported Point Formats Extension if this extension was used, and MUST be
			 * uncompressed if this extension was not used.
			 */
			return q.GetEncoded ();
		}
開發者ID:VimalKumarS,項目名稱:mono-tls,代碼行數:12,代碼來源:EllipticCurveKeyExchange.cs

示例6: K256VerifyingKey

 public K256VerifyingKey(ECPoint pub)
 {
     PubKey = pub;
     PubKeyBytes = pub.GetEncoded(true);
     SetVerifier(pub);
 }
開發者ID:sublimator,項目名稱:ripple-dot-net,代碼行數:6,代碼來源:K256VerifyingKey.cs

示例7: SerializeECPoint

        public static byte[] SerializeECPoint(byte[] ecPointFormats, ECPoint point)
        {
            ECCurve curve = point.Curve;

            /*
             * RFC 4492 5.7. ...an elliptic curve point in uncompressed or compressed format. Here, the
             * format MUST conform to what the server has requested through a Supported Point Formats
             * Extension if this extension was used, and MUST be uncompressed if this extension was not
             * used.
             */
            bool compressed = false;
            if (ECAlgorithms.IsFpCurve(curve))
            {
                compressed = IsCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_prime);
            }
            else if (ECAlgorithms.IsF2mCurve(curve))
            {
                compressed = IsCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_char2);
            }
            return point.GetEncoded(compressed);
        }
開發者ID:ALange,項目名稱:OutlookPrivacyPlugin,代碼行數:21,代碼來源:TlsEccUtilities.cs


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