|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.slee.resource.parlay.util.crypto.RSAUtil
public class RSAUtil
This class provides utility methods for the creation, use and storage of RSA public and private keys.
| Constructor Summary | |
|---|---|
RSAUtil()
|
|
| Method Summary | |
|---|---|
static byte[] |
decryptMessage(byte[] message,
java.security.PrivateKey privateKey,
java.lang.String cipherAlgorithm)
Decrypts a message using the private key. |
static byte[] |
encryptMessage(byte[] message,
java.security.interfaces.RSAPublicKey publicKey,
java.lang.String cipherAlgorithm)
Encrypts a message using the private key. |
static java.security.KeyPair |
generateRSAKeyPair(int keySize)
Generates an RSA key pair |
static java.security.PrivateKey |
getPrivateKey(java.lang.String clientID)
|
static java.security.interfaces.RSAPublicKey |
getPublicKey(java.lang.String file,
java.lang.String clientID)
|
static void |
loadKeyStore(java.lang.String vault,
java.lang.String file)
loads a keyStore from a .jks file or creates a new one. |
static void |
saveKeyStore(java.lang.String vault)
Saves the keyStore to a password protected file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RSAUtil()
| Method Detail |
|---|
public static java.security.KeyPair generateRSAKeyPair(int keySize)
throws RSAUtilException
keySize - the desired RSA key size
RSAUtilException
public static java.security.interfaces.RSAPublicKey getPublicKey(java.lang.String file,
java.lang.String clientID)
throws RSAUtilException
file - clientID -
RSAUtilException
public static java.security.PrivateKey getPrivateKey(java.lang.String clientID)
throws RSAUtilException
clientID -
RSAUtilException
public static byte[] encryptMessage(byte[] message,
java.security.interfaces.RSAPublicKey publicKey,
java.lang.String cipherAlgorithm)
throws RSAUtilException
message - the message to be encryptedpublicKey - the key for the encryption
RSAUtilException
public static byte[] decryptMessage(byte[] message,
java.security.PrivateKey privateKey,
java.lang.String cipherAlgorithm)
throws RSAUtilException
message - the message to be encryptedprivateKey - the key for the decryption
RSAUtilException
public static void loadKeyStore(java.lang.String vault,
java.lang.String file)
throws RSAUtilException
vault - file -
RSAUtilException
public static void saveKeyStore(java.lang.String vault)
throws RSAUtilException
RSAUtilException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||