简体   繁体   English

这个验证 APDU 命令有什么问题?

[英]What's wrong with this Verify APDU command?

I've got the following Verify (PIN) APDU command, that we send to the Gemalto SafeNet Reader K1100:我有以下验证 (PIN) APDU 命令,我们将其发送到 Gemalto SafeNet Reader K1100:

00 20 00 81 08 26 12 34 56 ff ff ff ff

I always get the response 67 00 (wrong length).我总是得到响应67 00 (长度错误)。 As far as I know this means that either LC or LE is incorrect.据我所知,这意味着 LC 或 LE 都不正确。

The APDU looks correct assuming: APDU 看起来是正确的,假设:

  • there exists a PIN with ID 1 within the current DF当前 DF 中存在 ID 为 1 的 PIN
  • the card uses a BCD format for PINs and pads them to 8 bytes or the PIN value contains strange non-printable characters该卡使用 BCD 格式的 PIN 并将它们填充为 8 个字节PIN 值包含奇怪的不可打印字符

You could try 01 instead of 81, to ensure the PIN is searched in the MF, or 00 assuming the card knows the PIN id implicitly.您可以尝试 01 而不是 81,以确保在 MF 中搜索 PIN,或者 00 假设卡隐式知道 PIN id。 If both attempts fail, you have to collect more information concerning initialization/personalization of your card.如果两次尝试均失败,则您必须收集有关卡初始化/个性化的更多信息。

Since the Verify command has no result, LE can't be wrong.由于Verify命令没有结果,LE不可能出错。 Note however, that when using Java classes to construct the APDU, LC is added automatically and must not be specified.但是请注意,当使用 Java 类构建 APDU 时,LC 是自动添加的,不得指定。

My only other idea is, to omit the FF bytes adjusting the LC accordingly.我唯一的其他想法是,省略相应地调整 LC 的 FF 字节。

are you using Athena?你在用雅典娜吗?

if this is the case try p2= A0如果是这种情况,请尝试 p2= A0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM