org.apache.cxf.rs.security.oauth2.utils
Class EncryptionUtils
java.lang.Object
org.apache.cxf.rs.security.oauth2.utils.EncryptionUtils
public final class EncryptionUtils
- extends Object
Encryption helpers
|
Method Summary |
static SecretKey |
decodeSecretKey(String encodedSecretKey)
|
static SecretKey |
decodeSecretKey(String encodedSecretKey,
String algo)
|
static byte[] |
decodeSequence(String encodedSequence)
|
static byte[] |
decryptBytes(byte[] bytes,
Key secretKey)
|
static byte[] |
decryptBytes(byte[] bytes,
Key secretKey,
SecretKeyProperties keyProps)
|
static SecretKey |
decryptSecretKey(String encodedEncryptedSecretKey,
PrivateKey privateKey)
|
static SecretKey |
decryptSecretKey(String encodedEncryptedSecretKey,
SecretKeyProperties props,
PrivateKey privateKey)
|
static String |
decryptSequence(String encodedData,
Key secretKey)
|
static String |
decryptSequence(String encodedData,
Key secretKey,
SecretKeyProperties props)
|
static String |
decryptSequence(String encodedToken,
String encodedSecretKey)
|
static String |
decryptSequence(String encodedData,
String encodedSecretKey,
SecretKeyProperties props)
|
static String |
encodeBytes(byte[] bytes)
|
static String |
encodeSecretKey(SecretKey key)
|
static byte[] |
encryptBytes(byte[] bytes,
Key secretKey)
|
static byte[] |
encryptBytes(byte[] bytes,
Key secretKey,
SecretKeyProperties keyProps)
|
static String |
encryptSecretKey(SecretKey secretKey,
PublicKey publicKey)
|
static String |
encryptSecretKey(SecretKey secretKey,
PublicKey publicKey,
SecretKeyProperties props)
|
static String |
encryptSequence(String sequence,
Key secretKey)
|
static String |
encryptSequence(String sequence,
Key secretKey,
SecretKeyProperties keyProps)
|
static SecretKey |
getSecretKey()
|
static SecretKey |
getSecretKey(SecretKeyProperties props)
|
static SecretKey |
getSecretKey(String symEncAlgo)
|
static SecretKey |
recreateSecretKey(byte[] bytes,
String algo)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
encodeSecretKey
public static String encodeSecretKey(SecretKey key)
throws EncryptionException
- Throws:
EncryptionException
encryptSecretKey
public static String encryptSecretKey(SecretKey secretKey,
PublicKey publicKey)
throws EncryptionException
- Throws:
EncryptionException
encryptSecretKey
public static String encryptSecretKey(SecretKey secretKey,
PublicKey publicKey,
SecretKeyProperties props)
throws EncryptionException
- Throws:
EncryptionException
getSecretKey
public static SecretKey getSecretKey()
throws Exception
- Throws:
Exception
getSecretKey
public static SecretKey getSecretKey(String symEncAlgo)
throws EncryptionException
- Throws:
EncryptionException
getSecretKey
public static SecretKey getSecretKey(SecretKeyProperties props)
throws EncryptionException
- Throws:
EncryptionException
decryptSequence
public static String decryptSequence(String encodedToken,
String encodedSecretKey)
throws EncryptionException
- Throws:
EncryptionException
decryptSequence
public static String decryptSequence(String encodedData,
String encodedSecretKey,
SecretKeyProperties props)
throws EncryptionException
- Throws:
EncryptionException
decryptSequence
public static String decryptSequence(String encodedData,
Key secretKey)
throws EncryptionException
- Throws:
EncryptionException
decryptSequence
public static String decryptSequence(String encodedData,
Key secretKey,
SecretKeyProperties props)
throws EncryptionException
- Throws:
EncryptionException
encryptSequence
public static String encryptSequence(String sequence,
Key secretKey)
throws EncryptionException
- Throws:
EncryptionException
encryptSequence
public static String encryptSequence(String sequence,
Key secretKey,
SecretKeyProperties keyProps)
throws EncryptionException
- Throws:
EncryptionException
encodeBytes
public static String encodeBytes(byte[] bytes)
throws EncryptionException
- Throws:
EncryptionException
encryptBytes
public static byte[] encryptBytes(byte[] bytes,
Key secretKey)
throws EncryptionException
- Throws:
EncryptionException
encryptBytes
public static byte[] encryptBytes(byte[] bytes,
Key secretKey,
SecretKeyProperties keyProps)
throws EncryptionException
- Throws:
EncryptionException
decryptBytes
public static byte[] decryptBytes(byte[] bytes,
Key secretKey)
throws EncryptionException
- Throws:
EncryptionException
decryptBytes
public static byte[] decryptBytes(byte[] bytes,
Key secretKey,
SecretKeyProperties keyProps)
throws EncryptionException
- Throws:
EncryptionException
decodeSecretKey
public static SecretKey decodeSecretKey(String encodedSecretKey)
throws EncryptionException
- Throws:
EncryptionException
decodeSecretKey
public static SecretKey decodeSecretKey(String encodedSecretKey,
String algo)
throws EncryptionException
- Throws:
EncryptionException
decryptSecretKey
public static SecretKey decryptSecretKey(String encodedEncryptedSecretKey,
PrivateKey privateKey)
throws EncryptionException
- Throws:
EncryptionException
decryptSecretKey
public static SecretKey decryptSecretKey(String encodedEncryptedSecretKey,
SecretKeyProperties props,
PrivateKey privateKey)
throws EncryptionException
- Throws:
EncryptionException
recreateSecretKey
public static SecretKey recreateSecretKey(byte[] bytes,
String algo)
decodeSequence
public static byte[] decodeSequence(String encodedSequence)
throws EncryptionException
- Throws:
EncryptionException
Apache CXF