DEENESPTFRRUARHIKOZHNL

class ara::crypto::cryp::EncryptorPublicCtx

[SWS_CRYPT_50173] Upstream: RS_CRYPTO_02201

class EncryptorPublicCtx :             public CryptoContext {...};

Interface for asymmetric encryption.

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Forwarding-Header#include "ara/crypto/crypto_fwd.h"
Scopenamespace ara::crypto::cryp
Basisklasse(n)CryptoContext

User GuideAI-GENERATED

Encrypts data asymmetrically in a single step or via a multi-part streaming operation.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9ba841f18186 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Encrypts data asymmetrically in a single step or via a multi-part streaming operation.

The interface serves for asymmetric encryption of plaintext data on the AUTOSAR Adaptive Platform and is managed via the provided smart pointer [SWS_CRYPT_50174]. After assigning a suitable public key, messages can be transformed either compactly in a single pass or continuously via a multi-part streaming session [SWS_CRYPT_50090]. For proper execution, buffer sizes must be calculated in advance, with all context operations specified as exception-safe and thread-safe.

Context

The C++ class ara::crypto::cryp::EncryptorPublicCtx provides the standardized interface for asymmetric data encryption in the AUTOSAR Adaptive Platform. It serves client applications for encrypting plaintext data using an asymmetric public key. Configuration of the cryptographic key can take place either directly via a key object ([SWS_CRYPT_50175]) or via a reference to a key slot (KeySlot, [SWS_CRYPT_50086]). Data transfer occurs via memory-efficient buffer regions (ReadOnlyMemRegion for plaintext data and ReadWriteMemRegion for the ciphertext output).

Lifecycle

Instances of the context are managed via the shared pointer std::shared_ptr<EncryptorPublicCtx> defined in the type alias Sptr ([SWS_CRYPT_50174]). The creation itself is not part of this interface definition; instantiation is presumably performed via a higher-level factory component of the crypto architecture. Question Q-5b7490ba113bb861 (open) The object passes through clearly defined states during its lifetime:

  • Uninitialized: After instantiation, the context does not yet possess a key. Data processing operations are not permitted in this state.
  • Configured (Ready): Calling SetKey() with an PublicKey ([SWS_CRYPT_50175]) or a KeySlot ([SWS_CRYPT_50086]) makes the context ready for use. From this state, either single-step encryption can be executed or a streaming session can be started.
  • Streaming active: The call to Start() ([SWS_CRYPT_50087]) places the context into the streaming state. Consecutive data blocks are processed via Update() ([SWS_CRYPT_50176]). The session is either completed with Finish() ([SWS_CRYPT_50088]) or aborted with Cancel() ([SWS_CRYPT_50089]), returning the context to the Configured state.

All methods of the class are specified as exception-safe (exception safe) and thread-safe (thread-safe). If the context is destroyed while a streaming operation has not yet finished, the underlying implementation is expected to clean up allocated buffers and implicitly discard the session. Question Q-3eadc946a0bdbdfd (open)

Lebenszyklus Uninitialized Not initialized Configured Konfiguriert (Bereit) Uninitialized->Configured SetKey() Configured->Configured SetKey() / Encrypt() Streaming Streaming active Configured->Streaming Start() Streaming->Configured Finish() / Cancel() Streaming->Streaming Update()

State diagram: Lifecycle and state transitions of the context from configuration to transformation. Sources: [SWS_CRYPT_50086], [SWS_CRYPT_50175], [SWS_CRYPT_50087], [SWS_CRYPT_50176], [SWS_CRYPT_50088], [SWS_CRYPT_50089], [SWS_CRYPT_50090]

Usage Path

