what-the-bank/sources/org/bouncycastle/asn1/x509/SubjectDirectoryAttributes....

53 lines
1.8 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.x509;
import java.util.Enumeration;
import java.util.Vector;
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;
/* loaded from: classes6.dex */
public class SubjectDirectoryAttributes extends ASN1Object {
private Vector attributes = new Vector();
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
Enumeration elements = this.attributes.elements();
while (elements.hasMoreElements()) {
aSN1EncodableVector.add((Attribute) elements.nextElement());
}
return new DERSequence(aSN1EncodableVector);
}
public Vector getAttributes() {
return this.attributes;
}
public static SubjectDirectoryAttributes getInstance(Object obj) {
if (obj instanceof SubjectDirectoryAttributes) {
return (SubjectDirectoryAttributes) obj;
}
if (obj != null) {
return new SubjectDirectoryAttributes(ASN1Sequence.getInstance(obj));
}
return null;
}
private SubjectDirectoryAttributes(ASN1Sequence aSN1Sequence) {
Enumeration objects = aSN1Sequence.getObjects();
while (objects.hasMoreElements()) {
this.attributes.addElement(Attribute.getInstance(ASN1Sequence.getInstance(objects.nextElement())));
}
}
public SubjectDirectoryAttributes(Vector vector) {
Enumeration elements = vector.elements();
while (elements.hasMoreElements()) {
this.attributes.addElement(elements.nextElement());
}
}
}