Code example for InvalidKeySpecException

0
                    null, 
                    null, 
                    null, 
                    null)); 
        } catch (Exception e) {
            throw new InvalidKeySpecException(e);
        } 
    } 
 
    static OpenSSLRSAPrivateKey getInstance(OpenSSLKey key) {
      byte[][] params = NativeCrypto.get_RSA_private_params(key.getPkeyContext());
      if (params[1] != null) {
          return new OpenSSLRSAPrivateCrtKey(key, params);
      } 
      return new OpenSSLRSAPrivateKey(key, params);
    } 
 
    static OpenSSLKey getInstance(RSAPrivateKey rsaPrivateKey) throws InvalidKeyException {
        final BigInteger modulus = rsaPrivateKey.getModulus();
        final BigInteger privateExponent = rsaPrivateKey.getPrivateExponent();