The class supports two processing modes: single-step processing for complete datasets and multi-step streaming for segmented data streams. Before performing encryptions, applications must account for buffer limits:

  • Via GetMinimumChunkSize()` (<a class="spec-record-ref" data-req="SWS_CRYPT_50178">[SWS_CRYPT_50178]</a>) und <code>GetMaximumChunkSize() ([SWS_CRYPT_50091]), the minimum and maximum supported input sizes for individual calls can be determined.
  • The necessary capacity of the output buffer must be queried in advance with GetRequiredOutputBufferSize() ([SWS_CRYPT_50177]). The parameter isFinal controls whether the calculation is performed for intermediate steps (false) or final calls and single steps (true).

The typical sequence of a streaming encryption is divided into the following steps:

  1. Key assignment via SetKey() with a valid PublicKey ([SWS_CRYPT_50175]).
  2. Initialization of the streaming session by calling Start() ([SWS_CRYPT_50087]).
  3. Calculation of the required output buffer size for intermediate blocks with GetRequiredOutputBufferSize(inputSize, false) ([SWS_CRYPT_50177]).
  4. Repeated transformation of data blocks via Update() ([SWS_CRYPT_50176]).
  5. Determination of the buffer size for the last block (isFinal = true) and finalization of the operation via Finish() ([SWS_CRYPT_50088]).

For compact data that can be processed in a single pass, Encrypt() ([SWS_CRYPT_50090]) provides a direct single-step call without division into start, update, and finish phases.

Sequence of asymmetric streaming encryptionApplicationEncryptorPublicCtxUse Case: Configuration and initializationSetKey(key)Result<void>Start()Result<void>Use Case: Streaming-VerarbeitungGetRequiredOutputBufferSize(inputSize, false)Result<size_t>Update(in, out)Result<size_t> (ciphertext length)Use Case: AbschlussGetRequiredOutputBufferSize(finalInputSize, true)Result<size_t>Finish(finalIn, out)Result<size_t> (final ciphertext length)

Sequence diagram: Typical sequence of a multi-part streaming encryption with buffer size determination. Sources: [SWS_CRYPT_50175], [SWS_CRYPT_50087], [SWS_CRYPT_50177], [SWS_CRYPT_50176], [SWS_CRYPT_50088]

Error Scenarios

All methods use ara::core::Result for error signaling and guarantee rollback semantics in the event of an error:

This guide is based on the requirements of AUTOSAR Adaptive Platform Release R25-11 and summarizes the specification of the class ara::crypto::cryp::EncryptorPublicCtx.

Member map

Class diagram

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

G nara__crypto__cryp__EncryptorPublicCtx829 EncryptorPublicCtx + Cancel() + Encrypt() + Finish() + GetMaximumChunkSize() + GetMinimumChunkSize() + GetRequiredOutputBufferSize() + SetKey() + Start() + Update() nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__EncryptorPublicCtx829->nara__crypto__cryp__CryptoContext85

Detail view

Select an entry in the outline.

Methods

Cancel function

Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.

virtual ara::core::Result< void > Cancel () noexcept=0;
Encrypt function

Encrypt data in a single-call.

virtual ara::core::Result< std::size_t > Encrypt (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;
Finish function

Finalize the encryption.

virtual ara::core::Result< std::size_t > Finish (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), or Encrypt() by this context.

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

Get the minimum input buffer size supported for processing in single calls to Update(), Finish(), or Encrypt() by this context.

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

Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.

virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (std::size_t inputSize, bool isFinal) const noexcept;
SetKey function 2

Configure the context to use the key stored in the provided KeySlot at the time the encryption is started.

Overloads SetKey 2
virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0; SWS_CRYPT_50086
virtual ara::core::Result< void > SetKey (PublicKey::Sptr key) noexcept=0; SWS_CRYPT_50175
Start function

Initialize the context for a new encryption.

virtual ara::core::Result< void > Start () noexcept=0;
Update function

Encrypt a data buffer.

virtual ara::core::Result< std::size_t > Update (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Type aliases

Sptr type alias

Smart pointer of the interface.

Method documentation

function Cancel [SWS_CRYPT_50089] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Cancel () noexcept=0;

Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: c2111af75063 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The method Cancel() aborts an active streaming operation in context ara::crypto::cryp::EncryptorPublicCtx that was previously initiated via Start() and has not yet finished [SWS_CRYPT_50089]. It takes no input parameters and returns a ara::core::Result<void>, which is empty on success [SWS_CRYPT_50089]. Since the signature returns a Result directly and not a Future, the abort is likely executed synchronously. Question Q-cd18e56d693fe1a4 (open)

Error Handling and Concurrency

If data processing was not started in advance by Start(), the operation fails with the error code ara::crypto::CryptoErrc::kProcessingNotStarted complying with rollback semantics [SWS_CRYPT_50089]. According to the specification, the interface is declared with noexcept, exception safe, and classified as thread-safe for concurrent access [SWS_CRYPT_50089].

Interaction in the Crypto Stack

The abort behavior implemented by Cancel() follows a unified design pattern for stateful streaming operations in the crypto module. Analogous interfaces with identical error semantics exist for:

This text was created by an AI and is based on AUTOSAR Adaptive R25-11.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if data processing was not started by a call of the Start() method

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50089
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50089@rel:R25-11#e205d10b
Content hash
e205d10b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50089
Status: valid/unmigrated Version: rel:R25-11#e205d10b 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_50089@rel:R25-11#e205d10b
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

function Encrypt [SWS_CRYPT_50090] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > Encrypt (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Encrypt data in a single-call.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 523fe4336ba2 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The synchronous method Encrypt serves to encrypt plaintext data in a single call ([SWS_CRYPT_50090]). It accepts the input data from buffer in (ReadOnlyMemRegion) and writes the ciphertext into the output buffer out (ReadWriteMemRegion) ([SWS_CRYPT_50090]). In the success case, the return value ara::core::Result<std::size_t> returns the size of the output data actually written, which may be smaller than the total capacity of out ([SWS_CRYPT_50090]).

With respect to concurrency, the function is specified as thread-safe (thread-safe) as well as exception-safe (exception safe) ([SWS_CRYPT_50090]).

In interaction with context EncryptorPublicCtx, the following buffer limits must be observed prior to the call:

  • The input size must be within the limits specified by [SWS_CRYPT_50178] (GetMinimumChunkSize) and [SWS_CRYPT_50091] (GetMaximumChunkSize).
  • The maximum required capacity of the output buffer out can be calculated in advance via GetRequiredOutputBufferSize with the parameter isFinal = true ([SWS_CRYPT_50177]).

All error cases have rollback semantics ([SWS_CRYPT_50090]). The defined errors from ara::crypto::CryptoErrc include:

  • kUninitializedContext: The context was not initialized by providing a key ([SWS_CRYPT_50090]).
  • kEmptyKeySlot: A configured KeySlot is empty ([SWS_CRYPT_50090]).
  • kIncompatibleObject: The key type does not match the transformation ([SWS_CRYPT_50090]).
  • kUsageViolation: The key usage does not permit data encryption (kAllowDataEncryption) ([SWS_CRYPT_50090]).
  • kInsufficientCapacity: The buffer out is too small ([SWS_CRYPT_50090]).
  • kInvalidInputSize or kInvalidArgument: The input size cannot be processed or the input data is invalid ([SWS_CRYPT_50090]).
  • kUnsupported: Single-call encryption is not supported ([SWS_CRYPT_50090]).
  • kBusyResource: A required resource is busy ([SWS_CRYPT_50090]).

This usage note was generated by an AI based on the AUTOSAR specification.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
inan input data buffer containing the plaintext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the encrypted data is written to

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single-call encryption is not supported
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowData Encryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50090
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50090@rel:R25-11#6de65ef2
Content hash
6de65ef2
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50090
Status: valid/unmigrated Version: rel:R25-11#6de65ef2 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_50090@rel:R25-11#6de65ef2
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

function Finish [SWS_CRYPT_50088] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > Finish (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Finalize the encryption.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: ef643cd9b744 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The method Finish completes the asymmetric encryption operation in the context of ara::crypto::cryp::EncryptorPublicCtx [SWS_CRYPT_50088]. The call is synchronous and is specified as noexcept, exception-safe, and thread-safe. As parameters, the function accepts the final plaintext fragment via in (ReadOnlyMemRegion) and writes the resulting ciphertext data to the output buffer out (ReadWriteMemRegion). The required buffer size for out can be determined in advance via GetRequiredOutputBufferSize(). The return value ara::core::Result<std::size_t> returns the number of bytes actually written in the success case, which may be smaller than the total capacity of the output buffer [SWS_CRYPT_50088].

Error Handling and Concurrency

All error cases have rollback semantics, so that the context state remains consistent upon failure [SWS_CRYPT_50088]. The method reports the following specific error codes from ara::crypto::CryptoErrc:

  • kProcessingNotStarted: Data processing was not previously initiated by calling Start().
  • kInsufficientCapacity: The provided output buffer out is dimensioned too small.
  • kInvalidInputSize: The buffer size of in cannot be processed by the context.
  • kInvalidArgument: The passed input data contains invalid values.
  • kUnsupported: Stream processing is not supported by the concrete context.

Interaction

Finalization concludes the cryptographic processing sequence [SWS_CRYPT_50088]. DecryptorPrivateCtx::Finish [SWS_CRYPT_50068] acts as the complementary counterpart for decryption, while in the area of symmetric ciphers SymmetricCipherCtx::Finish [SWS_CRYPT_50045] provides a comparable sequence pattern.

This text was generated by an AI process based on the specification.

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
inan input data buffer containing a part of the plaintext

Parameter (out)

ParameterBeschreibung
outan output data buffer that contains encrypted data. The required size of this buffer can be queried using GetRequiredOutputBuffer Size()

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50088
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50088@rel:R25-11#3b39f5a6
Content hash
3b39f5a6
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50088
Status: valid/unmigrated Version: rel:R25-11#3b39f5a6 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_50088@rel:R25-11#3b39f5a6
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

function GetMaximumChunkSize [SWS_CRYPT_50091] Upstream: RS_CRYPTO_02309

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

Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), or Encrypt() by this context.

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >the maximum buffer size in bytes

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50091
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50091@rel:R25-11#45b93821
Content hash
45b93821
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50091
Status: valid/unmigrated Version: rel:R25-11#45b93821 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_50091@rel:R25-11#45b93821
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

function GetMinimumChunkSize [SWS_CRYPT_50178] Upstream: RS_CRYPTO_02309

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

Get the minimum input buffer size supported for processing in single calls to Update(), Finish(), or Encrypt() by this context.

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >the minimum buffer size in bytes

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50178
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50178@rel:R25-11#96524bdd
Content hash
96524bdd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50178
Status: valid/unmigrated Version: rel:R25-11#96524bdd 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_50178@rel:R25-11#96524bdd
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

function GetRequiredOutputBufferSize [SWS_CRYPT_50177] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (std::size_t inputSize, bool isFinal) const noexcept;

Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
inputSizesize of input data
isFinalif true, calculate maximum required output buffer size for Finish() or Encrypt(), otherwise for Update()

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the required capacity of the output buffer (in bytes) or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if the context was not initialized by deploying a key and setting the transformation direction

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50177
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50177@rel:R25-11#7b76dbd4
Content hash
7b76dbd4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50177
Status: valid/unmigrated Version: rel:R25-11#7b76dbd4 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_50177@rel:R25-11#7b76dbd4
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

function SetKey [SWS_CRYPT_50086] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0;

Configure the context to use the key stored in the provided KeySlot at the time the encryption is started.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: e68fdee554ba Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Call Context

The pure virtual method SetKey of interface ara::crypto::cryp::EncryptorPublicCtx (header file ara/crypto/cryp/encryptor_public_ctx.h) serves to assign a key for asymmetric cipher operations [SWS_CRYPT_50086]. A smart pointer keySlot of type KeySlot::Sptr, which must contain a PublicKey, is passed as a parameter [SWS_CRYPT_50086]. The call is synchronous and signals success via an empty ara::core::Result<void>. Essential for the semantics is that the key stored in the slot is used only at the point in time when the encryption is started [SWS_CRYPT_50086]. (Interpretation: Since key resolution takes place only with the actual encryption start, updates to the slot content before this start time should still take effect.) Question Q-25c5d462aafde8a1 (open)

Error handling

If configuration fails, an error code with rollback semantics is returned in the result object [SWS_CRYPT_50086]:

  • ara::crypto::CryptoErrc::kIncompatibleObject: Reported if the provided keySlot is incompatible with this context [SWS_CRYPT_50086].
  • ara::crypto::CryptoErrc::kUnsupported: Occurs if the concrete context implementation exclusively supports direct setting of a PublicKey and does not permit key binding via a KeySlot [SWS_CRYPT_50086].

Concurrency and Interaction

The operation is declared as noexcept, exception-safe (exception safe), and specified as thread-safe (thread-safe) for concurrent use [SWS_CRYPT_50086].

The concept of indirect key referencing via KeySlot is also found in a comparable manner in other asymmetric contexts, such as VerifierPublicCtx::SetKey [SWS_CRYPT_50018] and KeyEncapsulatorPublicCtx::SetKey [SWS_CRYPT_50012]. It differs from methods that accept key objects directly, such as in [SWS_CRYPT_24115] or [SWS_CRYPT_21815].

This usage note was generated by an AI based on the AUTOSAR specification.

Implementer's Guide to follow (complexity I2)

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
keySlota keyslot containing a PublicKey.

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided keyslot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context only supports setting a PublicKey

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50086
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50086@rel:R25-11#bd5ede4d
Content hash
bd5ede4d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50086
Status: valid/unmigrated Version: rel:R25-11#bd5ede4d 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_50086@rel:R25-11#bd5ede4d
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

function SetKey [SWS_CRYPT_50175] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

virtual ara::core::Result< void > SetKey (PublicKey::Sptr key) noexcept=0;

Configure the context to use the provided key.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 09de2ed1c4fc Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The virtual method SetKey of class ara::crypto::cryp::EncryptorPublicCtx configures the context to use a provided public key [SWS_CRYPT_50175]. The key object to be used for encryption is passed via parameter key (of type PublicKey::Sptr) [SWS_CRYPT_50175]. Execution is synchronous and returns a ara::core::Result<void>, which contains no value on success [SWS_CRYPT_50175].

Error handling

If an error occurs during configuration, a corresponding error code with defined rollback semantics is reported [SWS_CRYPT_50175]:

  • ara::crypto::CryptoErrc::kUsageViolation: The allowed key usage does not permit data encryption (kAllowDataEncryption) [SWS_CRYPT_50175].
  • ara::crypto::CryptoErrc::kIncompatibleObject: The passed key object is incompatible with this encryption context [SWS_CRYPT_50175].
  • ara::crypto::CryptoErrc::kUnsupported: The concrete context implementation exclusively supports binding via a KeySlot [SWS_CRYPT_50175].

Concurrency and Limitations

The interface is defined as noexcept and specifies a behavior that is both thread-safe and exception safe [SWS_CRYPT_50175]. Thanks to the rollback semantics, the context remains in its previous state in the event of an error. Interpretation: A successful call is likely a mandatory prerequisite for subsequent encryption operations, as the context cannot perform any operations without an assigned key. Question Q-ab4779cac18793fa (open)

Interaction

This approach follows the module-wide pattern of asymmetric contexts, as also used in VerifierPublicCtx::SetKey [SWS_CRYPT_24115] and KeyEncapsulatorPublicCtx::SetKey [SWS_CRYPT_21815] for key binding. Alternatively, related interfaces also provide KeySlot variants for configuration, such as in VerifierPublicCtx [SWS_CRYPT_50018] or KeyEncapsulatorPublicCtx [SWS_CRYPT_50012].

This text was generated by an AI system based on the AUTOSAR R25-11 specification.

Implementer's Guide to follow (complexity I2)

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
keythe PublicKey to be used for encryption

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context only supports setting a KeySlot
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided key object is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowData Encryption

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50175
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50175@rel:R25-11#52d22e05
Content hash
52d22e05
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50175
Status: valid/unmigrated Version: rel:R25-11#52d22e05 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_50175@rel:R25-11#52d22e05
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

function Start [SWS_CRYPT_50087] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Start () noexcept=0;

Initialize the context for a new encryption.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 50b972147b28 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Semantics

The pure virtual method Start of class ara::crypto::cryp::EncryptorPublicCtx serves to initialize the context for a new encryption [SWS_CRYPT_50087]. It takes no input parameters and is executed synchronously. As a return value, the function returns an ara::core::Result<void> that either confirms successful initialization or conveys an occurred error code [SWS_CRYPT_50087].

Error handling and rollback behavior

If the required preconditions for the encryption operation are not met, the call fails. The specification guarantees rollback semantics for error cases and defines the following error causes [SWS_CRYPT_50087]:

  • UninitializedContext: No key was assigned to the context in advance.
  • ara::crypto::CryptoErrc::kEmptyKeySlot: A configured KeySlot is currently unoccupied.
  • ara::crypto::CryptoErrc::kUsageViolation: The permissions of the key do not contain the usage flag kAllowDataEncryption.
  • ara::crypto::CryptoErrc::kIncompatibleObject: The assigned key type is incompatible with the required transformation.
  • ara::crypto::CryptoErrc::kBusyResource: A resource required for initialization is occupied.
  • ara::crypto::CryptoErrc::kUnsupported: Stream processing is not supported by the concrete context.

Concurrency and Interaction

The method is specified as thread-safe and exception safe [SWS_CRYPT_50087]. Providing a suitable key in the context is a mandatory precondition for success. Conceptually, the function fits into standardized lifecycles of cryptographic contexts in which operations are prepared via parameterless calls – comparable to signature verifications [SWS_CRYPT_50019], signature generations [SWS_CRYPT_50037], or MAC calculations [SWS_CRYPT_22111]. The call should represent the mandatory starting point before the actual execution of a stream encryption. Question Q-db262c3914e6b4cf (open)

This usage note was generated automatically based on the AUTOSAR specification R25-11.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe ara::crypto::CryptoErrc::k rollback_semantics

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
UninitializedContextif the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowData Encryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50087
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50087@rel:R25-11#d8c9987f
Content hash
d8c9987f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50087
Status: valid/unmigrated Version: rel:R25-11#d8c9987f 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_50087@rel:R25-11#d8c9987f
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

function Update [SWS_CRYPT_50176] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > Update (ReadOnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Encrypt a data buffer.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 01cf25c1d489 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The synchronous method Update of class ara::crypto::cryp::EncryptorPublicCtx serves to encrypt plaintext data blocks step by step [SWS_CRYPT_50176]. A portion of the plaintext is passed via parameter in (ReadOnlyMemRegion), while the encrypted data is written to the output buffer out (ReadWriteMemRegion) [SWS_CRYPT_50176]. As a return value, the function provides via ara::core::Result<std::size_t> the actual number of bytes written, which can be smaller than the provided capacity of out [SWS_CRYPT_50176].

Sequence and Interaction

Prior to the first call to Update, data processing must mandatory have been initiated by Start() [SWS_CRYPT_50176]. The maximum permitted input size for individual calls can be queried via method GetMaximumChunkSize() [SWS_CRYPT_50091]. In addition, the minimum size required for out can be calculated via GetRequiredOutputBufferSize() [SWS_CRYPT_50176].

Error Handling and Concurrency

If an error occurs during execution, it is reported with rollback semantics [SWS_CRYPT_50176]:

  • ara::crypto::CryptoErrc::kProcessingNotStarted: Data processing was not previously started with Start() [SWS_CRYPT_50176].
  • ara::crypto::CryptoErrc::kInsufficientCapacity: The capacity of buffer out is insufficient for the result [SWS_CRYPT_50176].
  • ara::crypto::CryptoErrc::kInvalidInputSize: The buffer size of in is invalid [SWS_CRYPT_50176].
  • ara::crypto::CryptoErrc::kUnsupported: Stream processing is not supported by the current context [SWS_CRYPT_50176].

The method is declared as exception-safe and thread-safe [SWS_CRYPT_50176]. Nevertheless, parallel calls of multiple operations on the same context object are presumably likely to require external synchronization in order to guarantee a deterministic order of the encrypted data fragments. Question Q-b22ffe505b583b25 (open)

This text was created by an AI and serves as guidance. The specification is binding.

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
inan input data buffer containing a part of the plaintext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the encrypted data will be written into. The required size of this buffer can be queried using GetRequired OutputBufferSize()

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50176
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50176@rel:R25-11#89552c35
Content hash
89552c35
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50176
Status: valid/unmigrated Version: rel:R25-11#89552c35 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_50176@rel:R25-11#89552c35
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

Type alias documentation

type alias Sptr [SWS_CRYPT_50174] Upstream: RS_CRYPTO_02201

using Sptr = std::shared_ptr<EncryptorPublicCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/encryptor_public_ctx.h"
Scopeclass ara::crypto::cryp::EncryptorPublicCtx
SymbolSptr

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50174
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50174@rel:R25-11#e0ee55ea
Content hash
e0ee55ea
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50174
Status: valid/unmigrated Version: rel:R25-11#e0ee55ea 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_50174@rel:R25-11#e0ee55ea
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