what-the-bank/sources/org/bouncycastle/asn1/x9/OtherInfo.java

71 lines
2.5 KiB
Java

package org.bouncycastle.asn1.x9;
import java.util.Enumeration;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.DERTaggedObject;
/* loaded from: classes6.dex */
public class OtherInfo extends ASN1Object {
private KeySpecificInfo keyInfo;
private ASN1OctetString partyAInfo;
private ASN1OctetString suppPubInfo;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.keyInfo);
if (this.partyAInfo != null) {
aSN1EncodableVector.add(new DERTaggedObject(0, this.partyAInfo));
}
aSN1EncodableVector.add(new DERTaggedObject(2, this.suppPubInfo));
return new DERSequence(aSN1EncodableVector);
}
public ASN1OctetString getSuppPubInfo() {
return this.suppPubInfo;
}
public ASN1OctetString getPartyAInfo() {
return this.partyAInfo;
}
public KeySpecificInfo getKeyInfo() {
return this.keyInfo;
}
public static OtherInfo getInstance(Object obj) {
if (obj instanceof OtherInfo) {
return (OtherInfo) obj;
}
if (obj != null) {
return new OtherInfo(ASN1Sequence.getInstance(obj));
}
return null;
}
public OtherInfo(KeySpecificInfo keySpecificInfo, ASN1OctetString aSN1OctetString, ASN1OctetString aSN1OctetString2) {
this.keyInfo = keySpecificInfo;
this.partyAInfo = aSN1OctetString;
this.suppPubInfo = aSN1OctetString2;
}
private OtherInfo(ASN1Sequence aSN1Sequence) {
Enumeration objects = aSN1Sequence.getObjects();
this.keyInfo = KeySpecificInfo.getInstance(objects.nextElement());
while (objects.hasMoreElements()) {
ASN1TaggedObject aSN1TaggedObject = (ASN1TaggedObject) objects.nextElement();
if (aSN1TaggedObject.getTagNo() == 0) {
this.partyAInfo = (ASN1OctetString) aSN1TaggedObject.getObject();
} else if (aSN1TaggedObject.getTagNo() == 2) {
this.suppPubInfo = (ASN1OctetString) aSN1TaggedObject.getObject();
}
}
}
}