本文整理匯總了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());
}
示例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);
}