函数 ExportPublicly [SWS_CRYPT_10711] Upstream: RS_CRYPTO_02112
virtual ara::core::Result< std::size_t > ExportPublicly (ReadWriteMem Region out, FormatId format) const noexcept=0;
Serialize object using the provided format.
使用
接口 ara::crypto::Serializable 的同步成员函数 ExportPublicly 以指定的输出格式序列化对象 [SWS_CRYPT_10711]。格式标识符 format(类型 FormatId)以及目标内存区域 out(类型 ReadWriteMem Region)作为参数传递。成功执行后,该函数在 ara::core::Result<std::size_t> 中返回实际写入的字节数 [SWS_CRYPT_10711]。
与相关函数的相互作用
该函数与 GetExportSize [SWS_CRYPT_50006] 直接相关,后者可用于确定特定格式所需的字节大小。调用方通常在提供输出缓冲区 out 之前首先查询 GetExportSize,以确保足够的缓冲区容量。 问题 Q-394ae08d9d7e6fa7 (未决)
错误处理
在出错情况下,将触发回滚语义并返回相应的错误码 [SWS_CRYPT_10711]:
ara::crypto::CryptoErrc::kInsufficientCapacity:所传入的输出缓冲区out尺寸过小 [SWS_CRYPT_10711]。ara::crypto::CryptoErrc::kUnsupportedFormat:所传入的格式标识符不支持此对象类型 [SWS_CRYPT_10711]。ara::crypto::CryptoErrc::kUnsupported:通常不支持导出该对象 [SWS_CRYPT_10711]。ara::crypto::CryptoErrc::kUsageViolation:待导出的对象是一个密钥,其使用规则不允许明文导出(kAllowPlaintextExport)[SWS_CRYPT_10711]。
并发性与边界条件
该方法被指定为 const、noexcept、线程安全(“thread-safe”)和异常安全(“exception safe”)[SWS_CRYPT_10711]。因此,它可以并发执行且不抛出 C++ 异常。
本使用说明由 AI 基于 AUTOSAR 规范 R25-11 生成。
实现者指南即将推出(复杂度 I1)
| Header-Datei | #include "ara/crypto/common/serializable.h" |
|---|---|
| Scope | class ara::crypto::Serializable |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | thread-safe |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| format | identifier of the output format |
Parameter (out)
| Parameter | Beschreibung |
|---|---|
| out | an output buffer that the serialized object will be written to |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Result<std::size_t > | A result containing the size in bytes of the serialized object or an error. |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics if the output buffer is too small |
| ara::crypto::CryptoErrc::kUnsupportedFormat | rollback_semantics if the specified format ID is not supported for this object type |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics if exporting the object is not supported |
| ara::crypto::CryptoErrc::kUsageViolation | rollback_semantics if the object to be exported is a key and the allowed usage of the key does not include kAllowPlaintextExport |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CRYPT_10711- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CRYPT_10711@rel:R25-11#3bfef152- Content hash
3bfef152- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_10711
Status: valid/unmigrated
Version: rel:R25-11#c8dd72d0
Versionshistorie & Revisions (1 transition, 8 revision)
- Current State
valid/unmigrated- Reason
- mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
- Campaign
2026-08-13-status-backfill- Active Version
AUTOSAR/AP/record/SWS_CRYPT_10711@rel:R25-11#c8dd72d0
Recorded Revisions (8):
- R25-11
rel:R25-11#6e8a805e2026-09-30 - R19-11
rel:R19-11#fe62960e2026-10-14 - R20-11
rel:R20-11#4cac78d62026-10-14 - R21-11
rel:R21-11#13d51a182026-10-14 - R22-11
rel:R22-11#3bb1942d2026-10-14 - R23-11
rel:R23-11#ee143e792026-10-14 - R24-11
rel:R24-11#761192782026-10-14 - R25-11
rel:R25-11#c8dd72d02026-10-14 active
Requirement Text as-of this release:
Curation Decisions:
Reachable Artifacts & Dependents:
| Date | Actor | Transition | Reason / Rationale | Campaign |
|---|---|---|---|---|
| 2026-08-13 | tool | none → valid/unmigrated | mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record | 2026-08-13-status-backfill |
gemini-3.8-flash-low· 2026-10-13 · 德文原文