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 AuthorityInformationAccess extends ASN1Object { private AccessDescription[] descriptions; public String toString() { StringBuilder sb = new StringBuilder("AuthorityInformationAccess: Oid("); sb.append(this.descriptions[0].getAccessMethod().getId()); sb.append(")"); return sb.toString(); } @Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable public ASN1Primitive toASN1Primitive() { ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector(); int i = 0; while (true) { AccessDescription[] accessDescriptionArr = this.descriptions; if (i == accessDescriptionArr.length) { return new DERSequence(aSN1EncodableVector); } aSN1EncodableVector.add(accessDescriptionArr[i]); i++; } } public AccessDescription[] getAccessDescriptions() { return this.descriptions; } public static AuthorityInformationAccess getInstance(Object obj) { if (obj instanceof AuthorityInformationAccess) { return (AuthorityInformationAccess) obj; } if (obj != null) { return new AuthorityInformationAccess(ASN1Sequence.getInstance(obj)); } return null; } public static AuthorityInformationAccess fromExtensions(Extensions extensions) { return getInstance(extensions.getExtensionParsedValue(Extension.authorityInfoAccess)); } public AuthorityInformationAccess(AccessDescription[] accessDescriptionArr) { AccessDescription[] accessDescriptionArr2 = new AccessDescription[accessDescriptionArr.length]; this.descriptions = accessDescriptionArr2; System.arraycopy(accessDescriptionArr, 0, accessDescriptionArr2, 0, accessDescriptionArr.length); } public AuthorityInformationAccess(AccessDescription accessDescription) { this(new AccessDescription[]{accessDescription}); } private AuthorityInformationAccess(ASN1Sequence aSN1Sequence) { if (aSN1Sequence.size() <= 0) { throw new IllegalArgumentException("sequence may not be empty"); } this.descriptions = new AccessDescription[aSN1Sequence.size()]; for (int i = 0; i != aSN1Sequence.size(); i++) { this.descriptions[i] = AccessDescription.getInstance(aSN1Sequence.getObjectAt(i)); } } public AuthorityInformationAccess(ASN1ObjectIdentifier aSN1ObjectIdentifier, GeneralName generalName) { this(new AccessDescription(aSN1ObjectIdentifier, generalName)); } }