Android examples for java.security:RSA
RSA decrypt Bytes with Key
//package com.java2s; import java.security.Key; import javax.crypto.Cipher; public class Main { public static String decryptBytes(Key key, byte[] bytes) { try {/*ww w . ja v a 2s. c o m*/ Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); cipher.init(Cipher.DECRYPT_MODE, key); byte[] enBytes = cipher.doFinal(bytes); return new String(enBytes); } catch (Exception e) { e.printStackTrace(); return null; } } }