Class JwkUtils
java.lang.Object
org.apache.cxf.rs.security.jose.jwk.JwkUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic JsonWebKeydecodeJwkKey(String jwkJson) static JsonWebKeysdecodeJwkSet(String jwksJson) static JsonWebKeydecryptJwkKey(InputStream is, char[] password) static JsonWebKeystatic JsonWebKeydecryptJwkKey(String jsonJwkKey, char[] password) static JsonWebKeydecryptJwkKey(String jsonJwkKey, JweDecryptionProvider jwe) static JsonWebKeydecryptJwkKey(PrivateKey key, KeyAlgorithm keyAlgo, ContentAlgorithm ctAlgo, String jsonJwk) static JsonWebKeydecryptJwkKey(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm ctAlgo, String jsonJwk) static JsonWebKeysdecryptJwkSet(InputStream is, char[] password) static JsonWebKeysstatic JsonWebKeysdecryptJwkSet(String jsonJwkSet, char[] password) static JsonWebKeysdecryptJwkSet(String jsonJwkSet, JweDecryptionProvider jwe) static JsonWebKeysdecryptJwkSet(PrivateKey key, KeyAlgorithm keyAlgo, ContentAlgorithm ctAlgo, String jsonJwkSet) static JsonWebKeysdecryptJwkSet(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm ctAlgo, String jsonJwkSet) static StringencodeJwkKey(JsonWebKey jwkKey) static StringencodeJwkSet(JsonWebKeys jwkSet) static StringencryptJwkKey(JsonWebKey jwkKey, char[] password) static StringencryptJwkKey(JsonWebKey jwkKey, PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo) static StringencryptJwkKey(JsonWebKey jwkKey, SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo) static StringencryptJwkKey(JsonWebKey jwkKey, JweEncryptionProvider jwe) static StringencryptJwkSet(JsonWebKeys jwkSet, char[] password) static StringencryptJwkSet(JsonWebKeys jwkSet, PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo) static StringencryptJwkSet(JsonWebKeys jwkSet, SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo) static StringencryptJwkSet(JsonWebKeys jwkSet, JweEncryptionProvider jwe) static JsonWebKeyfromECPrivateKey(ECPrivateKey pk, String curve) static JsonWebKeyfromECPrivateKey(ECPrivateKey pk, String curve, String kid) static JsonWebKeyfromECPublicKey(ECPublicKey pk, String curve) static JsonWebKeyfromECPublicKey(ECPublicKey pk, String curve, String kid) static JsonWebKeyfromPublicKey(PublicKey key, Properties props, String algoProp) static JsonWebKeyfromRSAPrivateKey(RSAPrivateKey pk, String algo) static JsonWebKeyfromRSAPrivateKey(RSAPrivateKey pk, String algo, String kid) static JsonWebKeyfromRSAPublicKey(RSAPublicKey pk, String algo) static JsonWebKeyfromRSAPublicKey(RSAPublicKey pk, String algo, String kid) static JsonWebKeyfromSecretKey(SecretKey secretKey, String algo) static JsonWebKeyfromSecretKey(SecretKey secretKey, String algo, String kid) static JsonWebKeyfromX509CertificateChain(List<X509Certificate> chain, String algo) getRequiredFields(KeyType keyType) static StringgetThumbprint(String keySequence) static StringgetThumbprint(JsonWebKey key) static voidincludeCertChain(JsonWebKey jwk, JoseHeaders headers, String algo) static voidincludePublicKey(JsonWebKey jwk, JoseHeaders headers, String algo) static StringjwkKeyToJson(JsonWebKey jwkKey) static voidjwkKeyToJson(JsonWebKey jwkKey, OutputStream os) static StringjwkSetToJson(JsonWebKeys jwkSet) static voidjwkSetToJson(JsonWebKeys jwkSet, OutputStream os) static JsonWebKeyloadJsonWebKey(Message m, Properties props, KeyOperation keyOper) static JsonWebKeyloadJsonWebKey(Message m, Properties props, KeyOperation keyOper, String inHeaderKid) static List<JsonWebKey>loadJsonWebKeys(Message m, Properties props, KeyOperation keyOper) static List<JsonWebKey>loadJsonWebKeys(Message m, Properties props, KeyOperation keyOper, PrivateKeyPasswordProvider cb) static JsonWebKeysloadJwkSet(Properties props, Bus bus, JweDecryptionProvider jwe) static JsonWebKeysloadJwkSet(Properties props, Bus bus, PrivateKeyPasswordProvider cb) static JsonWebKeysloadJwkSet(Message m, Properties props, PrivateKeyPasswordProvider cb) static JsonWebKeysloadPublicJwkSet(Message m, Properties props) static JsonWebKeystatic JsonWebKeyreadJwkKey(String jwkJson) static JsonWebKeyreadJwkKey(URI uri) static JsonWebKeysstatic JsonWebKeysreadJwkSet(String jwksJson) static JsonWebKeysreadJwkSet(URI uri) static StringsignJwkKey(JsonWebKey jwkKey, PrivateKey key, SignatureAlgorithm algo) static StringsignJwkSet(JsonWebKeys jwkSet, PrivateKey key, SignatureAlgorithm algo) static List<JsonWebKey>stripPrivateParameters(List<JsonWebKey> keys) static ECPrivateKeytoECPrivateKey(JsonWebKey jwk) static ECPublicKeytoECPublicKey(JsonWebKey jwk) static RSAPrivateKeystatic RSAPublicKeytoRSAPublicKey(JsonWebKey jwk) static RSAPublicKeytoRSAPublicKey(JsonWebKey jwk, boolean checkX509) static SecretKeytoSecretKey(JsonWebKey jwk) static SecretKeytoSecretKey(JsonWebKey jwk, KeyAlgorithm algorithm) static List<X509Certificate>static JsonWebKeyverifyJwkKey(PublicKey key, SignatureAlgorithm keyAlgo, String jsonJwk) static JsonWebKeysverifyJwkSet(PublicKey key, SignatureAlgorithm keyAlgo, String jsonJwk)
-
Method Details
-
getThumbprint
-
getThumbprint
-
getRequiredFields
-
readJwkKey
- Throws:
IOException
-
readJwkSet
- Throws:
IOException
-
readJwkKey
- Throws:
IOException
-
readJwkSet
- Throws:
IOException
-
readJwkKey
-
readJwkSet
-
jwkKeyToJson
-
jwkKeyToJson
- Throws:
IOException
-
jwkSetToJson
-
jwkSetToJson
- Throws:
IOException
-
encodeJwkKey
-
encodeJwkSet
-
decodeJwkKey
-
decodeJwkSet
-
encryptJwkSet
-
encryptJwkSet
-
encryptJwkSet
public static String encryptJwkSet(JsonWebKeys jwkSet, PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo) -
signJwkSet
-
encryptJwkSet
public static String encryptJwkSet(JsonWebKeys jwkSet, SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo) -
decryptJwkSet
-
decryptJwkSet
-
decryptJwkSet
public static JsonWebKeys decryptJwkSet(PrivateKey key, KeyAlgorithm keyAlgo, ContentAlgorithm ctAlgo, String jsonJwkSet) -
verifyJwkSet
-
decryptJwkSet
public static JsonWebKeys decryptJwkSet(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm ctAlgo, String jsonJwkSet) -
decryptJwkSet
- Throws:
IOException
-
decryptJwkSet
public static JsonWebKeys decryptJwkSet(InputStream is, JweDecryptionProvider jwe) throws IOException - Throws:
IOException
-
encryptJwkKey
-
encryptJwkKey
-
encryptJwkKey
public static String encryptJwkKey(JsonWebKey jwkKey, PublicKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo) -
encryptJwkKey
public static String encryptJwkKey(JsonWebKey jwkKey, SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm contentAlgo) -
signJwkKey
-
decryptJwkKey
-
decryptJwkKey
public static JsonWebKey decryptJwkKey(PrivateKey key, KeyAlgorithm keyAlgo, ContentAlgorithm ctAlgo, String jsonJwk) -
verifyJwkKey
-
decryptJwkKey
public static JsonWebKey decryptJwkKey(SecretKey key, KeyAlgorithm keyAlgo, ContentAlgorithm ctAlgo, String jsonJwk) -
decryptJwkKey
-
decryptJwkKey
- Throws:
IOException
-
decryptJwkKey
public static JsonWebKey decryptJwkKey(InputStream is, JweDecryptionProvider jwe) throws IOException - Throws:
IOException
-
loadPublicJwkSet
-
loadJwkSet
-
loadJwkSet
-
loadJwkSet
-
loadJsonWebKey
-
loadJsonWebKey
public static JsonWebKey loadJsonWebKey(Message m, Properties props, KeyOperation keyOper, String inHeaderKid) -
loadJsonWebKeys
-
loadJsonWebKeys
public static List<JsonWebKey> loadJsonWebKeys(Message m, Properties props, KeyOperation keyOper, PrivateKeyPasswordProvider cb) -
toRSAPublicKey
-
toRSAPublicKey
-
toX509CertificateChain
-
fromECPublicKey
-
fromECPublicKey
-
fromECPrivateKey
-
fromECPrivateKey
-
fromRSAPublicKey
-
fromRSAPublicKey
-
fromPublicKey
-
fromX509CertificateChain
-
toRSAPrivateKey
-
fromRSAPrivateKey
-
fromRSAPrivateKey
-
toECPublicKey
-
toECPrivateKey
-
toSecretKey
-
toSecretKey
-
fromSecretKey
-
fromSecretKey
-
includeCertChain
-
includePublicKey
-
stripPrivateParameters
-