org.bouncycastle.asn1.ASN1Integer.fromByteArray()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中org.bouncycastle.asn1.ASN1Integer.fromByteArray()方法的一些代码示例,展示了ASN1Integer.fromByteArray()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ASN1Integer.fromByteArray()方法的具体详情如下:
包路径:org.bouncycastle.asn1.ASN1Integer
类名称:ASN1Integer
方法名:fromByteArray

ASN1Integer.fromByteArray介绍

暂无

代码示例

代码示例来源:origin: redfish64/TinyTravelTracker

/**
 * return an integer from the passed in object
 *
 * @param obj an ASN1Integer or an object that can be converted into one.
 * @throws IllegalArgumentException if the object cannot be converted.
 * @return an ASN1Integer instance.
 */
public static ASN1Integer getInstance(
  Object obj)
{
  if (obj == null || obj instanceof ASN1Integer)
  {
    return (ASN1Integer)obj;
  }
  if (obj instanceof byte[])
  {
    try
    {
      return (ASN1Integer)fromByteArray((byte[])obj);
    }
    catch (Exception e)
    {
      throw new IllegalArgumentException("encoding error in getInstance: " + e.toString());
    }
  }
  throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

/**
 * Return an integer from the passed in object.
 *
 * @param obj an ASN1Integer or an object that can be converted into one.
 * @return an ASN1Integer instance.
 * @throws IllegalArgumentException if the object cannot be converted.
 */
public static ASN1Integer getInstance(
  Object obj)
{
  if (obj == null || obj instanceof ASN1Integer)
  {
    return (ASN1Integer)obj;
  }
  if (obj instanceof byte[])
  {
    try
    {
      return (ASN1Integer)fromByteArray((byte[])obj);
    }
    catch (Exception e)
    {
      throw new IllegalArgumentException("encoding error in getInstance: " + e.toString());
    }
  }
  throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
}

相关文章