public class RsaUtils extends Object
| Constructor and Description |
|---|
RsaUtils() |
| Modifier and Type | Method and Description |
|---|---|
static PrivateKey |
bytesToPrivateKey(byte[] bytes) |
static PublicKey |
bytesToPublicKey(byte[] bytes) |
static KeyPair |
genKeyPair(int keySize) |
static Cipher |
getDecryptCipher(PrivateKey key) |
static Cipher |
getEncryptCipher(PublicKey key) |
public static KeyPair genKeyPair(int keySize) throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic static PublicKey bytesToPublicKey(byte[] bytes) throws InvalidKeySpecException, NoSuchAlgorithmException
public static PrivateKey bytesToPrivateKey(byte[] bytes) throws InvalidKeySpecException, NoSuchAlgorithmException
public static Cipher getEncryptCipher(PublicKey key) throws GeneralSecurityException
GeneralSecurityExceptionpublic static Cipher getDecryptCipher(PrivateKey key) throws GeneralSecurityException
GeneralSecurityExceptionCopyright © 2017. All rights reserved.