ตัวอย่างสมบูรณ์ — mTLS บนคอมพิวเตอร์ (device-mtls)
char ca[512], crt[512], key[512];
join_path(crt, sizeof(crt), certs_dir, FILE_CLIENT_CERT);
join_path(key, sizeof(key), certs_dir, FILE_CLIENT_KEY);
if (!(file_exists(crt) && file_exists(key))) {
fprintf(stderr, "mTLS requires client_cert.pem and client_key.pem in %s\n", certs_dir);
return 1;
}
บนคอมพิวเตอร์ กุญแจลับคือ ไฟล์ client_key.pem ที่อ่านเข้า RAM — ใครคัดลอกไฟล์ได้ก็เป็นอุปกรณ์นี้ได้ บนบอร์ด ตำแหน่งเดียวกันคือ cy_tls_set_optiga_key_id() ที่ส่งแค่ ชื่อ ของกุญแจ — bundle จากการลงทะเบียนด้วย CSR ไม่มีกุญแจลับใน ZIP