Package com.nimbusds.jose.crypto.impl
Class RSA1_5
- java.lang.Object
-
- com.nimbusds.jose.crypto.impl.RSA1_5
-
@ThreadSafe public class RSA1_5 extends java.lang.ObjectRSAES-PKCS1-V1_5 methods for Content Encryption Key (CEK) encryption and decryption. This class is thread-safe.- Version:
- 2021-09-24
- Author:
- Vladimir Dzhuvinov
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.crypto.SecretKeydecryptCEK(java.security.PrivateKey priv, byte[] encryptedCEK, int keyLength, java.security.Provider provider)Decrypts the specified encrypted Content Encryption Key (CEK).static byte[]encryptCEK(java.security.interfaces.RSAPublicKey pub, javax.crypto.SecretKey cek, java.security.Provider provider)Encrypts the specified Content Encryption Key (CEK).
-
-
-
Method Detail
-
encryptCEK
public static byte[] encryptCEK(java.security.interfaces.RSAPublicKey pub, javax.crypto.SecretKey cek, java.security.Provider provider) throws JOSEExceptionEncrypts the specified Content Encryption Key (CEK).- Parameters:
pub- The public RSA key. Must not benull.cek- The Content Encryption Key (CEK) to encrypt. Must not benull.provider- The JCA provider, ornullto use the default one.- Returns:
- The encrypted Content Encryption Key (CEK).
- Throws:
JOSEException- If encryption failed.
-
decryptCEK
public static javax.crypto.SecretKey decryptCEK(java.security.PrivateKey priv, byte[] encryptedCEK, int keyLength, java.security.Provider provider) throws JOSEExceptionDecrypts the specified encrypted Content Encryption Key (CEK).- Parameters:
priv- The private RSA key. Must not benull.encryptedCEK- The encrypted Content Encryption Key (CEK) to decrypt. Must not benull.provider- The JCA provider, ornullto use the default one.- Returns:
- The decrypted Content Encryption Key (CEK),
nullif there was a CEK key length mismatch. - Throws:
JOSEException- If decryption failed.
-
-