Skip to main content

3) Security Document Encryption

Encrypting regular documents into secure documents

API

MethodURL
POST/api/internal/encryption

Request Header

NameRequiredDescription
AuthorizationrequiredUser authentication method, JWT value
Authorization: Bearer {JWT}
Note: The JWT value is issued through the authentication/authorization service.

Request Body

NameRequiredTypeDescription
companyIdrequiredstringCompany ID using the target document (used when retrieving key data by company)
encTyperequiredstringDocument Type
D : DAC Document
M : MAC Document
G : GRADE Document
docListrequiredstringEnter the appropriate permission list according to encType.
D : SECURITYDOMAIN^111001100|USER01^011001100
M : 0000001
G : 0000001|RND1^110001111|dev04^010001111
※ If it is G and D, please refer to the "Permission String" table below for input.
srcFilePathrequiredstringOriginal general document path
srcFileNameoptionalstringOriginal document name to be stored in the security document header
- If not used, the filename of srcFilePath is saved.
dstFilePathrequiredstringEncrypted secure document path
algorithmoptionalstringAES / ARIA
Default value: AES
sciServerIdoptional/requiredstringSCI server ID to be encrypted
<span style={{color: 'red'}}>- Required when using multi-SCI servers
extraInfooptionalstringInput additional information in JSON format (refer to the extraInfo data description table and sample data below)
serviceLinkeroptionaljsonParameters used in the SDFApp API
- Required when changing systemName
ex) "{\"systemName\":\"SDF\"}"
systemName 예시 이미지
extraInfo Data Description Table
KeyRequiredTypeDescription
sourcerequiredjson
namerequiredstringCall System Name
fromrequiredstringCall System URL
userjson
idstringUser ID
namestringUsername
departstringAll User Departments (Top Group/Middle Group/Lower Group)
dutystringUser Job Title
docUidstringDOC_UID of the encrypted file
parentUidstringParent document's UID
branchUidstringCurrent UID
  • Sample Data
{
"source": {
"name": "EKMS",
"from": "https://devekms.softcamp.co.kr"
},
"user": {
"id": "ekmsTest@softcamp.co.kr",
"name": "ekmsTest",
"depart": "임직원/연구소/개발실/개발1팀",
"duty": "과장"
},
"docUid": "77*9Sw5WOOq1hO*_vQ7vv70D77*9Oei_",
"parentUid": "88*9Sw5WOOq1hO*_vQ7vv70D77*9Oei_",
"branchUid": "99*9Sw5WOOq1hO*_vQ7vv70D77*9Oei_"
}
Permission string: Description of the 9-character string included when the document type is D or G.
row 12nd row3rd row4 rows5 rows6 rows7th row8th row9th row
Key ClassificationRead PermissionEdit PermissionsDecryption PermissionExternal Transfer PermissionPrint PermissionPresence of markingAutomatic DestructionPermission Change
1 : Group
0 : Personal
1 : Has permission
0 : No Permission
1 : Has permission
0 : No Permission
1 : Has permission
0 : No Permission
1 : Has permission
0 : No Permission
1 : Has permission
0 : No Permission
1 : Marked
0 : No marking
4 : Expiration Date
2 : Output Count
1 : Number of Reads
0 : No effect
1 : Changeable
0 : Cannot change
  • For example) If you are an individual with read permission, decryption permission, and external transfer permission, and no other permissions, the permission string would be => "010110000"

Response

NameTypeDescription
codeint0 : Success
Value other than 0: Error
messagestring"OK" : Success
Other Value Error Message

Examples

Request

  • Body
[단일 서버]
{
"companyId": "7FDKQsEK-QVGKyXA2-fx1LxIzy-SNIre0s9",
"encType": "D",
"docList": "SECURITYDOMAIN^110001111",
"srcFilePath" : "/opt/shieldrm/data/test.xlsx",
"dstFilePath" : "/opt/shieldrm/dataout_test.xlsx",
"extraInfo": "{\"source\":{\"name\":\"EKMS\",\"from\":\"https://devekms.softcamp.co.kr\"}}"
}

