use of com.github.zhenwei.core.asn1.ASN1Primitive in project signer by demoiselle.
the class PolicyFactory method loadLPA.
/**
* @return LPA ICP Brasil signature policy v1
* @deprecated Politics DISCONTINUED
*/
@Deprecated
public LPA loadLPA() {
org.demoiselle.signer.policy.engine.asn1.icpb.LPA listaPoliticaAssinatura = new org.demoiselle.signer.policy.engine.asn1.icpb.LPA();
InputStream is = this.getClass().getResourceAsStream(ListOfSubscriptionPolicies.LPAV1.getFile());
ASN1Primitive primitive = this.readANS1FromStream(is);
listaPoliticaAssinatura.parse(primitive);
return listaPoliticaAssinatura;
}
use of com.github.zhenwei.core.asn1.ASN1Primitive in project signer by demoiselle.
the class PolicyFactory method loadLPAv2.
/**
* @return LPA ICP Brasil signature policy v2
* @deprecated Politics DISCONTINUED 28/11/2016
*/
@Deprecated
public org.demoiselle.signer.policy.engine.asn1.icpb.v2.LPA loadLPAv2() {
org.demoiselle.signer.policy.engine.asn1.icpb.v2.LPA listaPoliticaAssinatura = new org.demoiselle.signer.policy.engine.asn1.icpb.v2.LPA();
InputStream is = this.getClass().getResourceAsStream(ListOfSubscriptionPolicies.LPAV2.getFile());
ASN1Primitive primitive = this.readANS1FromStream(is);
listaPoliticaAssinatura.parse(primitive);
return listaPoliticaAssinatura;
}
use of com.github.zhenwei.core.asn1.ASN1Primitive 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 com.github.zhenwei.core.asn1.ASN1Primitive 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;
}
}
}
}
}
use of com.github.zhenwei.core.asn1.ASN1Primitive in project signer by demoiselle.
the class SelectedCommitmentTypes method parse.
@Override
public void parse(ASN1Primitive derObject) {
ASN1Sequence derSequence = ASN1Object.getDERSequence(derObject);
ASN1Primitive object = derSequence.getObjectAt(0).toASN1Primitive();
if (object instanceof DERNull) {
this.recognizedCommitmentType = null;
} else if (object instanceof DERSequence) {
this.recognizedCommitmentType = new CommitmentType();
this.recognizedCommitmentType.parse(object);
}
}
Aggregations