package org.bouncycastle.openpgp.operator.bc;

import java.util.Date;
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
import org.bouncycastle.openpgp.PGPAlgorithmParameters;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPKeyPair;
import org.bouncycastle.openpgp.PGPPrivateKey;
import org.bouncycastle.openpgp.PGPPublicKey;

/* JADX INFO: loaded from: classes.dex */
public class BcPGPKeyPair extends PGPKeyPair {
    public BcPGPKeyPair(int i, int i2, AsymmetricCipherKeyPair asymmetricCipherKeyPair, Date date) throws PGPException {
        this.pub = getPublicKey(i, i2, null, asymmetricCipherKeyPair.getPublic(), date);
        this.priv = getPrivateKey(this.pub, asymmetricCipherKeyPair.getPrivate());
    }

    public BcPGPKeyPair(int i, int i2, PGPAlgorithmParameters pGPAlgorithmParameters, AsymmetricCipherKeyPair asymmetricCipherKeyPair, Date date) throws PGPException {
        this.pub = getPublicKey(i, i2, pGPAlgorithmParameters, asymmetricCipherKeyPair.getPublic(), date);
        this.priv = getPrivateKey(this.pub, asymmetricCipherKeyPair.getPrivate());
    }

    @Deprecated
    public BcPGPKeyPair(int i, AsymmetricCipherKeyPair asymmetricCipherKeyPair, Date date) throws PGPException {
        this(4, i, asymmetricCipherKeyPair, date);
    }

    @Deprecated
    public BcPGPKeyPair(int i, PGPAlgorithmParameters pGPAlgorithmParameters, AsymmetricCipherKeyPair asymmetricCipherKeyPair, Date date) throws PGPException {
        this(4, i, pGPAlgorithmParameters, asymmetricCipherKeyPair, date);
    }

    private static PGPPrivateKey getPrivateKey(PGPPublicKey pGPPublicKey, AsymmetricKeyParameter asymmetricKeyParameter) throws PGPException {
        return new BcPGPKeyConverter().getPGPPrivateKey(pGPPublicKey, asymmetricKeyParameter);
    }

    private static PGPPublicKey getPublicKey(int i, int i2, PGPAlgorithmParameters pGPAlgorithmParameters, AsymmetricKeyParameter asymmetricKeyParameter, Date date) throws PGPException {
        return new BcPGPKeyConverter().getPGPPublicKey(i, i2, pGPAlgorithmParameters, asymmetricKeyParameter, date);
    }
}
