대칭 전송 키 (키 암호화 키)
IBM Common Cryptographic Architecture (CCA) 에는 키 분리라고 하는 기능이 있습니다. 여기서 키를 고유한 사용 유형으로 분리하여 키 사용을 제어하며, 의도한 용도로만 특정 유형의 키를 사용할 수 있습니다. 예를 들어, 데이터를 보호하는 데 사용되는 키는 키를 보호하는 데 사용할 수 없습니다.
IBMJCECCA 제공자는 기본적으로 DATA 암호화 키의 대칭 키 생성을 지원합니다. 이 키 사용 유형은 대칭 키 사이에서 가장 일반적으로 사용되며 데이터 개인정보 보호에 사용됩니다. DATA 암호화 키 외에도 IBMJCECCA 제공자는 키 암호화 키라고도 하는 전송 키를 생성할 수 있습니다. 전송 키는 한 시스템에서 다른 시스템으로 분배하는 동안 키를 보호하는 데 사용됩니다. IBMJCECCA 제공자가 지원하는 전송 키 유형은 다음과 같습니다.
- 더블 길이 112비트 EXPORTER 삼중 DES 키
- 두 배 길이 112비트 IMPORTER 삼중 DES 키
- EXPORTER AES키의 모든 길이
- IMPORTER AES키의 모든 길이
전송 키는 키 생성기를 통해 생성되거나 Diffie-Hellman키 계약을 통해 파생될 수 있습니다. 두 경우 모두 키 생성기 또는 키 계약은 전송 키 생성 또는 키 파생과 관련된 암호화 매개변수를 포함하는 AlgorithmParameterSpec 오브젝트를 사용하여 초기화되어야 합니다.
z/OS®에서 CKDS 유형 AES 전송 키에는 가변 길이 레코드를 지원하는 CKDS가 필요합니다. 자세한 정보는 ICSF System Programmer's Guide 의 Converting a CKDS from fixed length to variable length record format
절을 참조하거나 시스템 관리자에게 문의하십시오.
일반적으로 IBMJCECCA 제공자를 통해 생성되는 전송 키로 보호되는 키는 IBM Z® 시스템 간에만 분배될 수 있습니다. IBM Z 시스템에서 제어 벡터를 사용하여 제공되는 추가 보안으로 인해, 올바른 IMPORTER키가 사용되는 경우에도 IBM Z 시스템에서 전송 키로 보호되는 키가 IBM Z가 아닌 시스템에서 올바르게 재구성될 수 없습니다.
NoCvKEK 이 있는 트리플 DES 전송 키를 사용하면 z가 아닌 시스템과 키를 교환할 수 있습니다. NoCvKEK 있는 트리플 DES 전송 키를 사용하여 z 시스템과 키를 교환할 수도 있지만, NoCvKEK 전송 키는 제어 벡터를 사용하지 않기 때문에 키 교환의 보안이 약화됩니다. NoCvKEK 키를 만들 때 또는 키를 가져올 때 트리플 DES 전송 키에 대해 지정할 수 있습니다. CCA 키 저장 영역의 트리플 DES 전송 키만 NoCvKEK 가질 수 있습니다.
IBMJCECCA키 생성기는 EXPORTER/IMPORTER쌍 또는 IMPORTER/EXPORTER쌍으로 구성된 OPEX 양식으로 전송 키를 생성합니다. OPEX는 첫 번째 키가 조작 (OP) 양식이고 로컬 시스템에서 사용할 수 있으며 두 번째 키가 시스템에서 사용하기 전에 가져와야 하는 내보내기 가능 (EX) 양식인 키 쌍을 참조합니다. 조작 (OP) 키는 로컬 기본 키에 의해 직접 암호화되며 Java™ 에서 Key 오브젝트로 표시됩니다. 반면에 내보내기 가능 (EX) 키는 Java에서 랩핑된 키와 유사합니다. 내보내기 가능 (EX) 키는 기존 조작 (OP) EXPORTER키에 의해 암호화되며 Java에서 바이트 배열로 표시됩니다.
IBM Common Cryptographic Architecture (CCA) 에서 지원하는 키 사용 유형 및 키 양식에 대한 자세한 설명은 Cryptographic Services Integrated Cryptographic Service Facility Application Programmer's Guide의 Functions of the Symmetric Cryptographic Keys
절을 참조하십시오. CCA에서 사용 가능한 모든 키 사용 유형 및 키 양식이 IBMJCECCA 제공자에 의해 지원되는 것은 아닙니다. 또한 IBMJCECCA 제공자는 CCA에서 사용 가능한 전송 키 기능의 일부만 지원합니다.
IBMJCECCA키 생성기를 사용하여 전송 키를 생성하려면 기존 전송 키가 필요합니다. 따라서 전송 키가 없는 시스템은 키 생성기를 사용하여 전송 키를 생성할 수 없습니다. 이러한 시스템에 대한 솔루션은 IBMJCECCA의 Diffie-Hellman키 계약 기능을 사용하여 초기 전송 키를 파생시키는 것입니다.
IBMJCECCA 제공자가 현재 지원하는 유일한 유형의 Diffie-Hellman키 계약인 Elliptic Curve키를 사용하는 두 파티 Diffie-Hellman키 계약 스킴에서 한 시스템은 조작 (OP) EXPORTER키를 파생시키는 반면 다른 시스템은 일치하는 조작 (OP) IMPORTER키를 파생시킵니다. 키 계약을 통해 파생된 키는 모두 작동 키이므로 이 경우 기존 전송 키가 필요하지 않습니다. Elliptic Curve키를 사용하는 Diffie-Hellman키 계약에 대한 자세한 정보는 EC 조작을 참조하십시오.
IBMJCECCA KeyGenerator 클래스의 인스턴스를 사용하여 Triple DES 또는 AES 전송 키를 생성할 때 키 생성기가 리턴하는 com.ibm.crypto.hdwrCCA.provider.DESedeKey 또는 com.ibm.crypto.hdwrCCA.provider.AESKey 오브젝트는 OPEX키 쌍의 조작 (OP) 키를 나타냅니다. 이 조작 키는 다른 Java키와 마찬가지로 시스템에서 직접 사용할 수 있습니다.
그러나 키 생성기에 의해 생성된 일치하는 내보내기 가능 (EX) 키는 Java키 오브젝트가 아니므로 시스템에서 직접 사용할 수 없습니다. 암호화 암호를 사용하여 랩핑되는 다른 키와 유사하게, 다른 시스템으로 내보내기 위한 외부 키 토큰 형식이며 Java에서 바이트 배열로 표시됩니다. 키 생성기에서 리턴 시, 이 일치하는 내보내기 가능 (EX) 키 토큰은 리턴된 조작 (OP) 키에서 getPairedExternalToken() 공용 메소드를 호출하여 검색할 수 있습니다. 그런 다음 키 토큰을 다른 시스템에서 가져오거나 랩핑 해제하여 동등한 운영 Java키 오브젝트를 작성할 수 있습니다.
IBMJCECCA키 생성기가 생성된 내보내기 가능 (EX) 키 토큰을 조작 (OP) 키를 나타내는 리턴된 Java키 오브젝트에 저장하지만, 내보내기 가능 (EX) 키는 조작 (OP) 키의 일부로 간주되지 않습니다. 결과적으로, 리턴된 조작 (OP) Java키 오브젝트에 저장된 내보내기 가능 (EX) 키를 나타내는 키 토큰 값은 조작 (OP) 키의 키 스펙을 사용하거나 암호화 암호를 사용하여 조작 키 (OP) 의 랩핑 및 랩핑 해제를 통해 SecretKeyFactory 인스턴스를 통해 조작 (OP) 키가 재구성될 때 지속되지 않습니다. 재구성된 조작 (OP) 키에서 getPairedExternalToken() 메소드를 호출하면 null가 리턴됩니다. 키 생성기에 의해 생성된 후 즉시 내보낼 수 있는 (EX) 키의 외부 키 토큰을 검색해야 합니다.
대칭 전송 키 생성
// use CCAAlgorithmParameterSpec to specify key size of 168
//
CCAAlgorithmParameterSpec ccaAlgParmSpec = new CCAAlgorithmParameterSpec(168);
// request that an operational DATA key is to be generated
//
ccaAlgParmSpec.setKeyUsage(KeyUsage.OP_DATA);
KeyGenerator keyGenerator = KeyGenerator.getInstance("DESede", "IBMJCECCA");
keyGenerator.init(ccaAlgParmSpec, null);
// this key object represents the generated operational (OP) DATA key
//
SecretKey tdesDataKey = keyGenerator.generateKey();tdesPrimaryExporter이라는 기존의 3중 DES EXPORTER키 아래에서 암호화되는 하드웨어 키 토큰인 3중 DES 하드웨어 EXPORTER/IMPORTER 전송 키 쌍을 생성하는 것을 보여줍니다.// use CCAAlgorithmParameterSpec to specify key size of 112
//
CCAAlgorithmParameterSpec ccaAlgParmSpec = new CCAAlgorithmParameterSpec(112);
// request that a transport key pair is to be generated
// first key is an operational (OP) EXPORTER key
// second key is an exportable (EX) IMPORTER key
//
ccaAlgParmSpec.setKeyUsage(KeyUsage.OPEX_EXPORTER_IMPORTER);
// specify an existing triple DES EXPORTER key to be used for
// enciphering the generated IMPORTER key
//
ccaAlgParmSpec.setKey2KeyEncryptingKey(tdesPrimaryExporter);
KeyGenerator keyGenerator = KeyGenerator.getInstance("DESede", "IBMJCECCA");
keyGenerator.init(ccaAlgParmSpec, null);
// this key object represents the generated operational (OP) EXPORTER key
//
DESedeKey tdesExporterKey = (com.ibm.crypto.hdwrCCA.provider.DESedeKey) keyGenerator.generateKey();
// this is the exportable (EX) IMPORTER hardware key token, which is
// enciphered (wrapped) under an existing triple DES EXPORTER key named tdesPrimaryExporter
//
byte[] tdesImporterToken = tdesExporterKey.getPairedExternalToken();tdesPrimaryExporter이라는 기존의 3중 DES EXPORTER키 아래에서 암호화되는 하드웨어 키 토큰인 3중 DES 하드웨어 IMPORTER/EXPORTER 전송 키 쌍을 생성하는 것을 설명합니다.// use CCAAlgorithmParameterSpec to specify key size of 112, in
// addition, specify that the generated operational key is to be stored
// in the CCA key storage area
//
CCAAlgorithmParameterSpec ccaAlgParmSpec = new CCAAlgorithmParameterSpec(
112, CCAAlgorithmParameterSpec.CKDS);
// request that a transport key pair is to be generated
// first key is an operational (OP) IMPORTER key
// second key is an exportable (EX) EXPORTER key
//
ccaAlgParmSpec.setKeyUsage(KeyUsage.OPEX_IMPORTER_EXPORTER);
// specify an existing triple DES EXPORTER key to be used for
// enciphering the generated EXPORTER key
//
ccaAlgParmSpec.setKey2KeyEncryptingKey(tdesPrimaryExporter);
KeyGenerator keyGenerator = KeyGenerator.getInstance("DESede", "IBMJCECCA");
keyGenerator.init(ccaAlgParmSpec, null);
// this key object represents the generated operational (OP) IMPORTER
// key, and contains a label for the corresponding CCA key storage area entry
//
DESedeKey tdesImporterKey = (com.ibm.crypto.hdwrCCA.provider.DESedeKey) keyGenerator.generateKey();
// this is the exportable (EX) EXPORTER hardware key token, which is
// enciphered under an existing triple DES EXPORTER key named tdesPrimaryExporter
//
byte[] tdesExporterToken = tdesImporterKey.getPairedExternalToken();// use CCAAlgorithmParameterSpec to specify key size of 192
//
CCAAlgorithmParameterSpec ccaAlgParmSpec = new CCAAlgorithmParameterSpec(192);
// request that an operational DATA key is to be generated
//
ccaAlgParmSpec.setKeyUsage(KeyUsage.OP_DATA);
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES", "IBMJCECCA");
keyGenerator.init(ccaAlgParmSpec, null);
// this key object represents the generated operational (OP) DATA key
//
SecretKey aesDataKey = keyGenerator.generateKey();aesPrimaryExporter라는 기존 AES EXPORTER키 아래에 암호화된 하드웨어 키 토큰입니다.// use CCAAlgorithmParameterSpec to specify key size of 256
//
CCAAlgorithmParameterSpec ccaAlgParmSpec = new CCAAlgorithmParameterSpec(256);
// request that a transport key pair is to be generated
// first key is an operational (OP) EXPORTER key
// second key is an exportable (EX) IMPORTER key
//
ccaAlgParmSpec.setKeyUsage(KeyUsage.OPEX_EXPORTER_IMPORTER);
// specify an existing AES EXPORTER key to be used for
// enciphering the generated IMPORTER key
//
ccaAlgParmSpec.setKey2KeyEncryptingKey(aesPrimaryExporter);
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES", "IBMJCECCA");
keyGenerator.init(ccaAlgParmSpec, null);
// this key object represents the generated operational (OP) EXPORTER key
//
AESKey aesExporterKey = (com.ibm.crypto.hdwrCCA.provider.AESKey) keyGenerator.generateKey();
// this is the exportable (EX) IMPORTER hardware key token, which is
// enciphered (wrapped) under an existing AES EXPORTER key named aesPrimaryExporter
//
byte[] aesImporterToken = aesExporterKey.getPairedExternalToken();aesPrimaryExporter: 아래에서 암호화되는 하드웨어 키 토큰입니다.// use CCAAlgorithmParameterSpec to specify key size of 128, in
// addition, specify that the generated operational key is to be stored
// in the CCA key storage area
//
CCAAlgorithmParameterSpec ccaAlgParmSpec = new CCAAlgorithmParameterSpec(
128, CCAAlgorithmParameterSpec.CKDS);
// request that a transport key pair is to be generated
// first key is an operational (OP) IMPORTER key
// second key is an exportable (EX) EXPORTER key
//
ccaAlgParmSpec.setKeyUsage(KeyUsage.OPEX_IMPORTER_EXPORTER);
// specify an existing AES EXPORTER key to be used for
// enciphering the generated EXPORTER key
//
ccaAlgParmSpec.setKey2KeyEncryptingKey(aesPrimaryExporter);
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES", "IBMJCECCA");
keyGenerator.init(ccaAlgParmSpec, null);
// this key object represents the generated operational (OP) IMPORTER
// key, and contains a label for the corresponding CCA key storage area entry
//
AESKey aesImporterKey = (com.ibm.crypto.hdwrCCA.provider.AESKey) keyGenerator.generateKey();
// this is the exportable (EX) EXPORTER hardware key token, which is
// enciphered under an existing AES EXPORTER key named aesPrimaryExporter
//
byte[] aesExporterToken = aesImporterKey.getPairedExternalToken();NoCvKEK 사용하여 대칭 전송 키 생성
tdesPrimaryExporter 라는 기존 Triple DES EXPORTER 키로 암호화된 하드웨어 키 토큰입니다// Use CCAAlgorithmParameterSpec to specify key size of 112 and that
// the generated operational key is to be stored in the CCA key storage area.
// Only a Triple DES transport key in the CCA key storage area can have the NoCvKEK
// option enabled.
//
CCAAlgorithmParameterSpec ccaAlgParmSpec = new CCAAlgorithmParameterSpec(
112, CCAAlgorithmParameterSpec.CKDS);
// request that a transport key pair is to be generated
// first key is an operational (OP) EXPORTER key
// second key is an exportable (EX) IMPORTER key
//
ccaAlgParmSpec.setKeyUsage(KeyUsage.OPEX_EXPORTER_IMPORTER);
// request that the operational (OP) EXPORTER key have
// the NoCvKEK option
//
ccaAlgParmSpec.setNoCvKEK(true);
// specify an existing triple DES EXPORTER key to be used for
// enciphering the generated IMPORTER key
//
ccaAlgParmSpec.setKey2KeyEncryptingKey(tdesPrimaryExporter);
KeyGenerator keyGenerator = KeyGenerator.getInstance("DESede", "IBMJCECCA");
keyGenerator.init(ccaAlgParmSpec, null);
// This key object represents the generated operational (OP) EXPORTER key.
// Because the NoCvKEK option was specified when it was created,
// it is suitable for exchanging keys with non-z systems.
//
DESedeKey tdesExporterKey = (com.ibm.crypto.hdwrCCA.provider.DESedeKey) keyGenerator.generateKey();
// this is the exportable (EX) IMPORTER hardware key token, which is
// enciphered (wrapped) under an existing triple DES EXPORTER key named tdesPrimaryExporter
//
byte[] tdesImporterToken = tdesExporterKey.getPairedExternalToken();tdesPrimaryExporter 라는 기존 Triple DES EXPORTER 키로 암호화된 하드웨어 키 토큰입니다// Use CCAAlgorithmParameterSpec to specify key size of 112 and that
// the generated operational key is to be stored in the CCA key storage area.
// Only a Triple DES transport key in the CCA key storage area can have the NoCvKEK
// option enabled.
//
CCAAlgorithmParameterSpec ccaAlgParmSpec = new CCAAlgorithmParameterSpec(
112, CCAAlgorithmParameterSpec.CKDS);
// request that a transport key pair is to be generated
// first key is an operational (OP) IMPORTER key
// second key is an exportable (EX) EXPORTER key
//
ccaAlgParmSpec.setKeyUsage(KeyUsage.OPEX_IMPORTER_EXPORTER);
// request that the operational (OP) IMPORTER key have
// the NoCvKEK option
//
ccaAlgParmSpec.setNoCvKEK(true);
// specify an existing triple DES EXPORTER key to be used for
// enciphering the generated EXPORTER key
//
ccaAlgParmSpec.setKey2KeyEncryptingKey(tdesPrimaryExporter);
KeyGenerator keyGenerator = KeyGenerator.getInstance("DESede", "IBMJCECCA");
keyGenerator.init(ccaAlgParmSpec, null);
// This key object represents the generated operational (OP) IMPORTER
// key, and contains a label for the corresponding CCA key storage area entry.
// Because the NoCvKEK option was specified when it was created,
// it is suitable for exchanging keys with non-z systems.
//
DESedeKey tdesImporterKey = (com.ibm.crypto.hdwrCCA.provider.DESedeKey) keyGenerator.generateKey();
// this is the exportable (EX) EXPORTER hardware key token, which is
// enciphered under an existing triple DES EXPORTER key named tdesPrimaryExporter
//
byte[] tdesExporterToken = tdesImporterKey.getPairedExternalToken();