Java tutorial
//package com.java2s; import java.security.Key; public class Main { /** * Returns true if the key is an RSA public or private key. */ public static boolean isRsaKey(Key key) { return "RSA".equals(key.getAlgorithm()); } }