package org.bouncycastle.openpgp.operator;

import java.security.SecureRandom;
import org.bouncycastle.bcpg.GnuExtendedS2K;
import org.bouncycastle.openpgp.PGPException;

/* JADX INFO: loaded from: classes2.dex */
public class GnuDivertToCardSecretKeyEncryptor extends PBESecretKeyEncryptor {
    private byte[] serial;

    public GnuDivertToCardSecretKeyEncryptor(PGPDigestCalculator pGPDigestCalculator, byte[] bArr) {
        super(0, pGPDigestCalculator, 0, (SecureRandom) null, (char[]) null);
        this.s2k = new GnuExtendedS2K(2);
        this.serial = new byte[bArr.length + 1];
        this.serial[0] = (byte) bArr.length;
        System.arraycopy(bArr, 0, this.serial, 1, bArr.length);
    }

    @Override // org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor
    public byte[] encryptKeyData(byte[] bArr, byte[] bArr2, int i, int i2) throws PGPException {
        if (this.serial == null || this.serial.length <= 16) {
            return this.serial;
        }
        byte[] bArr3 = new byte[17];
        System.arraycopy(this.serial, 0, bArr3, 0, 17);
        return bArr3;
    }

    @Override // org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor
    public byte[] getCipherIV() {
        return new byte[0];
    }

    @Override // org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor
    public byte[] getKey() throws PGPException {
        return null;
    }
}
