本文整理汇总了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);
}