Java tutorial
//package com.java2s; //License from project: Apache License import java.security.interfaces.RSAPublicKey; public class Main { public static boolean RsaPublicKeyComparer(RSAPublicKey key1, RSAPublicKey key2) { return key1.getPublicExponent().compareTo(key2.getPublicExponent()) == 0 && key1.getModulus().compareTo(key2.getModulus()) == 0; } }