Package com.nimbusds.jose.crypto.impl
Class RSAKeyUtils
- java.lang.Object
-
- com.nimbusds.jose.crypto.impl.RSAKeyUtils
-
public class RSAKeyUtils extends java.lang.ObjectRSA JWK conversion utility.
-
-
Constructor Summary
Constructors Constructor Description RSAKeyUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intkeyBitLength(java.security.PrivateKey privateKey)Returns the length in bits of the specified RSA private key.static java.security.PrivateKeytoRSAPrivateKey(RSAKey rsaJWK)Returns the private RSA key of the specified RSA JWK.
-
-
-
Method Detail
-
toRSAPrivateKey
public static java.security.PrivateKey toRSAPrivateKey(RSAKey rsaJWK) throws JOSEException
Returns the private RSA key of the specified RSA JWK. Supports PKCS#11 keys stores.- Parameters:
rsaJWK- The RSA JWK. Must not benull.- Returns:
- The private RSA key.
- Throws:
JOSEException- If the RSA JWK doesn't contain a private part.
-
keyBitLength
public static int keyBitLength(java.security.PrivateKey privateKey)
Returns the length in bits of the specified RSA private key.- Parameters:
privateKey- The RSA private key. Must not benull.- Returns:
- The key length in bits, -1 if the length couldn't be
determined, e.g. for a PKCS#11 backed key which doesn't
expose an RSAPrivateKey interface or support the
getModulus()method.
-
-