public class KeyHandler extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
RSA |
static String |
RSA_ECB_TRANSFORMATION |
static String |
SHA_512_WITH_RSA |
| Constructor and Description |
|---|
KeyHandler() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(byte[] data,
Key key) |
static byte[] |
decrypt(byte[] data,
Key key,
String transformation) |
static byte[] |
encrypt(byte[] data,
Key key) |
static byte[] |
encrypt(byte[] data,
Key key,
String transformation) |
static void |
generatePair(String publicName,
String privateName,
int keySize) |
static PrivateKey |
loadPrv(InputStream keyIS) |
static PrivateKey |
loadPrv(String keyName,
InputStream keystoreIS,
char[] password) |
static PublicKey |
loadPub(InputStream keyIS) |
static PublicKey |
loadPub(String keyName,
InputStream keystoreIS,
char[] password) |
public static final String RSA
public static final String RSA_ECB_TRANSFORMATION
public static final String SHA_512_WITH_RSA
public static void generatePair(String publicName, String privateName, int keySize) throws NoSuchAlgorithmException, IOException
NoSuchAlgorithmExceptionIOExceptionpublic static PublicKey loadPub(String keyName, InputStream keystoreIS, char[] password) throws Exception
Exceptionpublic static PrivateKey loadPrv(String keyName, InputStream keystoreIS, char[] password) throws Exception
Exceptionpublic static PrivateKey loadPrv(InputStream keyIS) throws NoSuchAlgorithmException, IOException, InvalidKeySpecException
public static PublicKey loadPub(InputStream keyIS) throws NoSuchAlgorithmException, IOException, InvalidKeySpecException
public static byte[] encrypt(byte[] data,
Key key,
String transformation)
throws Exception
ExceptionCopyright © 2016. All rights reserved.