DEENESPTFRRUARHIKOZHNL

命名空间 ara::crypto::cryp

用户指南人工智能生成

定义用于加密计算、密钥对象及其存储管理的接口。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f15c72def571 来源 未决问题(3)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

定义用于加密计算、密钥对象及其存储管理的接口。

命名空间 ara::crypto::cryp 为 AUTOSAR Adaptive Platform 中的加密操作、密钥对象和密钥存储提供核心接口。通过中央工厂 CryptoProvider,可以从 KeySlot 的实例获取密钥,并实例化派生自 CryptoContext 的用于加密、签名或哈希的专用执行上下文。在配置了有状态的上下文后,使用输入数据执行加密操作。根据目前的解释,一个重要的约束条件在于通过 CryptoObject 对密钥材料进行严格封装,以及通过 WriteableKeySlot 区分写入权限。

上下文和职责范围

命名空间 ara::crypto::cryp 构成了 AUTOSAR Adaptive 加密模块的功能核心,并为加密原语、对象模型和密钥管理结构提供接口。该架构的核心是接口 CryptoProvider,它充当加密算法的实现实例和工厂,并用于访问密钥存储。基本数据结构和密钥通过通用接口 CryptoObject 表示,具体密钥类型(如 SymmetricKey、PublicKey 和 PrivateKey)派生自该接口。密钥材料的存储位置由 KeySlot 及其可写特化 WriteableKeySlot 映射。

CrypKontext CryptoProvider CryptoProvider KeySlot KeySlot CryptoProvider->KeySlot verwaltet CryptoContext CryptoContext CryptoProvider->CryptoContext erzeugt CryptoObject CryptoObject KeySlot->CryptoObject haelt CryptoContext->CryptoObject 使用 SymmetricKey SymmetricKey CryptoObject->SymmetricKey spezialisiert PublicKey PublicKey CryptoObject->PublicKey spezialisiert PrivateKey PrivateKey CryptoObject->PrivateKey spezialisiert WriteableKeySlot WriteableKeySlot WriteableKeySlot->KeySlot erweitert

上下文图:CryptoProvider、密钥存储与加密上下文之间的相互作用。来源:有效负载中未指定。

为了执行加密转换,该命名空间提供了一组基于可变基础上下文 CryptoContext 构建的专用接口族。这些执行上下文包括对称密码器(SymmetricCipherCtx、AuthCipherCtx)、非对称加密和解密(EncryptorPublicCtx、DecryptorPrivateCtx)以及用于签名生成和验证的机制(SignerPrivateCtx、VerifierPublicCtx)。这一范围还补充了用于哈希函数(HashFunctionCtx)、基于消息的身份验证码(MessageAuthnCodeCtx)、密钥派生(KeyDerivationFunctionCtx)、密钥协商(KeyAgreementPrivateCtx)、密钥封装(KeyEncapsulatorPublicCtx、KeyDecapsulatorPrivateCtx)、带对称包装的密钥封装(SymmetricKeyWrapperCtx)、随机数生成(RandomGeneratorCtx)以及安全密钥导入(ProtectedKeyImportCtx)的上下文。

生命周期与状态保持

加密工件的管理和生命周期与 CryptoProvider、密钥对象及上下文之间的相互作用密切耦合。根据目前的解释,加密上下文和对象的生命周期主要通过 CryptoProvider 的工厂和管理方法进行控制,该接口充当实例化的中央入口点。派生自 CryptoObject 的对象表示不可变或受管的加密实体,而 CryptoContext 则明确定义为有状态的可变上下文。这要求在相应的上下文实例内维护配置、中间状态和算法参数。

对于密钥材料的持久或临时存储,该命名空间区分了 KeySlot 和 WriteableKeySlot。按照合理解释,KeySlot 与 WriteableKeySlot 之间的分离推测将读取访问与写入密钥修改分开,从而可以保护不可变或写保护的密钥区域免遭意外覆盖。 问题 Q-e1b708ca976f7e99 (未决)因此,密钥和上下文的状态转换在关联 Provider 的控制下进行,该 Provider 确保密钥对象在其整个生命周期内的有效性。

加密操作的使用路径

加密操作通常遵循 Provider 查询、通过 Key-Slot 提供密钥以及初始化有状态上下文的序列。在第一步中,应用程序组件访问主管的 CryptoProvider。通过该 Provider,所需的密钥材料要么从 KeySlot 或 WriteableKeySlot 中加载,要么作为具体的 CryptoObject(例如作为 SymmetricKey、PrivateKey 或 PublicKey)获取。同时或随后,Provider 会创建 CryptoContext 的合适实例,例如用于加密的 SymmetricCipherCtx 或用于数字签名的 SignerPrivateCtx。

加密操作流程应用CryptoProviderKeySlotCryptoContext请求密钥加载密钥对象CryptoObject bereitstellen返回 CryptoObjectCryptoContext anfordernKontext instanziieren返回 CryptoContext执行操作Ergebnis liefern

序列图:执行加密操作时的典型调用顺序。来源:有效负载中未指定。

在随后的执行步骤中,使用加载的密钥配置所创建的上下文,并为其提供待处理的有效负载数据。由于 CryptoContext 的有状态特性,可以在将最终加密结果(例如密文、签名或哈希值)返回给应用程序之前,分步执行流式操作或多阶段转换。处理完成后,瞬态状态的释放遵循执行上下文和 Provider 的约定。

