what-the-bank/sources/org/bouncycastle/asn1/pkcs/CertBag.java

53 lines
1.7 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.pkcs;
import org.bouncycastle.asn1.ASN1Encodable;
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;
import org.bouncycastle.asn1.DERTaggedObject;
/* loaded from: classes6.dex */
public class CertBag extends ASN1Object {
private ASN1ObjectIdentifier certId;
private ASN1Encodable certValue;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.certId);
aSN1EncodableVector.add(new DERTaggedObject(0, this.certValue));
return new DERSequence(aSN1EncodableVector);
}
public ASN1Encodable getCertValue() {
return this.certValue;
}
public ASN1ObjectIdentifier getCertId() {
return this.certId;
}
public static CertBag getInstance(Object obj) {
if (obj instanceof CertBag) {
return (CertBag) obj;
}
if (obj != null) {
return new CertBag(ASN1Sequence.getInstance(obj));
}
return null;
}
private CertBag(ASN1Sequence aSN1Sequence) {
this.certId = (ASN1ObjectIdentifier) aSN1Sequence.getObjectAt(0);
this.certValue = ((DERTaggedObject) aSN1Sequence.getObjectAt(1)).getObject();
}
public CertBag(ASN1ObjectIdentifier aSN1ObjectIdentifier, ASN1Encodable aSN1Encodable) {
this.certId = aSN1ObjectIdentifier;
this.certValue = aSN1Encodable;
}
}