DEENESPTFRRUARHIKOZHNL

클래스 ara::crypto::Serializable

[SWS_CRYPT_10700] Upstream: RS_CRYPTO_02105

class Serializable {...};

Serializable object interface.

Header-Datei#include "ara/crypto/common/serializable.h"
Forwarding-Header#include "ara/crypto/crypto_fwd.h"
Scopenamespace ara::crypto

사용자 가이드AI 생성

암호화 객체의 크기 결정 및 공개 직렬화를 위한 인터페이스를 정의합니다.
AI 생성 미검증 모델: gemini-3.8-flash-medium · 노력: medium · 온도: 제어 불가 · 프롬프트: dacacac17ff9 출처 열린 질문 (1)
독일어 가이드에서 번역됨gemini-3.8-flash-low · 2026-10-13 · 독일어 원문

암호화 객체의 크기 결정 및 공개 직렬화를 위한 인터페이스를 정의합니다.

인터페이스 ara::crypto::Serializable은(는) 암호화 객체를 포맷별 바이트 시퀀스로 공개 내보내기하기 위한 통일된 표준을 정의합니다. 애플리케이션은 사전에 GetExportSize()을(를) 통해 필요한 버퍼 크기를 결정한 후, ExportPublicly()을(를) 통해 제공된 버퍼로 실제 직렬화를 수행합니다[SWS_CRYPT_10711]. 모든 작업은 예외 안전(exception-safe)하고 스레드 안전(thread-safe)하며, 키 내보내기에는 반드시 kAllowPlaintextExport 권한이 필요하고 오류에는 항상 롤백 시맨틱이 적용됩니다[SWS_CRYPT_50006].

컨텍스트

인터페이스 ara::crypto::Serializable은(는) 표준화된 바이트 표현으로 변환될 수 있는 crypto 모듈의 암호화 객체에 대한 추상 계약을 정의합니다. 순수 인터페이스로서 포맷 식별자(FormatId)에 의해 지정된 출력 포맷으로 객체를 직렬화하는 기능을 캡슐화합니다[SWS_CRYPT_10711]. 일반적인 상호작용 파트너에는 키나 인증서와 같은 암호화 아티팩트를 영구적으로 저장하거나, 통신 채널을 통해 전송하거나, 일반 텍스트로 교환해야 하는 애플리케이션 또는 플랫폼 컴포넌트가 포함됩니다. 이 인터페이스는 포맷 및 보안 제약을 고려하여 내보내기가 통제된 방식으로 수행되도록 보장합니다.

수명 주기

ara::crypto::Serializable은(는) 순수 가상 메서드를 갖는 순수 가상 인터페이스이므로 클래스 자체의 인스턴스화 로직을 갖지 않습니다. 수명과 생성은 인터페이스를 구현하는 파생된 구체적인 암호화 클래스에 전적으로 의존합니다. 인터페이스의 두 지정된 메서드인 GetExportSize() [SWS_CRYPT_50006] 및 ExportPublicly() [SWS_CRYPT_10711]은(는) const(으)로 선언되어 있으며 직렬화 시 객체의 내부 상태를 변경하지 않습니다. 사양에 따르면 작업은 예외 안전(exception safe) 및 스레드 안전(thread-safe)하도록 설계되어 있으므로[SWS_CRYPT_10711], [SWS_CRYPT_50006] 동일한 객체 인스턴스에 대한 병렬 읽기 접근이 허용됩니다.

사용 경로

내보내기의 일반적인 흐름은 크기 결정 및 실제 직렬화의 2단계 시퀀스로 나뉩니다. 버퍼 오버플로나 실패하는 할당을 방지하기 위해 호출자는 사전에 메서드 GetExportSize()을(를) 통해 원하는 대상 포맷에 대해 정확히 필요한 버퍼 크기(바이트 단위)를 쿼리합니다[SWS_CRYPT_50006]. 성공적인 응답 후 호출자는 ReadWriteMemRegion 타입의 쓰기 가능한 메모리 영역을 제공합니다. 대부분의 구현에서 이 메모리 영역은 결정된 바이트 수에 따라 동적으로 할당되거나 사전 예약된 메모리 풀에서 제공될 것으로 추정됩니다. 질문 Q-0c04ba0a352f0a37 (열림)

이어진 단계에서 애플리케이션은 ExportPublicly()을(를) 호출하고 제공된 버퍼와 앞서 선택한 FormatId을(를) 모두 전달합니다[SWS_CRYPT_10711]. 객체는 전달된 메모리 영역으로 페이로드를 직렬화하고, 성공 시 반환 타입 ara::core::Result<std::size_t> 내에서 실제로 기록된 바이트 수를 반환합니다[SWS_CRYPT_10711].

ara::crypto::Serializable을 통한 직렬화 흐름애플리케이션SerializableGetExportSize(format)Result<std::size_t>(버퍼 크기)Bereitstellung ReadWriteMemRegionExportPublicly(out, format)Result<std::size_t> (geschriebene Bytes)

시퀀스 다이어그램: 크기 쿼리 및 후속 내보내기를 통한 객체 직렬화의 일반적인 호출 순서. 출처: [SWS_CRYPT_50006], [SWS_CRYPT_10711]

