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

x33g5p2x  于2022-01-16 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(85)

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

ASN1GeneralizedTime.getEncoded介绍

暂无

代码示例

代码示例来源:origin: org.xipki/ca-server

private static Extension createInvalidityDateExtension(Date invalidityDate) {
 try {
  ASN1GeneralizedTime asnTime = new ASN1GeneralizedTime(invalidityDate);
  return new Extension(Extension.invalidityDate, false, asnTime.getEncoded());
 } catch (IOException ex) {
  throw new IllegalArgumentException("error encoding reason: " + ex.getMessage(), ex);
 }
}

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

private static ASN1Sequence createInvalidityDateExtension(ASN1GeneralizedTime invalidityDate)
  {
    ASN1EncodableVector v = new ASN1EncodableVector();

    try
    {
      v.add(Extension.invalidityDate);
      v.add(new DEROctetString(invalidityDate.getEncoded()));
    }
    catch (IOException e)
    {
      throw new IllegalArgumentException("error encoding reason: " + e);
    }

    return new DERSequence(v);
  }
}

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

private static ASN1Sequence createInvalidityDateExtension(ASN1GeneralizedTime invalidityDate)
  {
    ASN1EncodableVector v = new ASN1EncodableVector();

    try
    {
      v.add(Extension.invalidityDate);
      v.add(new DEROctetString(invalidityDate.getEncoded()));
    }
    catch (IOException e)
    {
      throw new IllegalArgumentException("error encoding reason: " + e);
    }

    return new DERSequence(v);
  }
}

代码示例来源:origin: org.xipki/cmpclient

ASN1GeneralizedTime time = new ASN1GeneralizedTime(invalidityDate);
extensions[1] = new Extension(Extension.invalidityDate, true,
    new DEROctetString(time.getEncoded()));

相关文章