如何在智能卡上执行终端身份验证?

发布于 2025-01-19 17:51:48 字数 860 浏览 5 评论 0原文

我正在尝试使用智能卡电子签名应用程序对文档进行数字签名。它是国民身份证,我遵循 ICAO 9303TR-03110 规范。如果我没记错的话,在选择eSign应用程序之前,我应该预先将Terminal Authentication作为Signature Terminal执行。

ICAO 9303中规定:

The following sequence of commands SHALL be used with secure messaging to implement Terminal Authentication:

MSE:Set DST
PSO:Verify Certificate
MSE:Set AT
Get Challenge
External Authenticate

Steps 1 and 2 are repeated for every CV certificate to be verified (CVCA Link Certificates, DV Certificate, Terminal Certificate).

要执行MSE:设置DST,应使用以下APDU

INS - 0x22
P1/P2 - 0x81B6
Data - 0x83 Reference of a public key, ISO 8859-1 encoded name of the public key to be set

它是数据部分我不明白。我到底需要在那里提供什么?如何找到公钥或其名称?

I am trying to digitally sign document using the smart card eSign application. It is a national ID card, and I am following ICAO 9303 and TR-03110 specifications. If I am not mistaken, before selecting the eSign application I should perform Terminal Authentication as Signature Terminal beforehand.

In ICAO 9303 it is stated:

The following sequence of commands SHALL be used with secure messaging to implement Terminal Authentication:

MSE:Set DST
PSO:Verify Certificate
MSE:Set AT
Get Challenge
External Authenticate

Steps 1 and 2 are repeated for every CV certificate to be verified (CVCA Link Certificates, DV Certificate, Terminal Certificate).

To Perform MSE:Set DST the following APDU should be used:

INS - 0x22
P1/P2 - 0x81B6
Data - 0x83 Reference of a public key, ISO 8859-1 encoded name of the public key to be set

It is the Data part I do not understand. What exactly do I need to provide there? How do I find the public key or its name?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月蹉跎了容颜 2025-01-26 17:51:48

我到底需要在那里提供什么?如何找到公钥或其名称?

在开始 TA 之前,您应该确保终端拥有自己的有效 CV 证书链 + 正确的私钥:

  1. DV cetitificate
  2. 的终端私钥的 IS 证书
  3. 与 IS 证书对应

TA 的初始步骤是证书链验证:

  1. 读取 EF.CVCA 和查找芯片已知的根证书的 CHR
  2. 选择作为终端 DV 证书父级的证书。 EF.CVCA 中的 CHR 必须等于 DV 证书中的 CAR。
  3. 发送 MSE:使用所选 CHR 设置 DST
  4. 发送 PSO:使用终端 DV 证书验证证书
  5. 发送 MSE:使用终端 DV 证书的 CHR 设置 DST(必须等于 IS 证书中的 CAR)
  6. 发送 PSO:使用终端 IS 证书验证证书
    现在芯片知道终端的公钥,并可以用它来验证终端用其私钥签名的密码。

证书持有者参考 (CHR) 和证书授权参考 (CAR) 是编码为字符串值的 ID。

What exactly do I need to provide there? How do I find the public key or its name?

Before start TA you should be sure that terminal has its own valid chain of CV-certificates + proper private key:

  1. DV cetitificate
  2. IS certificate of the terminal
  3. private key corresponding to IS certificate

Initial step of TA is certificate chain verificattion:

  1. Read EF.CVCA and find CHRs of root certificates known to chip
  2. Select one that is a parent of the terminal's DV certificate. CHR from EF.CVCA must be equal to CAR from DV certificate.
  3. Send MSE:Set DST with chosen CHR
  4. Send PSO:Verify Certificate with terminal's DV certificate
  5. Send MSE:Set DST with CHR of terminal's DV certificate (it must be equal to CAR from IS certificate)
  6. Send PSO:Verify Certificate with terminal's IS certificate
    Now chip knows terminal's public key and can use it to verify a cryptogram signed by terminal with its private key.

Certificate holder reference (CHR) and certificate authourity reference (CAR) are IDs encoded as string values.

榕城若虚 2025-01-26 17:51:48

jmrtd库可以提供帮助:

jmrtd:机器可读文档的开源Java实现

强>简单单词以完成终端身份验证的步骤就像以下:

  • 首先是(检查系统)将终端证书链发送到IC(芯片)。
  • IC验证证书链并提取终端的公钥。
  • IC向终端发送挑战。
  • 用其私钥签署挑战。
  • IC验证签名。

这样,IC就可以验证终端并授予对敏感数据组的访问。

JMRTD Library Can help:

JMRTD: An Open Source Java Implementation of Machine Readable Travel Documents

The steps in simple words to complete the terminal authentication is like following:

  • First IS (Inspection System) send the chain of terminal certificates to the IC (Chip).
  • IC verifies the chain of certificates and extracts the public key of terminal.
  • IC send a challenge to terminal.
  • IS sign the challenge with its private key.
  • IC verify the signature.

In this way the IC authenticate the terminal and grant access to sensitive data groups.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文