

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# CSE-CUSTOM 설정
<a name="emr-s3a-cse-custom"></a>

CSE-CUSTOM을 사용하려면 [키링](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html) 인터페이스를 구현하여 사용자 지정 키 공급자를 생성합니다. 다음은 샘플 구현입니다.

```
public class CustomKeyring implements Keyring {
  public CustomKeyring()  {
    // custom code
  }

  @Override
  public EncryptionMaterials onEncrypt(EncryptionMaterials encryptionMaterials) {
    // custom code
  }

  @Override
  public DecryptionMaterials onDecrypt(DecryptionMaterials decryptionMaterials,
      ListEncryptedDataKey list) {
    // custom code
  }
```

두 가지 기본 범위에서 클라이언트 측 암호화 사용자 지정 키(CSE-CUSTOM)를 활성화할 수 있습니다.
+ 첫 번째 범위는 클러스터 전체 구성입니다.

  ```
  [
    {
      "Classification":"core-site",
      "Properties": {
         "fs.s3a.encryption.algorithm": "CSE-CUSTOM",
         "fs.s3a.cse.customKeyringProvider.uri":"S3 path of custom jar",
         "fs.s3a.encryption.cse.custom.keyring.class.name":"fully qualified class name"
      }
    }
  ]
  ```
+ 두 번째는 작업 또는 애플리케이션별 구성입니다. CSE-CUSTOM은 다음과 같이 특정 Spark 애플리케이션에 대해 설정할 수 있습니다.

  ```
  spark-submit --conf spark.hadoop.fs.s3a.encryption.algorithm=CSE-CUSTOM --conf spark.hadoop.fs.s3a.encryption.cse.custom.keyring.class.name=fully qualified class name
  ```
**참고**  
암호화/복호화 키를 생성하는 데 필요한 사용자 지정 jar이 클래스 경로에 있는지 확인합니다.