what-the-bank/sources/org/bouncycastle/asn1/cmp/ProtectedPart.java

50 lines
1.5 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.cmp;
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 ProtectedPart extends ASN1Object {
private PKIBody body;
private PKIHeader header;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.header);
aSN1EncodableVector.add(this.body);
return new DERSequence(aSN1EncodableVector);
}
public PKIHeader getHeader() {
return this.header;
}
public PKIBody getBody() {
return this.body;
}
public static ProtectedPart getInstance(Object obj) {
if (obj instanceof ProtectedPart) {
return (ProtectedPart) obj;
}
if (obj != null) {
return new ProtectedPart(ASN1Sequence.getInstance(obj));
}
return null;
}
public ProtectedPart(PKIHeader pKIHeader, PKIBody pKIBody) {
this.header = pKIHeader;
this.body = pKIBody;
}
private ProtectedPart(ASN1Sequence aSN1Sequence) {
this.header = PKIHeader.getInstance(aSN1Sequence.getObjectAt(0));
this.body = PKIBody.getInstance(aSN1Sequence.getObjectAt(1));
}
}