what-the-bank/sources/org/bouncycastle/asn1/misc/CAST5CBCParameters.java

54 lines
1.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1.misc;
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;
import org.bouncycastle.util.Arrays;
/* loaded from: classes6.dex */
public class CAST5CBCParameters extends ASN1Object {
ASN1OctetString iv;
ASN1Integer keyLength;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
aSN1EncodableVector.add(this.iv);
aSN1EncodableVector.add(this.keyLength);
return new DERSequence(aSN1EncodableVector);
}
public int getKeyLength() {
return this.keyLength.getValue().intValue();
}
public byte[] getIV() {
return Arrays.clone(this.iv.getOctets());
}
public static CAST5CBCParameters getInstance(Object obj) {
if (obj instanceof CAST5CBCParameters) {
return (CAST5CBCParameters) obj;
}
if (obj != null) {
return new CAST5CBCParameters(ASN1Sequence.getInstance(obj));
}
return null;
}
public CAST5CBCParameters(byte[] bArr, int i) {
this.iv = new DEROctetString(Arrays.clone(bArr));
this.keyLength = new ASN1Integer(i);
}
public CAST5CBCParameters(ASN1Sequence aSN1Sequence) {
this.iv = (ASN1OctetString) aSN1Sequence.getObjectAt(0);
this.keyLength = (ASN1Integer) aSN1Sequence.getObjectAt(1);
}
}