diff options
author | Sergio Giro <sgiro@google.com> | 2016-02-01 18:54:35 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-02-01 18:54:35 +0000 |
commit | 3e75bd6b407dd472c834a50f16aae54cca67ea9c (patch) | |
tree | b5eb091b97b2aade28e5b45a15352125a4a776d7 /bcprov/src/main/java/org/bouncycastle/asn1/ess/OtherSigningCertificate.java | |
parent | 9218edabd1ef9852bc2f13115dcadc81b442dd6c (diff) | |
parent | c1040cb5656c3299f1c2d0fe0bd7c44b10466aaf (diff) | |
download | android_external_bouncycastle-3e75bd6b407dd472c834a50f16aae54cca67ea9c.tar.gz android_external_bouncycastle-3e75bd6b407dd472c834a50f16aae54cca67ea9c.tar.bz2 android_external_bouncycastle-3e75bd6b407dd472c834a50f16aae54cca67ea9c.zip |
Merge "Restoring the contents of aosp after"
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/asn1/ess/OtherSigningCertificate.java')
-rw-r--r-- | bcprov/src/main/java/org/bouncycastle/asn1/ess/OtherSigningCertificate.java | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/ess/OtherSigningCertificate.java b/bcprov/src/main/java/org/bouncycastle/asn1/ess/OtherSigningCertificate.java deleted file mode 100644 index 41f9e93..0000000 --- a/bcprov/src/main/java/org/bouncycastle/asn1/ess/OtherSigningCertificate.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.bouncycastle.asn1.ess; - -import org.bouncycastle.asn1.ASN1EncodableVector; -import org.bouncycastle.asn1.ASN1Object; -import org.bouncycastle.asn1.ASN1Primitive; -import org.bouncycastle.asn1.ASN1Sequence; -import org.bouncycastle.asn1.DERSequence; -import org.bouncycastle.asn1.x509.PolicyInformation; - -public class OtherSigningCertificate - extends ASN1Object -{ - ASN1Sequence certs; - ASN1Sequence policies; - - public static OtherSigningCertificate getInstance(Object o) - { - if (o instanceof OtherSigningCertificate) - { - return (OtherSigningCertificate) o; - } - else if (o != null) - { - return new OtherSigningCertificate(ASN1Sequence.getInstance(o)); - } - - return null; - } - - /** - * constructeurs - */ - private OtherSigningCertificate(ASN1Sequence seq) - { - if (seq.size() < 1 || seq.size() > 2) - { - throw new IllegalArgumentException("Bad sequence size: " - + seq.size()); - } - - this.certs = ASN1Sequence.getInstance(seq.getObjectAt(0)); - - if (seq.size() > 1) - { - this.policies = ASN1Sequence.getInstance(seq.getObjectAt(1)); - } - } - - public OtherSigningCertificate( - OtherCertID otherCertID) - { - certs = new DERSequence(otherCertID); - } - - public OtherCertID[] getCerts() - { - OtherCertID[] cs = new OtherCertID[certs.size()]; - - for (int i = 0; i != certs.size(); i++) - { - cs[i] = OtherCertID.getInstance(certs.getObjectAt(i)); - } - - return cs; - } - - public PolicyInformation[] getPolicies() - { - if (policies == null) - { - return null; - } - - PolicyInformation[] ps = new PolicyInformation[policies.size()]; - - for (int i = 0; i != policies.size(); i++) - { - ps[i] = PolicyInformation.getInstance(policies.getObjectAt(i)); - } - - return ps; - } - - /** - * The definition of OtherSigningCertificate is - * <pre> - * OtherSigningCertificate ::= SEQUENCE { - * certs SEQUENCE OF OtherCertID, - * policies SEQUENCE OF PolicyInformation OPTIONAL - * } - * </pre> - * id-aa-ets-otherSigCert OBJECT IDENTIFIER ::= { iso(1) - * member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) - * smime(16) id-aa(2) 19 } - */ - public ASN1Primitive toASN1Primitive() - { - ASN1EncodableVector v = new ASN1EncodableVector(); - - v.add(certs); - - if (policies != null) - { - v.add(policies); - } - - return new DERSequence(v); - } -} |