com.aliyun.oss.crypto

## 类 SimpleRSAEncryptionMaterials

- java.lang.Object
- - com.aliyun.oss.crypto.SimpleRSAEncryptionMaterials

- 所有已实现的接口:
    EncryptionMaterials

      public class SimpleRSAEncryptionMaterials
      extends Object
      implements EncryptionMaterials

  This provide a simple rsa encryption materials for client-side encryption.

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `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.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 字段详细资料

    - #### KEY_WRAP_ALGORITHM

          public static final String KEY_WRAP_ALGORITHM

      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### SimpleRSAEncryptionMaterials

          public SimpleRSAEncryptionMaterials(KeyPair keyPair)

    - #### SimpleRSAEncryptionMaterials

          public SimpleRSAEncryptionMaterials(KeyPair keyPair,
                                      Map<String,String> desc)

  - ### 方法详细资料

    - #### addKeyPairDescMaterial

          public void addKeyPairDescMaterial(KeyPair keyPair,
                                    Map<String,String> description)

      Add a key pair and its descrption for decrypting data.
      参数:
        `keyPair` - The RSA key pair.
        `description` - The descripton of encryption materails.

    - #### encryptCEK

          public void encryptCEK(ContentCryptoMaterialRW contentMaterialRW)

      Encrypt the content encryption key(cek) and iv, and put the result into `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.

    - #### decryptCEK

          public void decryptCEK(ContentCryptoMaterialRW contentMaterialRW)

      Decrypt the encrypted content encryption key(cek) and encrypted iv and put the result into `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.

    - #### getPrivateKeyFromPemPKCS1

          public static RSAPrivateKey getPrivateKeyFromPemPKCS1(String privateKeyStr)

      Gets a rsa private key from PKCS1 pem string.
      返回:
        a new rsa private key

    - #### getPrivateKeyFromPemPKCS8

          public static RSAPrivateKey getPrivateKeyFromPemPKCS8(String privateKeyStr)

      Gets a rsa private key from PKCS8 pem string.
      返回:
        a new rsa private key

    - #### getPublicKeyFromPemX509

          public static RSAPublicKey getPublicKeyFromPemX509(String publicKeyStr)

      Gets a rsa public key from PKCS8 pem string.
      返回:
        a new rsa public key

Copyright © 2020. All Rights Reserved.