gpt4 book ai didi

javacard - JavaCard 规范 2.2.2 及以下版本中 cap 文件中的可选描述符组件

转载 作者:行者123 更新时间:2023-12-02 21:32:34 30 4
gpt4 key购买 nike

在尝试反编译 capfile 时研究 JCVM 规范,我想到了以下问题:

描述符组件(6.13)说:

The Descriptor Component provides sufficient information to parse and verify all elements of the CAP file. It references, and therefore describes, elements in the Constant Pool Component (Section 6.7, “Constant Pool Component” on page 6-14), Class Component (Section 6.8, “Class Component” on page 6-21), Method Component (Section 6.9, “Method Component” on page 6-35), and Static Field Component (Section 6.10, “Static Field Component” on page 6-41). No components in the CAP file reference the Descriptor Component.

组件模型 (6.1) 说:

A complete CAP file must contain all of the required components specified in this chapter. Three components are optional: the Applet Component (Section 6.5, “Applet Component” on page 6-12), Export Component (Section 6.12, “Export Component” on page 6-47), and Debug Component (Section 6.14, “Debug Component” on page 6-57).

但在安装(6.2)中却说:

COMPONENT_Descriptor (optional)

而且我还没有观察到Load命令的Global Platform Load中的Descriptor组件!那么问题来了,描述符的实际用途是什么以及为什么小程序不需要在卡上工作?相反,JCVM 规范 3.0.1 及更高版本没有将描述符组件列为可选。

最佳答案

And I havent observed the Descriptor component in the Global Platform Load for Load commands! So the question arises what the descriptor is actually used for and why it is not neccesary for the applet to work on-card?

Descriptor.cap 组件提供用于解析和验证 CAP 文件中其他元素的信息。因此,字节码验证 (BCV) 需要 Descriptor.cap 组件,该验证是在卡外完成的,对于卡操作并不重要。它引用并指向不同 CAP 文件组件的信息,但没有组件(强制组件)指向 Descriptor 组件。因此,无需将此组件加载到卡上。因此,您在Global Platform [Load] 命令中看不到它。

如以下 JCVM 规范 3.0.5 规范中所定义。

描述符组件提供了足够的信息来解析和验证 CAP 的所有元素文件。它引用并因此描述了常量池组件中的元素(6.8 常量池组件)、类组件(6.9 类组件)、方法组件(6.10 方法组件)、和静态场组件(6.11 静态场组件)。 CAP 文件中没有组件引用描述符组件。

In contrary, JCVM spec 3.0.1 and greater don't list the descriptzor compnent as optional.

他们将 Descriptor.cap 描述为以下 JCVM 规范 3.0.5(第 6.3 节)中 CAP 文件组件安装顺序中的可选。虽然规范不一样,但很难说为什么他们在你提到的规范中没有提到这一点。

https://docs.oracle.com/javacard/3.0.5/JCVMS/JCVMS.pdf

关于javacard - JavaCard 规范 2.2.2 及以下版本中 cap 文件中的可选描述符组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52834572/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com