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(PrivateKey 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(KeyEncryptionProvider keyEncryptionProvider,
JweHeaders headers)
|
static JweEncryptionProvider |
createJweEncryptionProvider(KeyEncryptionProvider 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(PrivateKey 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 ContentEncryptionProvider |
getContentEncryptionAlgorithm(JsonWebKey jwk)
|
static ContentEncryptionProvider |
getContentEncryptionAlgorithm(JsonWebKey jwk,
String defaultAlgorithm)
|
static ContentEncryptionProvider |
getContentEncryptionAlgorithm(SecretKey key,
String algorithm)
|
static ContentEncryptionProvider |
getContentEncryptionAlgorithm(String algorithm)
|
static JweDecryption |
getDirectKeyJweDecryption(JsonWebKey key)
|
static JweDecryption |
getDirectKeyJweDecryption(SecretKey key,
String algorithm)
|
static JweEncryption |
getDirectKeyJweEncryption(JsonWebKey key)
|
static JweEncryption |
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 KeyEncryptionProvider |
getKeyEncryptionProvider(JsonWebKey jwk)
|
static KeyEncryptionProvider |
getKeyEncryptionProvider(JsonWebKey jwk,
String defaultAlgorithm)
|
static KeyDecryptionAlgorithm |
getPrivateKeyDecryptionAlgorithm(PrivateKey key,
String algo)
|
static KeyEncryptionProvider |
getRSAKeyEncryptionProvider(RSAPublicKey key,
String algo)
|
static KeyDecryptionAlgorithm |
getSecretKeyDecryptionAlgorithm(SecretKey key,
String algo)
|
static KeyEncryptionProvider |
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)
|
static void |
validateJweCertificateChain(List<X509Certificate> certs)
|
| 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(PrivateKey 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)
getKeyEncryptionProvider
public static KeyEncryptionProvider getKeyEncryptionProvider(JsonWebKey jwk)
getKeyEncryptionProvider
public static KeyEncryptionProvider getKeyEncryptionProvider(JsonWebKey jwk,
String defaultAlgorithm)
getRSAKeyEncryptionProvider
public static KeyEncryptionProvider getRSAKeyEncryptionProvider(RSAPublicKey key,
String algo)
getSecretKeyEncryptionAlgorithm
public static KeyEncryptionProvider getSecretKeyEncryptionAlgorithm(SecretKey key,
String algo)
getKeyDecryptionAlgorithm
public static KeyDecryptionAlgorithm getKeyDecryptionAlgorithm(JsonWebKey jwk)
getKeyDecryptionAlgorithm
public static KeyDecryptionAlgorithm getKeyDecryptionAlgorithm(JsonWebKey jwk,
String defaultAlgorithm)
getPrivateKeyDecryptionAlgorithm
public static KeyDecryptionAlgorithm getPrivateKeyDecryptionAlgorithm(PrivateKey key,
String algo)
getSecretKeyDecryptionAlgorithm
public static KeyDecryptionAlgorithm getSecretKeyDecryptionAlgorithm(SecretKey key,
String algo)
getContentEncryptionAlgorithm
public static ContentEncryptionProvider getContentEncryptionAlgorithm(JsonWebKey jwk)
getContentEncryptionAlgorithm
public static ContentEncryptionProvider getContentEncryptionAlgorithm(JsonWebKey jwk,
String defaultAlgorithm)
getContentEncryptionAlgorithm
public static ContentEncryptionProvider getContentEncryptionAlgorithm(SecretKey key,
String algorithm)
getContentEncryptionAlgorithm
public static ContentEncryptionProvider 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 JweEncryption getDirectKeyJweEncryption(JsonWebKey key)
getDirectKeyJweEncryption
public static JweEncryption getDirectKeyJweEncryption(SecretKey key,
String algorithm)
getDirectKeyJweDecryption
public static JweDecryption getDirectKeyJweDecryption(JsonWebKey key)
getDirectKeyJweDecryption
public static JweDecryption getDirectKeyJweDecryption(SecretKey key,
String algorithm)
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(KeyEncryptionProvider keyEncryptionProvider,
String contentEncryptionAlgo,
String compression)
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(KeyEncryptionProvider keyEncryptionProvider,
JweHeaders headers)
createJweDecryptionProvider
public static JweDecryptionProvider createJweDecryptionProvider(PrivateKey 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)
validateJweCertificateChain
public static void validateJweCertificateChain(List<X509Certificate> certs)
Apache CXF