use of org.openecard.bouncycastle.asn1.ASN1Sequence in project signer by demoiselle.
the class CertificateTrustPoint method parse.
@Override
public void parse(ASN1Primitive derObject) {
ASN1Sequence derSequence = ASN1Object.getDERSequence(derObject);
DERSequence x509Sequence = (DERSequence) derSequence.getObjectAt(0).toASN1Primitive();
try {
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(x509Sequence.getEncoded());
this.trustpoint = (X509Certificate) CertificateFactory.getInstance("X509").generateCertificate(byteArrayInputStream);
} catch (Throwable error) {
error.printStackTrace();
}
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 pathLenConstraint:
this.pathLenConstraint = new PathLenConstraint();
this.pathLenConstraint.parse(object);
break;
case acceptablePolicySet:
this.acceptablePolicySet = new AcceptablePolicySet();
this.acceptablePolicySet.parse(object);
break;
case nameConstraints:
this.nameConstraints = new NameConstraints();
this.nameConstraints.parse(object);
break;
case policyConstraints:
this.policyConstraints = new PolicyConstraints();
this.policyConstraints.parse(object);
break;
default:
break;
}
}
}
}
}
use of org.openecard.bouncycastle.asn1.ASN1Sequence in project signer by demoiselle.
the class CommitmentType method parse.
@Override
public void parse(ASN1Primitive derObject) {
ASN1Sequence derSequence = ASN1Object.getDERSequence(derObject);
this.identifier = new CommitmentTypeIdentifier();
this.identifier.parse(derSequence.getObjectAt(0).toASN1Primitive());
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 fieldOfApplication:
this.fieldOfApplication = new FieldOfApplication();
this.fieldOfApplication.parse(object);
break;
case semantics:
break;
default:
break;
}
}
}
}
}
use of org.openecard.bouncycastle.asn1.ASN1Sequence in project signer by demoiselle.
the class CommonRules 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 signerAndVeriferRules:
this.signerAndVeriferRules = new SignerAndVerifierRules();
this.signerAndVeriferRules.parse(object);
break;
case signingCertTrustCondition:
this.signingCertTrustCondition = new SigningCertTrustCondition();
this.signingCertTrustCondition.parse(object);
break;
case timeStampTrustCondition:
this.timeStampTrustCondition = new TimestampTrustCondition();
this.timeStampTrustCondition.parse(object);
break;
case attributeTrustCondition:
this.attributeTrustCondition = new AttributeTrustCondition();
this.attributeTrustCondition.parse(object);
break;
case algorithmConstraintSet:
this.algorithmConstraintSet = new AlgorithmConstraintSet();
this.algorithmConstraintSet.parse(object);
break;
case signPolExtensions:
this.signPolExtensions = new SignPolExtensions();
this.signPolExtensions.parse(object);
break;
default:
break;
}
}
}
}
}
use of org.openecard.bouncycastle.asn1.ASN1Sequence 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);
}
}
use of org.openecard.bouncycastle.asn1.ASN1Sequence in project signer by demoiselle.
the class SignerAndVerifierRules method parse.
@Override
public void parse(ASN1Primitive derObject) {
ASN1Sequence derSequence = ASN1Object.getDERSequence(derObject);
this.signerRules = new SignerRules();
this.signerRules.parse(derSequence.getObjectAt(0).toASN1Primitive());
this.verifierRules = new VerifierRules();
this.verifierRules.parse(derSequence.getObjectAt(1).toASN1Primitive());
}
Aggregations