Java tutorial
//package com.java2s; //License from project: Apache License import java.math.BigInteger; import java.security.Key; import java.security.KeyFactory; import java.security.spec.RSAPrivateKeySpec; public class Main { public static Key getRSAKey(String hexModulus, String hexPrivateExponent) throws Exception { BigInteger m = new BigInteger(hexModulus, 16); BigInteger e = new BigInteger(hexPrivateExponent, 16); RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(m, e); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); Key rsaKey = keyFactory.generatePrivate(keySpec); return rsaKey; } }