@ThreadSafe public class RSA_OAEP_SHA2 extends Object
Modifier and Type | Method and Description |
---|---|
static SecretKey |
decryptCEK(PrivateKey priv,
byte[] encryptedCEK,
int shaBitSize,
Provider provider)
Decrypts the specified encrypted Content Encryption Key (CEK).
|
static byte[] |
encryptCEK(RSAPublicKey pub,
SecretKey cek,
int shaBitSize,
Provider provider)
Encrypts the specified Content Encryption Key (CEK).
|
public static byte[] encryptCEK(RSAPublicKey pub, SecretKey cek, int shaBitSize, Provider provider) throws JOSEException
pub
- The public RSA key. Must not be null
.cek
- The Content Encryption Key (CEK) to encrypt. Must
not be null
.shaBitSize
- The SHA-2 bit size. Must be 256, 384 or 512.provider
- The JCA provider, or null
to use the
default one.JOSEException
- If encryption failed.public static SecretKey decryptCEK(PrivateKey priv, byte[] encryptedCEK, int shaBitSize, Provider provider) throws JOSEException
priv
- The private RSA key. Must not be null
.encryptedCEK
- The encrypted Content Encryption Key (CEK) to
decrypt. Must not be null
.shaBitSize
- The SHA-2 bit size. Must be 256 or 512.provider
- The JCA provider, or null
to use the
default one.JOSEException
- If decryption failed.Copyright © 2021 Connect2id Ltd.. All rights reserved.