public class SecurityUtil extends Object
| Constructor and Description |
|---|
SecurityUtil() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decodeURLSafe(String encoded) |
byte[] |
decrypt(PrivateKey privateKey,
byte[] encryptedSecretKey,
byte[] encryptedText) |
String |
encode(byte[] key) |
String |
encodeURLSafe(byte[] key) |
static String |
encodeURLSafe(String data) |
byte[] |
encrypt(PrivateKey privateKey,
byte[] encryptedSecretKey,
String data)
Encrypt data using an key encrypted with a private key.
|
String |
encrypt(String plaintext)
Encrypt a string using SHA
|
KeyPair |
genKeyPair() |
public byte[] encrypt(PrivateKey privateKey, byte[] encryptedSecretKey, String data) throws InvalidKeyException
privateKey - the private key to decrypt the secret keyencryptedSecretKey - a encrypted secret keydata - the data to encryptInvalidKeyException - one of the keys is invalidpublic byte[] decrypt(PrivateKey privateKey, byte[] encryptedSecretKey, byte[] encryptedText)
public KeyPair genKeyPair()
public String encode(byte[] key)
public String encodeURLSafe(byte[] key)
public byte[] decodeURLSafe(String encoded)
Copyright © 2012–2017 CoGrOO. All rights reserved.