欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

适配ofd签章SES_CertList

发布时间:2023/12/20 51 豆豆
生活随笔 收集整理的这篇文章主要介绍了 适配ofd签章SES_CertList 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
import org.bouncycastle.asn1.*;import java.io.IOException;/*** 签章者证书信息列表** @author 权观宇* @since 2020-04-19 17:19:36*/ public class SES_CertList extends ASN1Objectimplements ASN1Choice {/*** 签章者证书列表*/private final CertInfoList certs;/*** 签章者证书杂凑值列表*/private final CertDigestList certDigestList;public SES_CertList(CertInfoList certs) {this.certs = certs;this.certDigestList = null;}public SES_CertList(CertDigestList certDigestList) {this.certs = null;this.certDigestList = certDigestList;}public static SES_CertList getInstance(ASN1Integer type, Object obj) {if (obj instanceof SES_CertList) {return (SES_CertList) obj;}if (obj != null) {if (obj instanceof ASN1Encodable) {final int t = type.getValue().intValue();/*if (t == 1) {return new SES_CertList(CertInfoList.getInstance(obj));} else if (t == 2) {return new SES_CertList(CertDigestList.getInstance(obj));} else {throw new IllegalArgumentException("unknown type in getInstance(): " + obj.getClass().getName());}*/if (t == 2) {return new SES_CertList(CertDigestList.getInstance(obj));} else {return new SES_CertList(CertInfoList.getInstance(obj));}}if (obj instanceof byte[]) {try {return getInstance(type, ASN1Primitive.fromByteArray((byte[]) obj));} catch (IOException e) {throw new IllegalArgumentException("unknown encoding in getInstance()");}}throw new IllegalArgumentException("unknown object in getInstance(): " + obj.getClass().getName());}return null;}public ASN1Object get() {if (certs != null) {return certs;} else return certDigestList;}public CertInfoList getCerts() {return certs;}public CertDigestList getCertDigestList() {return certDigestList;}@Overridepublic ASN1Primitive toASN1Primitive() {return get().toASN1Primitive();} }

总结

以上是生活随笔为你收集整理的适配ofd签章SES_CertList的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。