Class JweUtils
java.lang.Object
org.apache.cxf.rs.security.jose.jwe.JweUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic JweDecryptionProvidercreateJweDecryptionProvider(PrivateKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentDecryptionAlgo) static JweDecryptionProvidercreateJweDecryptionProvider(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentDecryptionAlgo) static JweDecryptionProvidercreateJweDecryptionProvider(KeyDecryptionProvider keyDecryptionProvider, ContentAlgorithm contentDecryptionAlgo) static JweDecryptionProvidercreateJweDecryptionProvider(JsonWebKey key, ContentAlgorithm contentDecryptionAlgo) static JweEncryptionProvidercreateJweEncryptionProvider(PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo) static JweEncryptionProvidercreateJweEncryptionProvider(PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo, String compression) static JweEncryptionProvidercreateJweEncryptionProvider(PublicKey key, JweHeaders headers) static JweEncryptionProvidercreateJweEncryptionProvider(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo) static JweEncryptionProvidercreateJweEncryptionProvider(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo, String compression) static JweEncryptionProvidercreateJweEncryptionProvider(SecretKey key, JweHeaders headers) static JweEncryptionProvidercreateJweEncryptionProvider(KeyEncryptionProvider keyEncryptionProvider, ContentAlgorithm contentEncryptionAlgo, String compression) static JweEncryptionProvidercreateJweEncryptionProvider(KeyEncryptionProvider keyEncryptionProvider, JweHeaders headers) static JweEncryptionProvidercreateJweEncryptionProvider(KeyEncryptionProvider keyEncryptionProvider, JweHeaders headers, boolean generateCekOnce) static JweEncryptionProvidercreateJweEncryptionProvider(JsonWebKey key, ContentAlgorithm contentEncryptionAlgo) static JweEncryptionProvidercreateJweEncryptionProvider(JsonWebKey key, ContentAlgorithm contentEncryptionAlgo, String compression) static JweEncryptionProvidercreateJweEncryptionProvider(JsonWebKey key, JweHeaders headers) static JweEncryptionProvidercreateJweEncryptionProvider(JsonWebKey key, JweHeaders headers, boolean generateCekOnce) static JweEncryptionProvidercreateJweEncryptionProvider(JsonWebKey key, JweHeaders headers, ContentEncryptionProvider contentEncryptionProvider) static byte[]decrypt(PrivateKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, String content) static byte[]decrypt(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, String content) static byte[]decrypt(JsonWebKey key, ContentAlgorithm contentAlgo, String content) static byte[]decryptDirect(SecretKey key, ContentAlgorithm contentAlgo, String content) static byte[]decryptDirect(JsonWebKey key, String content) static Stringencrypt(PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, byte[] content) static Stringencrypt(PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, byte[] content, String ct) static Stringencrypt(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, byte[] content) static Stringencrypt(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, byte[] content, String ct) static Stringencrypt(JsonWebKey key, ContentAlgorithm contentAlgo, byte[] content, String ct) static StringencryptDirect(SecretKey key, ContentAlgorithm contentAlgo, byte[] content) static StringencryptDirect(SecretKey key, ContentAlgorithm contentAlgo, byte[] content, String ct) static StringencryptDirect(JsonWebKey key, byte[] content, String ct) static byte[]getAdditionalAuthenticationData(String headersJson, byte[] aad) static ContentDecryptionProvidergetContentDecryptionProvider(ContentAlgorithm algorithm) static SecretKeystatic SecretKeygetContentDecryptionSecretKey(JsonWebKey jwk, String defaultAlgorithm) static ContentAlgorithmstatic ContentAlgorithmgetContentEncryptionAlgorithm(Properties props, ContentAlgorithm defaultAlgo) static ContentAlgorithmgetContentEncryptionAlgorithm(org.apache.cxf.message.Message m, Properties props, ContentAlgorithm defaultAlgo) static ContentAlgorithmgetContentEncryptionAlgorithm(org.apache.cxf.message.Message m, Properties props, ContentAlgorithm algo, ContentAlgorithm defaultAlgo) static ContentEncryptionProvidergetContentEncryptionProvider(byte[] key, ContentAlgorithm algorithm) static ContentEncryptionProvidergetContentEncryptionProvider(SecretKey key, ContentAlgorithm algorithm) static ContentEncryptionProvidergetContentEncryptionProvider(ContentAlgorithm algorithm) static ContentEncryptionProvidergetContentEncryptionProvider(ContentAlgorithm algorithm, boolean generateCekOnce) static ContentEncryptionProviderstatic ContentEncryptionProvidergetContentEncryptionProvider(JsonWebKey jwk, ContentAlgorithm defaultAlgorithm) static JweDecryptiongetDirectKeyJweDecryption(byte[] key, ContentAlgorithm algorithm) static JweDecryptiongetDirectKeyJweDecryption(SecretKey key, ContentAlgorithm algorithm) static JweDecryptionstatic JweEncryptiongetDirectKeyJweEncryption(byte[] key, ContentAlgorithm algo) static JweEncryptiongetDirectKeyJweEncryption(SecretKey key, ContentAlgorithm algo) static JweEncryptionstatic ContentEncryptionProvidergetEcdhDirectContentEncryptionProvider(JsonWebKey key, JweHeaders headers) 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 JweDecryptiongetEcDirectKeyJweDecryption(JsonWebKey key, ContentAlgorithm ctAlgo) static JweEncryptiongetEcDirectKeyJweEncryption(JsonWebKey key, ContentAlgorithm ctAlgo) static KeyDecryptionProviderstatic KeyDecryptionProvidergetKeyDecryptionProvider(JsonWebKey jwk, KeyAlgorithm defaultAlgorithm) static KeyAlgorithmgetKeyEncryptionAlgorithm(Properties props, KeyAlgorithm defaultAlgo) static KeyAlgorithmgetKeyEncryptionAlgorithm(org.apache.cxf.message.Message m, Properties props, KeyAlgorithm defaultAlgo) static KeyAlgorithmgetKeyEncryptionAlgorithm(org.apache.cxf.message.Message m, Properties props, KeyAlgorithm algo, KeyAlgorithm defaultAlgo) static KeyEncryptionProviderstatic KeyEncryptionProvidergetKeyEncryptionProvider(JsonWebKey jwk, KeyAlgorithm defaultAlgorithm) static KeyDecryptionProviderstatic KeyEncryptionProvidergetPublicKeyEncryptionProvider(PublicKey key, Properties props, KeyAlgorithm algo) static KeyEncryptionProvidergetPublicKeyEncryptionProvider(PublicKey key, KeyAlgorithm algo) static KeyDecryptionProvidergetSecretKeyDecryptionProvider(SecretKey key, KeyAlgorithm algo) static KeyEncryptionProvidergetSecretKeyEncryptionAlgorithm(SecretKey key, KeyAlgorithm algo) static JweDecryptionProviderloadDecryptionProvider(boolean required) static JweDecryptionProviderloadDecryptionProvider(Properties props, JweHeaders inHeaders) static JweDecryptionProviderloadDecryptionProvider(JweHeaders inHeaders, boolean required) static PropertiesloadEncryptionInProperties(boolean required) static PropertiesloadEncryptionOutProperties(boolean required) static PropertiesloadEncryptionProperties(String propertiesName, boolean required) static JweEncryptionProviderloadEncryptionProvider(boolean required) static JweEncryptionProviderloadEncryptionProvider(Properties props, org.apache.cxf.message.Message m, JweHeaders headers) static JweEncryptionProviderloadEncryptionProvider(Properties props, JweHeaders headers) static JweEncryptionProviderloadEncryptionProvider(JweHeaders headers, boolean required) static PropertiesloadJweProperties(org.apache.cxf.message.Message m, String propLoc) static KeyEncryptionProviderloadKeyEncryptionProvider(Properties props, org.apache.cxf.message.Message m, JweHeaders headers) static JsonWebKeysloadPublicKeyEncryptionKeys(org.apache.cxf.message.Message m, Properties props) static booleanvalidateCriticalHeaders(JoseHeaders headers)
-
Method Details
-
encrypt
public static String encrypt(PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, byte[] content) -
encrypt
public static String encrypt(PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, byte[] content, String ct) -
encrypt
public static String encrypt(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, byte[] content) -
encrypt
public static String encrypt(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, byte[] content, String ct) -
encrypt
public static String encrypt(JsonWebKey key, ContentAlgorithm contentAlgo, byte[] content, String ct) -
encryptDirect
-
encryptDirect
public static String encryptDirect(SecretKey key, ContentAlgorithm contentAlgo, byte[] content, String ct) -
encryptDirect
-
decrypt
public static byte[] decrypt(PrivateKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, String content) -
decrypt
public static byte[] decrypt(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo, String content) -
decrypt
-
decryptDirect
-
decryptDirect
-
getKeyEncryptionProvider
-
getKeyEncryptionProvider
public static KeyEncryptionProvider getKeyEncryptionProvider(JsonWebKey jwk, KeyAlgorithm defaultAlgorithm) -
getPublicKeyEncryptionProvider
public static KeyEncryptionProvider getPublicKeyEncryptionProvider(PublicKey key, KeyAlgorithm algo) -
getPublicKeyEncryptionProvider
public static KeyEncryptionProvider getPublicKeyEncryptionProvider(PublicKey key, Properties props, KeyAlgorithm algo) -
getSecretKeyEncryptionAlgorithm
public static KeyEncryptionProvider getSecretKeyEncryptionAlgorithm(SecretKey key, KeyAlgorithm algo) -
getKeyDecryptionProvider
-
getKeyDecryptionProvider
public static KeyDecryptionProvider getKeyDecryptionProvider(JsonWebKey jwk, KeyAlgorithm defaultAlgorithm) -
getPrivateKeyDecryptionProvider
public static KeyDecryptionProvider getPrivateKeyDecryptionProvider(PrivateKey key, KeyAlgorithm algo) -
getSecretKeyDecryptionProvider
public static KeyDecryptionProvider getSecretKeyDecryptionProvider(SecretKey key, KeyAlgorithm algo) -
getContentEncryptionProvider
-
getContentEncryptionProvider
public static ContentEncryptionProvider getContentEncryptionProvider(JsonWebKey jwk, ContentAlgorithm defaultAlgorithm) -
getContentEncryptionProvider
public static ContentEncryptionProvider getContentEncryptionProvider(SecretKey key, ContentAlgorithm algorithm) -
getContentEncryptionProvider
public static ContentEncryptionProvider getContentEncryptionProvider(byte[] key, ContentAlgorithm algorithm) -
getContentEncryptionProvider
-
getContentEncryptionProvider
public static ContentEncryptionProvider getContentEncryptionProvider(ContentAlgorithm algorithm, boolean generateCekOnce) -
getContentDecryptionProvider
-
getContentDecryptionSecretKey
-
getContentDecryptionSecretKey
-
getDirectKeyJweEncryption
-
getEcDirectKeyJweEncryption
-
getDirectKeyJweEncryption
-
getDirectKeyJweEncryption
-
getDirectKeyJweDecryption
-
getDirectKeyJweDecryption
-
getDirectKeyJweDecryption
-
getEcDirectKeyJweDecryption
-
loadEncryptionProvider
-
loadEncryptionProvider
-
loadEncryptionProvider
-
loadEncryptionProvider
public static JweEncryptionProvider loadEncryptionProvider(Properties props, org.apache.cxf.message.Message m, JweHeaders headers) -
loadKeyEncryptionProvider
public static KeyEncryptionProvider loadKeyEncryptionProvider(Properties props, org.apache.cxf.message.Message m, JweHeaders headers) -
loadDecryptionProvider
-
loadDecryptionProvider
-
loadDecryptionProvider
-
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo) -
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo, String compression) -
createJweEncryptionProvider
-
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo) -
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo, String compression) -
createJweEncryptionProvider
-
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key, ContentAlgorithm contentEncryptionAlgo) -
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key, ContentAlgorithm contentEncryptionAlgo, String compression) -
createJweEncryptionProvider
-
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key, JweHeaders headers, ContentEncryptionProvider contentEncryptionProvider) -
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key, JweHeaders headers, boolean generateCekOnce) -
getEcdhDirectContentEncryptionProvider
public static ContentEncryptionProvider getEcdhDirectContentEncryptionProvider(JsonWebKey key, JweHeaders headers) -
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(KeyEncryptionProvider keyEncryptionProvider, ContentAlgorithm contentEncryptionAlgo, String compression) -
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(KeyEncryptionProvider keyEncryptionProvider, JweHeaders headers) -
createJweEncryptionProvider
public static JweEncryptionProvider createJweEncryptionProvider(KeyEncryptionProvider keyEncryptionProvider, JweHeaders headers, boolean generateCekOnce) -
createJweDecryptionProvider
public static JweDecryptionProvider createJweDecryptionProvider(PrivateKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentDecryptionAlgo) -
createJweDecryptionProvider
public static JweDecryptionProvider createJweDecryptionProvider(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentDecryptionAlgo) -
createJweDecryptionProvider
public static JweDecryptionProvider createJweDecryptionProvider(JsonWebKey key, ContentAlgorithm contentDecryptionAlgo) -
createJweDecryptionProvider
public static JweDecryptionProvider createJweDecryptionProvider(KeyDecryptionProvider keyDecryptionProvider, ContentAlgorithm contentDecryptionAlgo) -
validateCriticalHeaders
-
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
-
getKeyEncryptionAlgorithm
public static KeyAlgorithm getKeyEncryptionAlgorithm(org.apache.cxf.message.Message m, Properties props, KeyAlgorithm algo, KeyAlgorithm defaultAlgo) -
getKeyEncryptionAlgorithm
-
getKeyEncryptionAlgorithm
public static KeyAlgorithm getKeyEncryptionAlgorithm(org.apache.cxf.message.Message m, Properties props, KeyAlgorithm defaultAlgo) -
getContentEncryptionAlgorithm
public static ContentAlgorithm getContentEncryptionAlgorithm(org.apache.cxf.message.Message m, Properties props, ContentAlgorithm algo, ContentAlgorithm defaultAlgo) -
getContentEncryptionAlgorithm
-
getContentEncryptionAlgorithm
public static ContentAlgorithm getContentEncryptionAlgorithm(Properties props, ContentAlgorithm defaultAlgo) -
getContentEncryptionAlgorithm
public static ContentAlgorithm getContentEncryptionAlgorithm(org.apache.cxf.message.Message m, Properties props, ContentAlgorithm defaultAlgo) -
loadEncryptionInProperties
-
loadEncryptionOutProperties
-
loadEncryptionProperties
-
checkEncryptionKeySize
-
loadPublicKeyEncryptionKeys
public static JsonWebKeys loadPublicKeyEncryptionKeys(org.apache.cxf.message.Message m, Properties props) -
loadJweProperties
-