Here you can find the source of getPublicKey(final byte[] modulus, final byte[] exponent)
public static RSAPublicKey getPublicKey(final byte[] modulus, final byte[] exponent)
//package com.java2s; //License from project: LGPL import java.math.BigInteger; import java.security.*; import java.security.interfaces.RSAPublicKey; import java.security.spec.RSAPublicKeySpec; public class Main { public static final String EBICS_ENCRYPTION_KEY_ALGORITHM = "RSA"; public static RSAPublicKey getPublicKey(final byte[] modulus, final byte[] exponent) { final RSAPublicKeySpec spec = new RSAPublicKeySpec(new BigInteger(modulus), new BigInteger(exponent)); try {/*from w ww . java 2 s.co m*/ final KeyFactory factory = KeyFactory.getInstance(EBICS_ENCRYPTION_KEY_ALGORITHM); return (RSAPublicKey) factory.generatePublic(spec); } catch (final GeneralSecurityException e) { throw new RuntimeException(e); } } }