All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nimbusds.jose.crypto.RSACryptoProvider Maven / Gradle / Ivy

Go to download

Java library for Javascript Object Signing and Encryption (JOSE) and JSON Web Tokens (JWT)

There is a newer version: 10.0.2
Show newest version
package com.nimbusds.jose.crypto;


import java.util.Collections;
import java.util.HashSet;
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 JSON Web Algorithms (JWAs): * *

    *
  • {@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 encryption methods: * *

    *
  • {@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 $version$ (2014-05-23) */ abstract class RSACryptoProvider extends BaseJWEProvider { /** * The supported JWE algorithms. */ public static final Set SUPPORTED_ALGORITHMS; /** * The supported encryption methods. */ public static final Set SUPPORTED_ENCRYPTION_METHODS; /** * Initialises the supported algorithms and encryption methods. */ static { Set algs = new HashSet<>(); algs.add(JWEAlgorithm.RSA1_5); algs.add(JWEAlgorithm.RSA_OAEP); algs.add(JWEAlgorithm.RSA_OAEP_256); SUPPORTED_ALGORITHMS = Collections.unmodifiableSet(algs); Set methods = new HashSet<>(); methods.add(EncryptionMethod.A128CBC_HS256); methods.add(EncryptionMethod.A192CBC_HS384); methods.add(EncryptionMethod.A256CBC_HS512); methods.add(EncryptionMethod.A128GCM); methods.add(EncryptionMethod.A192GCM); methods.add(EncryptionMethod.A256GCM); methods.add(EncryptionMethod.A128CBC_HS256_DEPRECATED); methods.add(EncryptionMethod.A256CBC_HS512_DEPRECATED); SUPPORTED_ENCRYPTION_METHODS = Collections.unmodifiableSet(methods); } /** * Creates a new RSA encryption / decryption provider. */ protected RSACryptoProvider() { super(SUPPORTED_ALGORITHMS, SUPPORTED_ENCRYPTION_METHODS); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy