com.nimbusds.jose.crypto.RSACryptoProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nimbus-jose-jwt Show documentation
Show all versions of nimbus-jose-jwt Show documentation
Java library for Javascript Object Signing and Encryption (JOSE) and
JSON Web Tokens (JWT)
package com.nimbusds.jose.crypto;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import com.nimbusds.jose.EncryptionMethod;
import com.nimbusds.jose.JWEAlgorithm;
/**
* The base abstract class for RSA encrypters and decrypters of
* {@link com.nimbusds.jose.JWEObject JWE objects}.
*
* Supports the following key management algorithms:
*
*
* - {@link com.nimbusds.jose.JWEAlgorithm#RSA1_5}
*
- {@link com.nimbusds.jose.JWEAlgorithm#RSA_OAEP}
*
- {@link com.nimbusds.jose.JWEAlgorithm#RSA_OAEP_256}
*
*
* Supports the following content encryption algorithms:
*
*
* - {@link com.nimbusds.jose.EncryptionMethod#A128CBC_HS256}
*
- {@link com.nimbusds.jose.EncryptionMethod#A192CBC_HS384}
*
- {@link com.nimbusds.jose.EncryptionMethod#A256CBC_HS512}
*
- {@link com.nimbusds.jose.EncryptionMethod#A128GCM}
*
- {@link com.nimbusds.jose.EncryptionMethod#A192GCM}
*
- {@link com.nimbusds.jose.EncryptionMethod#A256GCM}
*
- {@link com.nimbusds.jose.EncryptionMethod#A128CBC_HS256_DEPRECATED}
*
- {@link com.nimbusds.jose.EncryptionMethod#A256CBC_HS512_DEPRECATED}
*
*
* @author David Ortiz
* @author Vladimir Dzhuvinov
* @version 2015-05-26
*/
abstract class RSACryptoProvider extends BaseJWEProvider {
/**
* The supported JWE algorithms by the RSA crypto provider class.
*/
public static final Set SUPPORTED_ALGORITHMS;
/**
* The supported encryption methods by the RSA crypto provider class.
*/
public static final Set SUPPORTED_ENCRYPTION_METHODS = ContentCryptoProvider.SUPPORTED_ENCRYPTION_METHODS;
static {
Set algs = new LinkedHashSet<>();
algs.add(JWEAlgorithm.RSA1_5);
algs.add(JWEAlgorithm.RSA_OAEP);
algs.add(JWEAlgorithm.RSA_OAEP_256);
SUPPORTED_ALGORITHMS = Collections.unmodifiableSet(algs);
}
/**
* Creates a new RSA encryption / decryption provider.
*/
protected RSACryptoProvider() {
super(SUPPORTED_ALGORITHMS, ContentCryptoProvider.SUPPORTED_ENCRYPTION_METHODS);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy