A. Cac ham xac thuc:
STT |
Ten ham |
Mo ta |
1 |
Login |
Dang nhap lay phien (dang access_token) |
2 |
Certificates/Info |
Lay danh sach CTS va chi tiet thong tin CTS |
3 |
SignHash |
Ky ma bam |
B. Chi tiet cac ham
1. Login:
1.1. Request:
Link |
BASE_URL/vtss/service/ras/v1/login |
HTTP Verb |
POST |
Content |
application/json |
Accept |
application/json |
Request |
{ |
Bang chi tiet cac truong request:
Parameters |
Presence |
Value |
Description |
client_id |
MANDATORY |
String |
Client ID cua ung dung ky (Toi da 50 ky tu). |
user_id |
MANDATORY |
String |
User ID cua nguoi ky (Toi da 50 ky tu). |
client_secret |
MANDATORY |
String |
Khoa bao mat cua ung dung ky |
profile_id |
OPTIONAL |
String |
Profile ID cua nguoi ky (Toi da 50 ky tu). |
1.2. Response:
Status Code |
Message |
Response Body |
200 |
OK |
{ "token_type": "Bearer", "expires_in": "3600" |
400 |
Bad Request |
{ |
401 |
Unauthorised |
{ |
Bang chi tiet cac truong response:
Parameters |
Presence |
Value |
Description |
access_token |
MANDATORY |
String |
Phien giao dich (access token) |
refresh_token |
CONDITIONAL |
String |
Token cap nhat phien giao dich |
token_type |
MANDATORY |
String |
Loai access token |
expires_in |
MANDATORY |
String |
Han cua phien (seconds) |
error_code |
CONDITIONAL |
String |
Ma loi |
error_description |
CONDITIONAL |
String |
Mo ta loi |
2. Certificates/Info
2.1. Request:
Link |
BASE_URL/adss/service/ras/csc/v1/credentials/list |
HTTP Verb |
POST |
Content |
application/json |
Accept |
application/json |
Authorization |
Bearer eyJhbGciOiJIUzI1NsInN…Pcxcz2hM |
Request |
{ "client_id": “adss…client”, "certificates": "chain", |
Bang chi tiet cac truong request:
Parameters |
Presence |
Value |
Description |
client_id |
MANDATORY |
String |
Client ID cua ung dung ky (Toi da 50 ky tu). |
user_id |
MANDATORY |
String |
User ID cua nguoi ky (Toi da 50 ky tu). |
client_secret |
MANDATORY |
String |
Khoa bao mat cua ung dung ky |
profile_id |
OPTIONAL |
String |
Profile ID cua nguoi ky (Toi da 50 ky tu). |
certificates |
OPTIONAL |
String |
Chi dinh thong tin CTS tra ve: · Chain: Tra ve chuoi CTS gom CTS cua nguoi ky, cua Viettel-CA va cua Bo TTTT. |
certInfo |
OPTIONAL |
Boolean |
· True: Tra ve thong tin kem theo CTS · False: Khong tra ve thong tin kem theo CTS. Default: ‘false’ |
authInfo |
OPTIONAL |
Boolean |
· True: Tra ve cac thong tin ve co che uy quyen duoc ho tro · False: Khong tra ve cac thong tin ve co che uy quyen duoc ho tro Default: ‘false’ |
2.2. Response:
Status Code |
Message |
Response Body |
200 |
OK |
{ "curve": null "multisign": “2147483647”, "credential_id": "0100109106-998_2475106_20221011075826", "SCAL": "2",} |
400 |
Bad Request |
{ |
Bang chi tiet cac truong response:
Parameters |
Presence |
Value |
Description |
description |
OPTIONAL |
String |
Mo ta (Toi da 255 ky tu). |
key/status |
MANDATORY |
String |
Trang thai cap khoa CTS · Disabled: Khoa khong the dung de ky |
key/algo |
MANDATORY |
String |
Danh sach OID cac thuat toan ho tro ky so · 1.2.840.113549.1.1.1=RSA |
key/len |
MANDATORY |
Number |
Do dai khoa (bits). |
key/curve |
CONDITIONAL |
String |
OID ECDSA curve. Chi tra ve khi keyAlgo thuoc nhom ECDSA. |
cert/status |
OPTIONAL |
String |
Trang thai CTS |
cert/certificates |
CONDITIONAL |
String |
Danh sach CTS dang Base64. |
cert/issuerDN |
CONDITIONAL |
String |
DN cua CA cap CTS Tra ve khi certInfo: “true”. |
cert/serialNumber |
CONDITIONAL |
String |
Serial number CTS Tra ve khi certInfo: “true”. |
cert/subjectDN |
CONDITIONAL |
String |
DN CTS Tra ve khi certInfo: “true”. |
cert/validFrom |
CONDITIONAL |
String |
Thoi gian bat dau hop le cua CTS Tra ve khi certInfo: “true”. Format GeneralizedTime (RFC 5280 e.g. “YYYYMMDDHHMMSSZ”). |
cert/validTo |
CONDITIONAL |
String |
Thoi gian ket thuc hop le cua CTS Tra ve khi certInfo: “true”. Format GeneralizedTime (RFC 5280 e.g. “YYYYMMDDHHMMSSZ”). |
authMode |
MANDATORY |
String |
Phuong thuc xac thuc: |
SCAL |
OPTIONAL |
String |
· “2”: Su dung SCAL2 |
multisign |
MANDATORY |
Number |
So luong chu ky toi da co the ky cung luc |
credential_id |
MANDATORY |
String |
credential_id (dinh danh) cua CTS |
lang |
OPTIONAL |
String |
Ma ngon ngu cua ket qua (theo RFC 5646). |
error_code |
CONDITIONAL |
String |
Ma loi |
error_description |
CONDITIONAL |
String |
Mo ta loi |
3. SignHash:
3.1. Request:
Link |
BASE_URL/vtss/service/signHash |
HTTP Verb |
POST |
Content |
application/json |
Accept |
application/json |
Authorization |
Bearer _TiHRG-bA H3XlFQZ3ndFhkXf9P24/CKN69L8gdSYp5_pw |
Request |
{ "hashAlgo": "2.16.840.1.101.3.4.2.1", “async”: 0 } |
Bang chi tiet cac truong request:
Parameters |
Presence |
Value |
Description |
credentialID |
MANDATORY |
String |
ID CTS (credential_id) |
numSignatures |
MANDATORY |
Number |
So luong ham bam can mky |
documents/document |
OPTIONAL |
String |
ID dai dien tai lieu ky |
documents/document |
OPTIONAL |
String |
* Ten cua tai lieu ky, hien thi tren app Mysign (neu khong co description) * Can truyen thong tin nhu sau: - Ma hoa noi dung dang Base64, encode UTF-8 - Do dai ma Base64 < 100 ky tu - Noi dung goc bao gom: + Chu cai thuong, in hoa: a-z, A-Z + Chu so: 0-9 + Ky tu dac biet: dau gach duoi (_), dau gach ngang (-), d?u cách ( ) |
hash |
CONDITIONAL |
String |
Ma bam cua tai lieu can ky - Base64 |
description |
OPTIONAL |
String |
* Mo ta yeu cau ky * Can truyen thong tin nhu sau: - Ma hoa noi dung dang Base64, encode UTF-8 - Do dai ma Base64 < 100 ky tu - Noi dung goc bao gom: + Chu cai thuong, in hoa: a-z, A-Z + Chu so: 0-9 + Ky tu dac biet: dau gach duoi (_), dau gach ngang (-), d?u cách ( ) |
hashAlgo |
CONDITIONAL |
String |
Ma OID cua thuat toan bam. Tham so nay bi bo qua neu duoc chi dinh ngam theo thuat toan signAlgo. |
signAlgo |
MANDATORY |
String |
OID cua thuat toan ky. Xac thuc theo thong tin keyAlgo |
async |
MANDATORY |
Integer |
Che do ky dong bo/bat dong bo (synchronize/asynchronize) 0: Synchronize mode 1: Asynchronize mode Trong che do nay, async=0 |
3.1. Response:
Status |
Message |
Response Body |
200 |
OK |
{ |
400 |
Bad Request |
{ |
400 |
Bad Request |
{ |
400 |
Bad Request |
{ |
400 |
Bad Request |
{ |
400 |
Bad Request |
{ |
Bang chi tiet cac truong response:
Parameters |
Presence |
Value |
Description |
signatures |
MANDATORY |
String |
Danh sach chu ky base64 |
error_code |
CONDITIONAL |
String |
Ma loi |
error_descripti |
CONDITIONAL |
String |
Mo ta loi |