本段文本由人工智能基于 Release R25-11 的元数据生成。

主题图

KI-gestützte Gruppierung auf Basis der Records und Spezifikationsauszüge; keine Gliederung aus der AUTOSAR-Spezifikation.

类图

Abgerundete Rahmen = Namespace- bzw. Klassen-Scopes; hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); graue Boxen = namespace-fremde bzw. externe Basisklassen. Klicken öffnet die jeweilige Klassen- bzw. cppreference-Seite.

G cluster_ns ara::crypto::cryp nara__crypto__cryp__AuthCipherCtx AuthCipherCtx nara__crypto__cryp__CryptoContext CryptoContext nara__crypto__cryp__AuthCipherCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__CryptoObject CryptoObject next_ara__crypto__Serializable ara::crypto::Serializable nara__crypto__cryp__CryptoObject->next_ara__crypto__Serializable nara__crypto__cryp__CryptoProvider CryptoProvider nara__crypto__cryp__DecryptorPrivateCtx DecryptorPrivateCtx nara__crypto__cryp__DecryptorPrivateCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__EncryptorPublicCtx EncryptorPublicCtx nara__crypto__cryp__EncryptorPublicCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__HashFunctionCtx HashFunctionCtx nara__crypto__cryp__HashFunctionCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__KeyAgreementPrivateCtx KeyAgreementPrivateCtx nara__crypto__cryp__KeyAgreementPrivateCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__KeyDecapsulatorPrivateCtx KeyDecapsulatorPrivateCtx nara__crypto__cryp__KeyDecapsulatorPrivateCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__KeyDerivationFunctionCtx KeyDerivationFunctionCtx nara__crypto__cryp__KeyDerivationFunctionCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__KeyEncapsulatorPublicCtx KeyEncapsulatorPublicCtx nara__crypto__cryp__KeyEncapsulatorPublicCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__KeySlot KeySlot nara__crypto__cryp__MessageAuthnCodeCtx MessageAuthnCodeCtx nara__crypto__cryp__MessageAuthnCodeCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__PrivateKey PrivateKey nara__crypto__cryp__PrivateKey->nara__crypto__cryp__CryptoObject nara__crypto__cryp__ProtectedKeyImportCtx ProtectedKeyImportCtx nara__crypto__cryp__ProtectedKeyImportCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__PublicKey PublicKey nara__crypto__cryp__PublicKey->nara__crypto__cryp__CryptoObject nara__crypto__cryp__RandomGeneratorCtx RandomGeneratorCtx nara__crypto__cryp__RandomGeneratorCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__SignerPrivateCtx SignerPrivateCtx nara__crypto__cryp__SignerPrivateCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__SymmetricCipherCtx SymmetricCipherCtx nara__crypto__cryp__SymmetricCipherCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__SymmetricKey SymmetricKey nara__crypto__cryp__SymmetricKey->nara__crypto__cryp__CryptoObject nara__crypto__cryp__SymmetricKeyWrapperCtx SymmetricKeyWrapperCtx nara__crypto__cryp__SymmetricKeyWrapperCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__VerifierPublicCtx VerifierPublicCtx nara__crypto__cryp__VerifierPublicCtx->nara__crypto__cryp__CryptoContext nara__crypto__cryp__WriteableKeySlot WriteableKeySlot nara__crypto__cryp__WriteableKeySlot->nara__crypto__cryp__KeySlot

详细视图

请在大纲中选择一个条目。

Verschlüsselung

Authenticated Cipher Context interface.

继承自 CryptoContext

Interface for asymmetric decryption.

继承自 CryptoContext

Interface for asymmetric encryption.

继承自 CryptoContext

Interface for Symmetric Cipher Operations.

继承自 CryptoContext

Signatur und MAC

Hash function interface.

继承自 CryptoContext

Keyed Message Authentication Code Context interface definition.

继承自 CryptoContext

Signature Private key Context interface.

继承自 CryptoContext

Signature Verification Public key Context interface.

继承自 CryptoContext

Schlüsselmaterial

Key Agreement Private key Context interface.

继承自 CryptoContext

Asymmetric Key Encapsulation Mechanism (KEM) Private key Context interface.

继承自 CryptoContext

Key Derivation Function interface.

继承自 CryptoContext

Asymmetric Key Encapsulation Mechanism (KEM) Public key Context interface.

继承自 CryptoContext

A contexts for importing secured data such as secret key-material.

继承自 CryptoContext

Context of a symmetric key wrap algorithm.

继承自 CryptoContext

Schlüsselobjekte

A common interface for all cryptographic objects recognizable by the Crypto Provider.

继承自 ara::crypto::Serializable

作为基类 PrivateKey, PublicKey, SymmetricKey

Generalized Asymmetric Private Key interface.

继承自 CryptoObject

General Asymmetric Public Key interface.

继承自 CryptoObject

Symmetric Key interface.

继承自 CryptoObject

Schlüsselspeicher

KeySlot interface representing a storage location for a key in a CryptoProvider.

作为基类 WriteableKeySlot

WriteableKeySlot interface representing a writeable storage location for a key in a Crypto Provider.

继承自 KeySlot

Kontextbasis

CryptoProviderInterface representing one implementation of a set of cryptographic primitives with a key storage.

Interface of Random Number Generator Context.

继承自 CryptoContext