오류 시나리오

인터페이스의 작업은 반환 타입 ara::core::Result을(를) 통해 오류 상태를 알리며, 지정된 모든 오류는 엄격한 롤백 시맨틱(rollback_semantics)을 보장합니다[SWS_CRYPT_10711], [SWS_CRYPT_50006]. 호출이 실패하더라도 전체 시스템은 일관된 상태로 유지됩니다. 다음과 같은 오류 케이스가 정의되어 있습니다:

  • ara::crypto::CryptoErrc::kUnsupportedFormat: 구체적인 객체 유형에 대해 지정된 FormatId이(가) 지원되지 않는 경우 GetExportSize() [SWS_CRYPT_50006] 및 ExportPublicly() [SWS_CRYPT_10711] 모두에 의해 반환됩니다.
  • ara::crypto::CryptoErrc::kInsufficientCapacity: 전달된 ReadWriteMemRegion 버퍼의 용량이 직렬화된 데이터에 충분하지 않은 경우 ExportPublicly()에서 발생합니다[SWS_CRYPT_10711].
  • ara::crypto::CryptoErrc::kUnsupported: 특정 객체에 대해 원칙적으로 내보내기가 지원되지 않는 경우 ExportPublicly()에 의해 보고됩니다[SWS_CRYPT_10711].
  • ara::crypto::CryptoErrc::kUsageViolation: 객체가 사용 규칙상 일반 텍스트 내보내기를 허용하지 않는 키인 경우(허용된 사용에 kAllowPlaintextExport이(가) 포함되지 않음) ExportPublicly()에서 발생합니다[SWS_CRYPT_10711].

이 가이드는 AUTOSAR R25-11 사양을 기반으로 합니다.

UML 클래스 다이어그램

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__crypto__Serializable855 Serializable + ExportPublicly() + GetExportSize() nara__crypto__cryp__CryptoObject679 CryptoObject nara__crypto__cryp__CryptoObject679->nara__crypto__Serializable855 nara__crypto__x509__CertSignRequest934 CertSignRequest nara__crypto__x509__CertSignRequest934->nara__crypto__Serializable855 nara__crypto__x509__Certificate240 Certificate nara__crypto__x509__Certificate240->nara__crypto__Serializable855 nara__crypto__x509__X509DN930 X509DN nara__crypto__x509__X509DN930->nara__crypto__Serializable855

메서드

Serialize object using the provided format.

virtual ara::core::Result< std::size_t > ExportPublicly (ReadWriteMem Region out, FormatId format) const noexcept=0;

Get the size in bytes of the object when serialized in the provided format using ExportPublicly()

virtual ara::core::Result< std::size_t > GetExportSize (FormatId format) const noexcept=0;

메서드 문서

함수 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.

AI 생성 미검증 모델: gemini-3.8-flash-medium · 노력: medium · 온도: 제어 불가 · 프롬프트: 499fb38eb87a 출처 열린 질문 (1)
독일어 가이드에서 번역됨gemini-3.8-flash-low · 2026-10-13 · 독일어 원문

사용

인터페이스 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++ 예외를 발생시키지 않습니다.

이 사용 지침은 AUTOSAR 사양 R25-11을 바탕으로 AI에 의해 생성되었습니다.

구현자 가이드 준비 중 (복잡도 I1)

Header-Datei#include "ara/crypto/common/serializable.h"
Scopeclass ara::crypto::Serializable
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
formatidentifier of the output format

Parameter (out)

ParameterBeschreibung
outan output buffer that the serialized object will be written to

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size in bytes of the serialized object or an error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics if the specified format ID is not supported for this object type
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if exporting the object is not supported
ara::crypto::CryptoErrc::kUsageViolationrollback_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#6a61e237
Content hash
6a61e237
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
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#6e8a805e2026-09-30
  • R19-11rel:R19-11#fe62960e2026-10-14
  • R20-11rel:R20-11#4cac78d62026-10-14
  • R21-11rel:R21-11#13d51a182026-10-14
  • R22-11rel:R22-11#3bb1942d2026-10-14
  • R23-11rel:R23-11#ee143e792026-10-14
  • R24-11rel:R24-11#761192782026-10-14
  • R25-11rel:R25-11#c8dd72d02026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

함수 GetExportSize [SWS_CRYPT_50006] Upstream: RS_CRYPTO_02112

virtual ara::core::Result< std::size_t > GetExportSize (FormatId format) const noexcept=0;

Get the size in bytes of the object when serialized in the provided format using ExportPublicly()

Header-Datei#include "ara/crypto/common/serializable.h"
Scopeclass ara::crypto::Serializable
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
formatidentifier of the output format

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size in bytes of the serialized object or an error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedFormatrollback_semantics if the specified format ID is not supported for this object type

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50006
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50006@rel:R25-11#b536d156
Content hash
b536d156
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50006
Status: valid/unmigrated Version: rel:R25-11#6c5e92f9 Versionshistorie & Revisions (1 transition)
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_50006@rel:R25-11#6c5e92f9
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill