org.apache.cxf.rs.security.jose.jwe
Class JweUtils
java.lang.Object
org.apache.cxf.rs.security.jose.jwe.JweUtils
public final class JweUtils
- extends Object
|
Method Summary |
static JweDecryptionProvider |
createJweDecryptionProvider(JsonWebKey key,
String contentDecryptionAlgo)
|
static JweDecryptionProvider |
createJweDecryptionProvider(KeyDecryptionAlgorithm keyDecryptionProvider,
String contentDecryptionAlgo)
|
static JweDecryptionProvider |
createJweDecryptionProvider(RSAPrivateKey key,
String keyAlgo,
String contentDecryptionAlgo)
|
static JweDecryptionProvider |
createJweDecryptionProvider(SecretKey key,
String keyAlgo,
String contentDecryptionAlgo)
|
static JweEncryptionProvider |
createJweEncryptionProvider(JsonWebKey key,
JweHeaders headers)
|
static JweEncryptionProvider |
createJweEncryptionProvider(JsonWebKey key,
String contentEncryptionAlgo,
String compression)
|
static JweEncryptionProvider |
createJweEncryptionProvider(KeyEncryptionAlgorithm keyEncryptionProvider,
JweHeaders headers)
|
static JweEncryptionProvider |
createJweEncryptionProvider(KeyEncryptionAlgorithm keyEncryptionProvider,
String contentEncryptionAlgo,
String compression)
|
static JweEncryptionProvider |
createJweEncryptionProvider(RSAPublicKey key,
JweHeaders headers)
|
static JweEncryptionProvider |
createJweEncryptionProvider(RSAPublicKey key,
String keyAlgo,
String contentEncryptionAlgo,
String compression)
|
static JweEncryptionProvider |
createJweEncryptionProvider(SecretKey key,
JweHeaders headers)
|
static JweEncryptionProvider |
createJweEncryptionProvider(SecretKey key,
String keyAlgo,
String contentEncryptionAlgo,
String compression)
|
static byte[] |
decrypt(JsonWebKey key,
String contentAlgo,
String content)
|
static byte[] |
decrypt(RSAPrivateKey key,
String keyAlgo,
String contentAlgo,
String content)
|
static byte[] |
decrypt(SecretKey key,
String keyAlgo,
String contentAlgo,
String content)
|
static byte[] |
decryptDirect(JsonWebKey key,
String content)
|
static byte[] |
decryptDirect(SecretKey key,
String contentAlgo,
String content)
|
static String |
encrypt(JsonWebKey key,
String contentAlgo,
byte[] content,
String ct)
|
static String |
encrypt(RSAPublicKey key,
String keyAlgo,
String contentAlgo,
byte[] content)
|
static String |
encrypt(RSAPublicKey key,
String keyAlgo,
String contentAlgo,
byte[] content,
String ct)
|
static String |
encrypt(SecretKey key,
String keyAlgo,
String contentAlgo,
byte[] content)
|
static String |
encrypt(SecretKey key,
String keyAlgo,
String contentAlgo,
byte[] content,
String ct)
|
static String |
encryptDirect(JsonWebKey key,
byte[] content,
String ct)
|
static String |
encryptDirect(SecretKey key,
String contentAlgo,
byte[] content)
|
static String |
encryptDirect(SecretKey key,
String contentAlgo,
byte[] content,
String ct)
|
static byte[] |
getAdditionalAuthenticationData(String headersJson,
byte[] aad)
|
static ContentDecryptionAlgorithm |
getContentDecryptionAlgorithm(String algorithm)
|
static SecretKey |
getContentDecryptionSecretKey(JsonWebKey jwk)
|
static SecretKey |
getContentDecryptionSecretKey(JsonWebKey jwk,
String defaultAlgorithm)
|
static ContentEncryptionAlgorithm |
getContentEncryptionAlgorithm(JsonWebKey jwk)
|
static ContentEncryptionAlgorithm |
getContentEncryptionAlgorithm(JsonWebKey jwk,
String defaultAlgorithm)
|
static ContentEncryptionAlgorithm |
getContentEncryptionAlgorithm(SecretKey key,
String algorithm)
|
static ContentEncryptionAlgorithm |
getContentEncryptionAlgorithm(String algorithm)
|
static DirectKeyJweDecryption |
getDirectKeyJweDecryption(JsonWebKey key)
|
static DirectKeyJweDecryption |
getDirectKeyJweDecryption(SecretKey key,
String algorithm)
|
static DirectKeyJweEncryption |
getDirectKeyJweEncryption(JsonWebKey key)
|
static DirectKeyJweEncryption |
getDirectKeyJweEncryption(SecretKey key,
String algorithm)
|
static byte[] |
getECDHKey(ECPrivateKey privateKey,
ECPublicKey peerPublicKey,
byte[] partyUInfo,
byte[] partyVInfo,
String algoName,
int algoKeyBitLen)
|
static byte[] |
getECDHKey(JsonWebKey privateKey,
JsonWebKey peerPublicKey,
byte[] partyUInfo,
byte[] partyVInfo,
String algoName,
int algoKeyBitLen)
|
static KeyDecryptionAlgorithm |
getKeyDecryptionAlgorithm(JsonWebKey jwk)
|
static KeyDecryptionAlgorithm |
getKeyDecryptionAlgorithm(JsonWebKey jwk,
String defaultAlgorithm)
|
static KeyEncryptionAlgorithm |
getKeyEncryptionAlgorithm(JsonWebKey jwk)
|
static KeyEncryptionAlgorithm |
getKeyEncryptionAlgorithm(JsonWebKey jwk,
String defaultAlgorithm)
|
static KeyDecryptionAlgorithm |
getRSAKeyDecryptionAlgorithm(RSAPrivateKey key,
String algo)
|
static KeyEncryptionAlgorithm |
getRSAKeyEncryptionAlgorithm(RSAPublicKey key,
String algo)
|
static KeyDecryptionAlgorithm |
getSecretKeyDecryptionAlgorithm(SecretKey key,
String algo)
|
static KeyEncryptionAlgorithm |
getSecretKeyEncryptionAlgorithm(SecretKey key,
String algo)
|
static JweDecryptionProvider |
loadDecryptionProvider(boolean required)
|
static JweDecryptionProvider |
loadDecryptionProvider(JweHeaders inHeaders,
boolean required)
|
static JweEncryptionProvider |
loadEncryptionProvider(boolean required)
|
static JweEncryptionProvider |
loadEncryptionProvider(JweHeaders headers,
boolean required)
|
static boolean |
validateCriticalHeaders(JoseHeaders headers)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
encrypt
public static String encrypt(RSAPublicKey key,
String keyAlgo,
String contentAlgo,
byte[] content)
encrypt
public static String encrypt(RSAPublicKey key,
String keyAlgo,
String contentAlgo,
byte[] content,
String ct)
encrypt
public static String encrypt(SecretKey key,
String keyAlgo,
String contentAlgo,
byte[] content)
encrypt
public static String encrypt(SecretKey key,
String keyAlgo,
String contentAlgo,
byte[] content,
String ct)
encrypt
public static String encrypt(JsonWebKey key,
String contentAlgo,
byte[] content,
String ct)
encryptDirect
public static String encryptDirect(SecretKey key,
String contentAlgo,
byte[] content)
encryptDirect
public static String encryptDirect(SecretKey key,
String contentAlgo,
byte[] content,
String ct)
encryptDirect
public static String encryptDirect(JsonWebKey key,
byte[] content,
String ct)
decrypt
public static byte[] decrypt(RSAPrivateKey key,
String keyAlgo,
String contentAlgo,
String content)
decrypt
public static byte[] decrypt(SecretKey key,
String keyAlgo,
String contentAlgo,
String content)
decrypt
public static byte[] decrypt(JsonWebKey key,
String contentAlgo,
String content)
decryptDirect
public static byte[] decryptDirect(SecretKey key,
String contentAlgo,
String content)
decryptDirect
public static byte[] decryptDirect(JsonWebKey key,
String content)
getKeyEncryptionAlgorithm
public static KeyEncryptionAlgorithm getKeyEncryptionAlgorithm(JsonWebKey jwk)
getKeyEncryptionAlgorithm
public static KeyEncryptionAlgorithm getKeyEncryptionAlgorithm(JsonWebKey jwk,
String defaultAlgorithm)
getRSAKeyEncryptionAlgorithm
public static KeyEncryptionAlgorithm getRSAKeyEncryptionAlgorithm(RSAPublicKey key,
String algo)
getSecretKeyEncryptionAlgorithm
public static KeyEncryptionAlgorithm getSecretKeyEncryptionAlgorithm(SecretKey key,
String algo)
getKeyDecryptionAlgorithm
public static KeyDecryptionAlgorithm getKeyDecryptionAlgorithm(JsonWebKey jwk)
getKeyDecryptionAlgorithm
public static KeyDecryptionAlgorithm getKeyDecryptionAlgorithm(JsonWebKey jwk,
String defaultAlgorithm)
getRSAKeyDecryptionAlgorithm
public static KeyDecryptionAlgorithm getRSAKeyDecryptionAlgorithm(RSAPrivateKey key,
String algo)
getSecretKeyDecryptionAlgorithm
public static KeyDecryptionAlgorithm getSecretKeyDecryptionAlgorithm(SecretKey key,
String algo)
getContentEncryptionAlgorithm
public static ContentEncryptionAlgorithm getContentEncryptionAlgorithm(JsonWebKey jwk)
getContentEncryptionAlgorithm
public static ContentEncryptionAlgorithm getContentEncryptionAlgorithm(JsonWebKey jwk,
String defaultAlgorithm)
getContentEncryptionAlgorithm
public static ContentEncryptionAlgorithm getContentEncryptionAlgorithm(SecretKey key,
String algorithm)
getContentEncryptionAlgorithm
public static ContentEncryptionAlgorithm getContentEncryptionAlgorithm(String algorithm)
getContentDecryptionAlgorithm
public static ContentDecryptionAlgorithm getContentDecryptionAlgorithm(String algorithm)
getContentDecryptionSecretKey
public static SecretKey getContentDecryptionSecretKey(JsonWebKey jwk)
getContentDecryptionSecretKey
public static SecretKey getContentDecryptionSecretKey(JsonWebKey jwk,
String defaultAlgorithm)
getDirectKeyJweEncryption
public static DirectKeyJweEncryption getDirectKeyJweEncryption(JsonWebKey key)
getDirectKeyJweEncryption
public static DirectKeyJweEncryption getDirectKeyJweEncryption(SecretKey key,
String algorithm)
getDirectKeyJweDecryption
public static DirectKeyJweDecryption getDirectKeyJweDecryption(SecretKey key,
String algorithm)
getDirectKeyJweDecryption
public static DirectKeyJweDecryption getDirectKeyJweDecryption(JsonWebKey key)
loadEncryptionProvider
public static JweEncryptionProvider loadEncryptionProvider(boolean required)
loadEncryptionProvider
public static JweEncryptionProvider loadEncryptionProvider(JweHeaders headers,
boolean required)
loadDecryptionProvider
public static JweDecryptionProvider loadDecryptionProvider(boolean required)
loadDecryptionProvider
public static JweDecryptionProvider loadDecryptionProvider(JweHeaders inHeaders,
boolean required)
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(RSAPublicKey key,
String keyAlgo,
String contentEncryptionAlgo,
String compression)
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(RSAPublicKey key,
JweHeaders headers)
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key,
String keyAlgo,
String contentEncryptionAlgo,
String compression)
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key,
JweHeaders headers)
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key,
String contentEncryptionAlgo,
String compression)
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key,
JweHeaders headers)
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(KeyEncryptionAlgorithm keyEncryptionProvider,
String contentEncryptionAlgo,
String compression)
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(KeyEncryptionAlgorithm keyEncryptionProvider,
JweHeaders headers)
createJweDecryptionProvider
public static JweDecryptionProvider createJweDecryptionProvider(RSAPrivateKey key,
String keyAlgo,
String contentDecryptionAlgo)
createJweDecryptionProvider
public static JweDecryptionProvider createJweDecryptionProvider(SecretKey key,
String keyAlgo,
String contentDecryptionAlgo)
createJweDecryptionProvider
public static JweDecryptionProvider createJweDecryptionProvider(JsonWebKey key,
String contentDecryptionAlgo)
createJweDecryptionProvider
public static JweDecryptionProvider createJweDecryptionProvider(KeyDecryptionAlgorithm keyDecryptionProvider,
String contentDecryptionAlgo)
validateCriticalHeaders
public static boolean validateCriticalHeaders(JoseHeaders headers)
getECDHKey
public static byte[] getECDHKey(JsonWebKey privateKey,
JsonWebKey peerPublicKey,
byte[] partyUInfo,
byte[] partyVInfo,
String algoName,
int algoKeyBitLen)
getECDHKey
public static byte[] getECDHKey(ECPrivateKey privateKey,
ECPublicKey peerPublicKey,
byte[] partyUInfo,
byte[] partyVInfo,
String algoName,
int algoKeyBitLen)
getAdditionalAuthenticationData
public static byte[] getAdditionalAuthenticationData(String headersJson,
byte[] aad)
Apache CXF