[멀티 서버]
{
"sciServerId": "SCAM-ED72-262C-433A-0004",
"companyId": "7FDKQsEK-QVGKyXA2-fx1LxIzy-SNIre0s9",
"encType": "D",
"docList": "SECURITYDOMAIN^110001111",
"srcFilePath" : "/opt/shieldrm/data/test.xlsx",
"dstFilePath" : "/opt/shieldrm/dataout_test.xlsx",
"extraInfo": "{\"source\":{\"name\":\"EKMS\",\"from\":\"https://devekms.softcamp.co.kr\"}}"
}

[헤더의 원본 문서 이름 변경 시]
{
"sciServerId": "SCAM-ED72-262C-433A-0004",
"companyId": "7FDKQsEK-QVGKyXA2-fx1LxIzy-SNIre0s9",
"encType": "D",
"docList": "SECURITYDOMAIN^110001111",
"srcFilePath" : "/opt/shieldrm/data/test.xlsx",
"srcFileName" : "original.xlsx",
"dstFilePath" : "/opt/shieldrm/dataout_test.xlsx",
"extraInfo": "{\"source\":{\"name\":\"EKMS\",\"from\":\"https://devekms.softcamp.co.kr\"}}"
}

[systemName 변경 시]
{
"sciServerId": "SCAM-ED72-262C-433A-0004",
"companyId": "7FDKQsEK-QVGKyXA2-fx1LxIzy-SNIre0s9",
"encType": "D",
"docList": "SECURITYDOMAIN^110001111",
"srcFilePath" : "/opt/shieldrm/data/test.xlsx",
"dstFilePath" : "/opt/shieldrm/dataout_test.xlsx",
"extraInfo": "{\"source\":{\"name\":\"EKMS\",\"from\":\"https://devekms.softcamp.co.kr\"}}",
"serviceLinker": "{\"systemName\":\"SDF\"}"
}

Response

  • success
{
"code": 0,
"message" : "OK"
}
  • failure
  • SDF Container Error
  • Status code : 400 Bad Request
{
"code": 40010,
"message": "File is already encrypted."
}
  • SDF Container Module (SCSL) Error
  • Status code : 500 INTERNAL_SERVER_ERROR
{
"code": -61,
"message" : "EXCEPTION error"
}
[토큰 검증 실패]
{
"code": 50001,
"message": "{\"code\":40101,\"message\":\"Invalid token\",\"detail\":\"invalid_token\"}"
}

[KMS 연결 실패]
{
"code": 50001,
"message": "An unexpected error has occurred in the internal system",
"detail": "I/O error on GET request for \"https://devkms.softcamp.co.kr:8080/drm/7FDKQsEK-QVGKyXA2-fx1LxIzy-SNIre0s9/key/0000003\": Connect to devkms.softcamp.co.kr:8080 [devkms.softcamp.co.kr/10.14.10.171] failed: Connection timed out: connect; nested exception is org.apache.http.conn.HttpHostConnectException: Connect to devkms.softcamp.co.kr:8080 [devkms.softcamp.co.kr/10.14.10.171] failed: Connection timed out: connect"
}

[KMS 키조회 실패]
{
"code": 40013,
"message": "Key not found in the keyVault",
"detail": "keyId : 0000011"
}
  • SKMS Module (SCKE) Error
  • Status code : 500 INTERNAL_SERVER_ERROR
{
"code": 40003,
"message": "Failed create header",
"detail": "4020"
}

Summary of SKMS API and SCSL functions called internally by the API

Call OrderAPI and Function Names
1SCSL encryption function call: CloudAPIEncrypt()
2Header Key Retrieval API Call: /api/docu/headerKey
3SCSL header information retrieval function call: dsGetFullHeaderEx()
4Unified Log Transmission API Call: /log/container-linker