Package org.pac4j.jwt.config.encryption
Class RSAEncryptionConfiguration
- java.lang.Object
-
- org.pac4j.core.util.InitializableObject
-
- org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
-
- org.pac4j.jwt.config.encryption.RSAEncryptionConfiguration
-
- All Implemented Interfaces:
EncryptionConfiguration
public class RSAEncryptionConfiguration extends AbstractEncryptionConfiguration
RSA encryption configuration.- Since:
- 1.9.2
- Author:
- Jerome Leleu
-
-
Field Summary
-
Fields inherited from class org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
algorithm, method
-
-
Constructor Summary
Constructors Constructor Description RSAEncryptionConfiguration()
RSAEncryptionConfiguration(KeyPair keyPair)
RSAEncryptionConfiguration(KeyPair keyPair, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.nimbusds.jose.JWEDecrypter
buildDecrypter()
Build the appropriate decrypter.protected com.nimbusds.jose.JWEEncrypter
buildEncrypter()
Build the appropriate encrypter.RSAPrivateKey
getPrivateKey()
RSAPublicKey
getPublicKey()
protected void
internalInit()
void
setKeyPair(KeyPair keyPair)
void
setKeysFromJwk(String json)
void
setPrivateKey(RSAPrivateKey privateKey)
void
setPublicKey(RSAPublicKey publicKey)
boolean
supports(com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
Whether this encryption configuration supports this algorithm and encryption method.String
toString()
-
Methods inherited from class org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
decrypt, encrypt, getAlgorithm, getMethod, setAlgorithm, setMethod
-
Methods inherited from class org.pac4j.core.util.InitializableObject
init, isInitialized
-
-
-
-
Constructor Detail
-
RSAEncryptionConfiguration
public RSAEncryptionConfiguration()
-
RSAEncryptionConfiguration
public RSAEncryptionConfiguration(KeyPair keyPair)
-
RSAEncryptionConfiguration
public RSAEncryptionConfiguration(KeyPair keyPair, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
-
-
Method Detail
-
supports
public boolean supports(com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
Description copied from interface:EncryptionConfiguration
Whether this encryption configuration supports this algorithm and encryption method.- Parameters:
algorithm
- the encryption algorithmmethod
- the encryption method- Returns:
- whether this encryption configuration supports this algorithm and encryption method
-
internalInit
protected void internalInit()
- Specified by:
internalInit
in classInitializableObject
-
buildEncrypter
protected com.nimbusds.jose.JWEEncrypter buildEncrypter()
Description copied from class:AbstractEncryptionConfiguration
Build the appropriate encrypter.- Specified by:
buildEncrypter
in classAbstractEncryptionConfiguration
- Returns:
- the appropriate encrypter
-
buildDecrypter
protected com.nimbusds.jose.JWEDecrypter buildDecrypter()
Description copied from class:AbstractEncryptionConfiguration
Build the appropriate decrypter.- Specified by:
buildDecrypter
in classAbstractEncryptionConfiguration
- Returns:
- the appropriate decrypter
-
setKeyPair
public void setKeyPair(KeyPair keyPair)
-
getPublicKey
public RSAPublicKey getPublicKey()
-
setPublicKey
public void setPublicKey(RSAPublicKey publicKey)
-
getPrivateKey
public RSAPrivateKey getPrivateKey()
-
setPrivateKey
public void setPrivateKey(RSAPrivateKey privateKey)
-
setKeysFromJwk
public void setKeysFromJwk(String json)
-
-