public final class CipherUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CIPHER_ALGORITHM |
static String |
CIPHER_EXTENDED_ALGORITHM |
static String |
MESSAGE_DIGEST_ALGORITHM |
static String |
RANDOM_NUMBER_GENERATOR_ALGORITHM |
| Modifier and Type | Method and Description |
|---|---|
static RSAPrivateKey |
buildPrivateKey(String key) |
static RSAPublicKey |
buildPublicKey(String key) |
static byte[] |
computeSignature(byte[] data)
Compute signature
|
static byte[] |
computeSignature(Properties properties) |
static String |
computeSignatureString(Properties properties) |
static byte[] |
decrypt(byte[] data,
Key key) |
static String |
decryptWithAES(String data,
String key) |
static byte[] |
encrypt(byte[] data,
Key key) |
static String |
encryptPassword(String password) |
static String |
encryptWithAES(String data,
String key) |
static KeyPair |
generateKeyPair() |
static String |
getPrivateKey(KeyPair keyPair) |
static String |
getPublicKey(KeyPair keyPair) |
static boolean |
verifyPassword(String plainPassword,
String encryptedPassword)
Checks an unencrypted (plain) password against an encrypted one to see if
they match.
|
public static final String MESSAGE_DIGEST_ALGORITHM
public static final String CIPHER_ALGORITHM
public static final String CIPHER_EXTENDED_ALGORITHM
public static final String RANDOM_NUMBER_GENERATOR_ALGORITHM
public static String computeSignatureString(Properties properties)
properties - public static byte[] computeSignature(Properties properties)
properties - public static byte[] computeSignature(byte[] data)
data - public static RSAPublicKey buildPublicKey(String key)
data - public static RSAPrivateKey buildPrivateKey(String key)
data - public static byte[] encrypt(byte[] data,
Key key)
data - key - public static String encryptWithAES(String data, String key)
data - key - public static String decryptWithAES(String data, String key)
data - key - public static byte[] decrypt(byte[] data,
Key key)
data - key - public static KeyPair generateKeyPair()
public static boolean verifyPassword(String plainPassword, String encryptedPassword)
plainPassword - the plain password to check.encryptedPassword - the digest against which to check the password.Copyright © 2017 PAWLIDI.DE. All rights reserved.