EMV - 生成 AC - 验证码

EMV - Generate AC - Authenticate Code

我正在使用 ISO 14443 卡在 Android 上开发移动 POS 应用程序,我遇到了一个相当重要的问题。

目前,我可以通过IsoDep.transceive

发送所有正确的APDU命令,从卡中读取所有public数据

我目前必须处理 CDOL1,特别是 Data Authenticate Code 以下是我从测试卡中收集的三个 CDOL:

9F0206 9F0306 9F1A02 9505 5F2A02 9A03 9C01 9F3704 9F3501 9F4502 9F4C08 9F3403

9F0206 9F0306 9F1A02 9505 5F2A02 9A03 9C01 9F3704 9F3501 9F4502 9F4C08 9F3403 9F2103 9F4005

9F0206 9F0306 9F1A02 9505 5F2A02 9A03 9C01 9F3704 9F3501 9F4502 9F4C08 9F3403 9F5301

EMV 第 2 册说:

In order to obtain the Recovered Data specified in Table 7, apply the recovery function specified in Annex A2.1 on the Signed Static Application Data using the Issuer Public Key in conjunction with the corresponding algorithm. If the Recovered Data Trailer is not equal to 'BC', SDA has failed.

我知道解密恢复数据之前的第一步是获取颁发者 Public 密钥(带有 RID、AID 的前五个字节和证书颁发机构 Public 密钥索引)然后将其与恢复功能一起使用以解密已签名的应用程序数据。

所以我的问题是:

  1. 我如何获得这个 Issuer Public Key with RID 和 Public Key Index ?

  2. 任何人都可以帮助我理解这个恢复功能以便开发一个功能或者 Java 中是否有任何现有的功能可以做到这一点?

PS : 如果是已有的函数,我也希望能解释一下^^

终于为想要的人找到了解决方案^^

  1. 当它说您需要 RID 和索引时,这是因为:

[..] each terminal shall be able to store six certification authority public keys per Registred Application Provider (RID) [..]

和我一起工作的社会有这些 CAPK。

  1. 似乎使用的加密是 RSA,现在我有了 public 密钥,它是 !

您可能会发现 javaemvreader 非常有用。

How do I get this Issuer Public Key with RID and Public Key Index ?

在实际情况下,颁发者将 自签名证书 发送给 CA,在还原时 CA 会提供 证书 及其 public 键 - CA PUBLIC KEY.

相同的 public 密钥存储在终端中。

当终端读取EMV卡的AFL数据时,读取Tag 90 - Issuer Public Key Certificate并使用存储的CA解密public键,

它将 Issuer public 密钥提供给终端,然后终端相应地使用 issuer public 密钥。

希望这有助于理解 EMV 的证书概念。