public class RsaKeyUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
provider |
static String |
RSA |
protected SecureRandom |
secureRandom |
| Constructor and Description |
|---|
RsaKeyUtil() |
RsaKeyUtil(String provider,
SecureRandom secureRandom) |
| Modifier and Type | Method and Description |
|---|---|
PublicKey |
fromPemEncoded(String pem) |
KeyPair |
generateKeyPair(int bits) |
protected KeyFactory |
getKeyFactory() |
protected KeyPairGenerator |
getKeyPairGenerator() |
RSAPrivateKey |
getRsaPrivateKey(RSAPrivateKeySpec keySpec) |
boolean |
isAvailable() |
static String |
pemEncode(PublicKey publicKey) |
RSAPrivateKey |
privateKey(BigInteger modulus,
BigInteger privateExponent) |
RSAPrivateKey |
privateKey(BigInteger modulus,
BigInteger publicExponent,
BigInteger privateExponent,
BigInteger primeP,
BigInteger primeQ,
BigInteger primeExponentP,
BigInteger primeExponentQ,
BigInteger crtCoefficient) |
RSAPublicKey |
publicKey(BigInteger modulus,
BigInteger publicExponent) |
public static final String RSA
protected String provider
protected SecureRandom secureRandom
public RsaKeyUtil()
public RsaKeyUtil(String provider, SecureRandom secureRandom)
public RSAPublicKey publicKey(BigInteger modulus, BigInteger publicExponent) throws JoseException
JoseExceptionpublic RSAPrivateKey privateKey(BigInteger modulus, BigInteger privateExponent) throws JoseException
JoseExceptionpublic RSAPrivateKey privateKey(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient) throws JoseException
JoseExceptionpublic RSAPrivateKey getRsaPrivateKey(RSAPrivateKeySpec keySpec) throws JoseException
JoseExceptionpublic KeyPair generateKeyPair(int bits) throws JoseException
JoseExceptionprotected KeyFactory getKeyFactory() throws JoseException
JoseExceptionprotected KeyPairGenerator getKeyPairGenerator() throws JoseException
JoseExceptionpublic PublicKey fromPemEncoded(String pem) throws JoseException, InvalidKeySpecException
JoseExceptionInvalidKeySpecExceptionpublic boolean isAvailable()
Copyright © 2016. All rights reserved.