List of usage examples for java.security.interfaces RSAKey getModulus
public BigInteger getModulus();
From source file:Test.java
public boolean permits(Set<CryptoPrimitive> primitives, String algorithm, Key key, AlgorithmParameters parameters) { if (algorithm == null) algorithm = key.getAlgorithm(); if (algorithm.indexOf("RSA") == -1) return false; if (key != null) { RSAKey rsaKey = (RSAKey) key; int size = rsaKey.getModulus().bitLength(); if (size < 2048) return false; }/*from w w w . j av a2s . c o m*/ return true; }