class Crypto {

    public static PrivateKey generateRSAPrivateKey(int bits) throws CryptoException {
        KeyPairGenerator keyGen;
        try {
            keyGen = KeyPairGenerator.getInstance(RSA);
            ///CLOVER:OFF
        } catch (NoSuchAlgorithmException e) {
            LOG.error("generatePrivateKey: Caught NoSuchAlgorithmException, check to make sure the algorithm is supported by the provider.");
            throw new CryptoException(e);
        }
        ///CLOVER:ON
        keyGen.initialize(bits);
        return keyGen.genKeyPair().getPrivate();
    }

}