what-the-bank/sources/org/bouncycastle/asn1/x509/AccessDescription.java

65 lines
2.3 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.x509;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
/* loaded from: classes6.dex */
public class AccessDescription extends ASN1Object {
public static final ASN1ObjectIdentifier id_ad_caIssuers = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.48.2");
public static final ASN1ObjectIdentifier id_ad_ocsp = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.48.1");
GeneralName accessLocation;
ASN1ObjectIdentifier accessMethod;
public String toString() {
StringBuilder sb = new StringBuilder("AccessDescription: Oid(");
sb.append(this.accessMethod.getId());
sb.append(")");
return sb.toString();
}
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.accessMethod);
aSN1EncodableVector.add(this.accessLocation);
return new DERSequence(aSN1EncodableVector);
}
public ASN1ObjectIdentifier getAccessMethod() {
return this.accessMethod;
}
public GeneralName getAccessLocation() {
return this.accessLocation;
}
public static AccessDescription getInstance(Object obj) {
if (obj instanceof AccessDescription) {
return (AccessDescription) obj;
}
if (obj != null) {
return new AccessDescription(ASN1Sequence.getInstance(obj));
}
return null;
}
private AccessDescription(ASN1Sequence aSN1Sequence) {
this.accessMethod = null;
this.accessLocation = null;
if (aSN1Sequence.size() != 2) {
throw new IllegalArgumentException("wrong number of elements in sequence");
}
this.accessMethod = ASN1ObjectIdentifier.getInstance(aSN1Sequence.getObjectAt(0));
this.accessLocation = GeneralName.getInstance(aSN1Sequence.getObjectAt(1));
}
public AccessDescription(ASN1ObjectIdentifier aSN1ObjectIdentifier, GeneralName generalName) {
this.accessMethod = aSN1ObjectIdentifier;
this.accessLocation = generalName;
}
}