use of org.openecard.bouncycastle.asn1.ASN1Sequence in project signer by demoiselle.
the class SignerRules method parse.
@Override
public void parse(ASN1Primitive primitive) {
ASN1Sequence derSequence = ASN1Object.getDERSequence(primitive);
int total = derSequence.size();
if (total > 0) {
for (int i = 0; i < total; i++) {
ASN1Primitive object = derSequence.getObjectAt(i).toASN1Primitive();
if (object instanceof DERTaggedObject) {
DERTaggedObject derTaggedObject = (DERTaggedObject) object;
TAG tag = TAG.getTag(derTaggedObject.getTagNo());
switch(tag) {
case mandatedCertificateRef:
this.mandatedCertificateRef = CertRefReq.parse(object);
break;
case mandatedCertificateInfo:
this.mandatedCertificateInfo = CertInfoReq.parse(object);
break;
case signPolExtensions:
this.signPolExtensions = new SignPolExtensions();
this.signPolExtensions.parse(object);
break;
default:
break;
}
}
}
}
int i = 0;
ASN1Encodable object = derSequence.getObjectAt(i);
if (!(object instanceof DERSequence)) {
if (object instanceof ASN1Boolean) {
this.externalSignedData = ((ASN1Boolean) object).isTrue();
}
i++;
}
this.mandatedSignedAttr = new CMSAttrs();
this.mandatedSignedAttr.parse(derSequence.getObjectAt(i).toASN1Primitive());
i++;
this.mandatedUnsignedAttr = new CMSAttrs();
this.mandatedUnsignedAttr.parse(derSequence.getObjectAt(i).toASN1Primitive());
}
use of org.openecard.bouncycastle.asn1.ASN1Sequence in project signer by demoiselle.
the class SigningPeriod method parse.
@Override
public void parse(ASN1Primitive derObject) {
ASN1Sequence derSequence = ASN1Object.getDERSequence(derObject);
this.notBefore = new GeneralizedTime();
this.notBefore.parse(derSequence.getObjectAt(0).toASN1Primitive());
if (derSequence.size() == 2) {
this.notAfter = new GeneralizedTime();
this.notAfter.parse(derSequence.getObjectAt(1).toASN1Primitive());
}
}
use of org.openecard.bouncycastle.asn1.ASN1Sequence in project signer by demoiselle.
the class LPA method parse.
@Override
public void parse(ASN1Primitive derObject) {
ASN1Sequence sequence = ASN1Object.getDERSequence(derObject);
ASN1Primitive policyInfos = sequence.getObjectAt(0).toASN1Primitive();
DLSequence policyInfosSequence = (DLSequence) policyInfos;
if (policyInfosSequence != null && policyInfosSequence.size() > 0) {
this.policyInfos = new ArrayList<>();
for (int i = 0; i < policyInfosSequence.size(); i++) {
PolicyInfo policyInfo = new PolicyInfo();
policyInfo.parse(policyInfosSequence.getObjectAt(i).toASN1Primitive());
this.policyInfos.add(policyInfo);
}
}
this.nextUpdate = new Time();
this.nextUpdate.parse(sequence.getObjectAt(1).toASN1Primitive());
}
use of org.openecard.bouncycastle.asn1.ASN1Sequence in project signer by demoiselle.
the class SigningCertTrustCondition method parse.
@Override
public void parse(ASN1Primitive derObject) {
ASN1Sequence derSequence = ASN1Object.getDERSequence(derObject);
this.signerTrustTrees = new CertificateTrustTrees();
this.signerTrustTrees.parse(derSequence.getObjectAt(0).toASN1Primitive());
this.signerRevReq = new CertRevReq();
this.signerRevReq.parse(derSequence.getObjectAt(1).toASN1Primitive());
}
use of org.openecard.bouncycastle.asn1.ASN1Sequence in project signer by demoiselle.
the class PolicyConstraints method parse.
@Override
public void parse(ASN1Primitive derObject) {
ASN1Sequence derSequence = ASN1Object.getDERSequence(derObject);
int total = derSequence.size();
if (total > 0) {
for (int i = 0; i < total; i++) {
ASN1Primitive object = derSequence.getObjectAt(i).toASN1Primitive();
if (object instanceof DERTaggedObject) {
DERTaggedObject derTaggedObject = (DERTaggedObject) object;
TAG tag = TAG.getTag(derTaggedObject.getTagNo());
switch(tag) {
case requireExplicitPolicy:
this.requireExplicitPolicy = new SkipCerts();
this.requireExplicitPolicy.parse(object);
break;
case inhibitPolicyMapping:
this.inhibitPolicyMapping = new SkipCerts();
this.inhibitPolicyMapping.parse(object);
break;
default:
break;
}
}
}
}
}
Aggregations