public class SimpleRSAEncryptionMaterials extends Object implements EncryptionMaterials
限定符和类型 | 字段和说明 |
---|---|
static String |
KEY_WRAP_ALGORITHM |
构造器和说明 |
---|
SimpleRSAEncryptionMaterials(KeyPair keyPair) |
SimpleRSAEncryptionMaterials(KeyPair keyPair,
Map<String,String> desc) |
限定符和类型 | 方法和说明 |
---|---|
void |
addKeyPairDescMaterial(KeyPair keyPair,
Map<String,String> description)
Add a key pair and its descrption for decrypting data.
|
void |
decryptCEK(ContentCryptoMaterialRW contentMaterialRW)
Decrypt the encrypted content encryption key(cek) and encrypted iv and put
the result into
ContentCryptoMaterialRW . |
void |
encryptCEK(ContentCryptoMaterialRW contentMaterialRW)
Encrypt the content encryption key(cek) and iv, and put the result into
ContentCryptoMaterialRW . |
static RSAPrivateKey |
getPrivateKeyFromPemPKCS1(String privateKeyStr)
Gets a rsa private key from PKCS1 pem string.
|
static RSAPrivateKey |
getPrivateKeyFromPemPKCS8(String privateKeyStr)
Gets a rsa private key from PKCS8 pem string.
|
static RSAPublicKey |
getPublicKeyFromPemX509(String publicKeyStr)
Gets a rsa public key from PKCS8 pem string.
|
public SimpleRSAEncryptionMaterials(KeyPair keyPair)
public void addKeyPairDescMaterial(KeyPair keyPair, Map<String,String> description)
keyPair
- The RSA key pair.description
- The descripton of encryption materails.public void encryptCEK(ContentCryptoMaterialRW contentMaterialRW)
ContentCryptoMaterialRW
.encryptCEK
在接口中 EncryptionMaterials
contentMaterialRW
- The materials that contans all content crypto info,
it must be constructed on outside and filled with the iv cek parameters.
Then it will be builed with the encrypted cek ,encrypted iv, key wrap
algorithm and encryption materials description by this method.public void decryptCEK(ContentCryptoMaterialRW contentMaterialRW)
ContentCryptoMaterialRW
.decryptCEK
在接口中 EncryptionMaterials
contentMaterialRW
- The materials that contans all content crypto info,
it must be constructed on outside and filled with
the encrypted cek ,encrypted iv, key wrap algorithm,
encryption materials description and cek generator
algothrim. Then it will be builded with the cek and iv.public static RSAPrivateKey getPrivateKeyFromPemPKCS1(String privateKeyStr)
public static RSAPrivateKey getPrivateKeyFromPemPKCS8(String privateKeyStr)
public static RSAPublicKey getPublicKeyFromPemX509(String publicKeyStr)
Copyright © 2020. All Rights Reserved.