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

54 lines
1.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.pkcs;
import java.math.BigInteger;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.DERSequence;
/* loaded from: classes6.dex */
public class PKCS12PBEParams extends ASN1Object {
ASN1Integer iterations;
ASN1OctetString iv;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.iv);
aSN1EncodableVector.add(this.iterations);
return new DERSequence(aSN1EncodableVector);
}
public BigInteger getIterations() {
return this.iterations.getValue();
}
public byte[] getIV() {
return this.iv.getOctets();
}
public static PKCS12PBEParams getInstance(Object obj) {
if (obj instanceof PKCS12PBEParams) {
return (PKCS12PBEParams) obj;
}
if (obj != null) {
return new PKCS12PBEParams(ASN1Sequence.getInstance(obj));
}
return null;
}
public PKCS12PBEParams(byte[] bArr, int i) {
this.iv = new DEROctetString(bArr);
this.iterations = new ASN1Integer(i);
}
private PKCS12PBEParams(ASN1Sequence aSN1Sequence) {
this.iv = (ASN1OctetString) aSN1Sequence.getObjectAt(0);
this.iterations = ASN1Integer.getInstance(aSN1Sequence.getObjectAt(1));
}
}