Technical Documentations
  • 🇻🇳Vietnamese
    • Tổng quan
    • Đối tác B2B2C
      • Phương thức Webview
        • API Login
        • Yêu cầu bảo mật
        • Place Order
        • API Get Booking Detail
        • API Commit
        • API Check commit result
      • Phương thức SDK
        • API Login
        • Yêu cầu bảo mật
        • Initiate SDK
          • Init IOS SDK
          • Init Android SDK
        • Place order
        • API Commit
        • API Get booking detail
        • API Check commit result
      • Phương thức API
        • API Login
        • Yêu cầu bảo mật
        • ✈️Flight
          • Search API
          • Booking API
        • 🏨Hotel
          • Search API
          • Booking API
          • Cancellation API
        • Payment API
        • Booking Management API
    • Đối tác Corporate Agent (CA)
      • Qui trình tích hợp
      • API Chứng thực
      • Yêu cầu bảo mật
    • Đối tác Affiliate
    • ❓Câu hỏi thường gặp
      • Các status trong luồng booking Gotadi
      • Quy định Test
        • ✈️Vé máy bay
        • 🏨Khách sạn
      • Bộ Testcase dành cho đối tác B2B2C
      • Quy trình hỗ trợ từ CS
      • Danh sách Airlines
  • 🇬🇧English
    • Overview
    • B2B2C Partner
      • Webview method
        • API Login
        • Security Requirements
        • Place Order
        • API Get Booking Detail
        • API Commit
        • API Check commit result
      • SDK method
        • API Login
        • Security Requirments
        • Initiate SDK
          • Init IOS SDK
          • Init Android SDK
        • Place order
        • API Commit
        • API Get booking detail
        • API Check commit result
      • API method
        • Integration process
        • Login API
        • ✈️Flight
          • Search API
          • Booking API
        • 🏨Hotel
          • Search API
          • Booking API
          • Cancellation API
        • Payment API
    • Corporate Agent Partner (CA)
      • Integration Process
      • Authentication API
      • Security Requirements
    • Affiliate Partner
    • ❓FAQ section
      • Booking Statuses in Gotadi's Booking Flow
      • Regulations for Testing
        • ✈️Flight
        • 🏨Hotel
      • CS Support Overall Flow
      • Airlines List
Powered by GitBook
On this page
  • API Key
  • Chữ ký điện tử (Signature)
  1. Vietnamese
  2. Đối tác Corporate Agent (CA)

Yêu cầu bảo mật

PreviousAPI Chứng thựcNextĐối tác Affiliate

Last updated 2 months ago

API Key

Tất cả các request từ phía đối tác gọi sang hệ thống của Gotadi phải chứa các Headers bên dưới để phục vụ các nghiệp vụ về bảo mật và thống kê số liệu của Gotadi:

  • apikey: <api_key>

  • x-ibe-req-name: <access_code>

Lưu ý

Giá trị <api_key> và <access_code> do Gotadi cung cấp cho Đối tác.


Chữ ký điện tử (Signature)

Một số API quan trọng được yêu cầu đính kèm chữ ký điện tử vào request và response để xác thực.

Khởi tạo chữ ký chữ ký điện tử

Bên gửi áp dụng thuật toán RSA-SHA256 kết hợp với Private key của chính mình để ký chữ ký điện tử trên signature data.

Lưu ý

Schema để thành lập signature data sẽ được mô tả cụ thể ở từng API.

Java example code

public static String signRSA(String signatureData, String xmlPrivateKey) throws Exception {
    PrivateKey privateKey = getPrivateKeyFromXML(xmlPrivateKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initSign(privateKey);
    instance.update(signatureData.getBytes("UTF-8"));
    byte[] signature = instance.sign();
    return Base64.encodeBase64String(signature);
}
Xác thực chữ ký điện tử

Bên nhận sử dụng Thuật toán RSA-SHA256 và Public key của bên gửi để xác thực signature được bên gửi tạo ra.

Java example code

public static boolean verifyRSA(String signedData, String signature, String xmlPublicKey) throws Exception {
    PublicKey publicKey = getPublicKeyFromXML(xmlPublicKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initVerify(publicKey);
    instance.update(signedData.getBytes("UTF-8"));
    return instance.verify(Base64.decodeBase64(signature));
}

🇻🇳