use of com.github.zhenwei.core.asn1.x509.AttributeCertificateInfo in project LinLong-Java by zhenwei1108.
the class V2AttributeCertificateInfoGenerator method generateAttributeCertificateInfo.
public AttributeCertificateInfo generateAttributeCertificateInfo() {
if ((serialNumber == null) || (signature == null) || (issuer == null) || (startDate == null) || (endDate == null) || (holder == null) || (attributes == null)) {
throw new IllegalStateException("not all mandatory fields set in V2 AttributeCertificateInfo generator");
}
ASN1EncodableVector v = new ASN1EncodableVector(9);
v.add(version);
v.add(holder);
v.add(issuer);
v.add(signature);
v.add(serialNumber);
//
// before and after dates => AttCertValidityPeriod
//
AttCertValidityPeriod validity = new AttCertValidityPeriod(startDate, endDate);
v.add(validity);
// Attributes
v.add(new DERSequence(attributes));
if (issuerUniqueID != null) {
v.add(issuerUniqueID);
}
if (extensions != null) {
v.add(extensions);
}
return AttributeCertificateInfo.getInstance(new DERSequence(v));
}
use of com.github.zhenwei.core.asn1.x509.AttributeCertificateInfo in project LinLong-Java by zhenwei1108.
the class CertUtils method generateAttrStructure.
private static AttributeCertificate generateAttrStructure(AttributeCertificateInfo attrInfo, AlgorithmIdentifier sigAlgId, byte[] signature) {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(attrInfo);
v.add(sigAlgId);
v.add(new DERBitString(signature));
return AttributeCertificate.getInstance(new DERSequence(v));
}
Aggregations