DEENESPTFRRUARHIKOZHNL

class ara::crypto::cryp::PrivateKey

[SWS_CRYPT_22500] Upstream: RS_CRYPTO_02002, RS_CRYPTO_02403

class PrivateKey :         public CryptoObject {...};

Generalized Asymmetric Private Key interface.

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

User GuideAI-GENERATED

Encapsulates asymmetric private keys and provides the corresponding public key.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: cbfbff2bb90c Provenance Open questions (3)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Encapsulates asymmetric private keys and provides the corresponding public key.

The interface ara::crypto::cryp::PrivateKey defines the general interface for asymmetric private keys in AUTOSAR Adaptive and is primarily managed via the shared-pointer alias PrivateKey::Sptr [SWS_CRYPT_22501]. Its central function GetPublicKey() allows retrieving the associated public key as PublicKey::Sptr in order to provide it for cryptographic partner operations [SWS_CRYPT_22511]. This retrieval is specified as thread-safe and exception-safe without standardized error codes, where any errors would likely be signaled in an implementation-specific manner via the return type ara::core::Result (interpretation). Question (open)

Context

In the AUTOSAR Adaptive Platform, the interface ara::crypto::cryp::PrivateKey acts as a generalized interface for asymmetric private keys within the module crypto. It is declared in the header file ara/crypto/cryp/cryobj/private_key.h and derives directly from the base interface CryptoObject. As a core component of the asymmetric cryptography system, PrivateKey encapsulates the confidential key material required for cryptographic operations such as generating digital signatures or asymmetric decryption procedures.

In addition to the base class CryptoObject, the primary interaction partners include in particular the corresponding public key interface PublicKey as well as consuming crypto services and application routines. While the private key must always be kept secret, the interface enables the direct provisioning of the associated public key [SWS_CRYPT_22511] via the member function GetPublicKey(). In this way, a fixed type-related relationship between the private key and its mathematical counterpart is realized.

PrivateKeyContext Anwendung Anwendung PrivateKey PrivateKey Anwendung->PrivateKey nutzt Sptr PublicKey PublicKey Anwendung->PublicKey empfaengt Sptr CryptoObject CryptoObject PrivateKey->CryptoObject erbt von PrivateKey->PublicKey provides via GetPublicKey()

Context diagram: Embedding of PrivateKey in the cryptographic object model and relationship to the corresponding PublicKey. Sources: [SWS_CRYPT_22501], [SWS_CRYPT_22511]

Lifecycle

Instances of the interface PrivateKey are managed and passed via the typed smart pointer PrivateKey::Sptr, which is defined as a type alias for std::shared_ptr<PrivateKey> [SWS_CRYPT_22501]. This shared pointer ensures shared ownership and automatic resource management via reference counting, so that the protected key material is released as soon as the last reference expires.

Since PrivateKey represents an abstract interface with pure virtual methods such as GetPublicKey() [SWS_CRYPT_22511], applications cannot instantiate the class directly. The creation and provisioning of concrete instances of PrivateKey::Sptr is likely to take place via specialized factories, key management components, or crypto providers of the Adaptive system (interpretation). Question Q-f0f9fe2258fac168 (open) The interface itself defines no discrete internal states or state transitions.

Regarding concurrency, the interface explicitly specifies thread safety (thread-safe) for the central member function GetPublicKey() [SWS_CRYPT_22511]. This allows multiple threads of execution concurrent, synchronization-free read access to the same key instance to obtain the corresponding public key.

Usage Path

The typical usage path of PrivateKey includes receiving the private key and subsequently extracting the corresponding public key for validation, registration, or communication purposes:

  1. Key acquisition: The consuming software component receives a valid instance of an asymmetric private key in the form of a PrivateKey::Sptr [SWS_CRYPT_22501].
  2. Retrieving the partner key: If the corresponding public key is required for a downstream workflow, the component invokes the member function GetPublicKey() on the instance [SWS_CRYPT_22511].
  3. Result processing: The call returns a ara::core::Result<PublicKey::Sptr> [SWS_CRYPT_22511]. The application checks the result object for success and, upon successful execution, unwraps the pointer PublicKey::Sptr.
  4. Further usage: The obtained public key can subsequently be transmitted to external communication partners or passed to local verification routines. Internally, the derivation of the public key is presumably performed directly from the mathematical key parameters of the private key (interpretation). Question Q-464000dc5d638649 (open)

Error Scenarios

For error-free integration, the error properties and preconditions/postconditions of GetPublicKey() are decisive:

  • Standardized errors: According to the specification, the function GetPublicKey() defines no standardized error codes [SWS_CRYPT_22511].
  • Error channel: Although no standardized errors are defined, the return type ara::core::Result transports potential failures. If an error occurs during internal key derivation or object creation, the result object would likely contain implementation-specific error codes of the underlying crypto drivers (interpretation). Question Q-4af6390594d9c5e1 (open)
  • Exception safety: The function is explicitly classified as exception-safe (exception safe) and designated with the identifier noexcept [SWS_CRYPT_22511]. Callers therefore do not need to catch C++ exceptions.
  • Pre- and postconditions: The precondition for a successful call is a valid, unreleased PrivateKey instance. As a postcondition, the interface guarantees the return of a PublicKey::Sptr upon success that corresponds mathematically exactly to the private key [SWS_CRYPT_22511].

This class guide was generated by an AI based on the AUTOSAR Adaptive R25-11 specification.

UML class diagram

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

G nara__crypto__cryp__PrivateKey762 PrivateKey + GetPublicKey() nara__crypto__cryp__CryptoObject679 CryptoObject nara__crypto__cryp__PrivateKey762->nara__crypto__cryp__CryptoObject679 nara__crypto__Serializable855 Serializable nara__crypto__cryp__CryptoObject679->nara__crypto__Serializable855

Methods

GetPublicKey function

The interface shall return the public key correspondent to this private key.

virtual ara::core::Result< PublicKey::Sptr > GetPublicKey () const noexcept=0;

Type aliases

Sptr type alias

shared smart pointer of the interface.

Method documentation

function GetPublicKey [SWS_CRYPT_22511] Upstream: RS_CRYPTO_02108, RS_CRYPTO_02115

virtual ara::core::Result< PublicKey::Sptr > GetPublicKey () const noexcept=0;

The interface shall return the public key correspondent to this private key.

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

use

The method GetPublicKey of class ara::crypto::cryp::PrivateKey serves to synchronously retrieve the public key corresponding to the private key [SWS_CRYPT_22511]. The call is parameterless on an existing instance of PrivateKey. As return value, the interface returns a ara::core::Result<PublicKey::Sptr>, which upon successful execution provides a shared pointer to the associated PublicKey object [SWS_CRYPT_22511].

Error Handling and Concurrency

No standardized error codes are defined in the specification for this method [SWS_CRYPT_22511]. Error handling is performed via the return object of type ara::core::Result. Because the operation is declared as noexcept, it is considered exception-safe (exception safe) [SWS_CRYPT_22511]. In addition, the method is qualified as const and specified as thread-safe (thread-safe), whereby concurrent read access across multiple threads is permitted [SWS_CRYPT_22511].

Interaction

In typical cryptographic workflows, GetPublicKey is used after generating an asymmetric key pair using GeneratePrivateKey [SWS_CRYPT_20722]. In doing so, the permitted usage flags of the generated private key are transferred to the corresponding public key (for example, the permission for signature verification from signature generation) [SWS_CRYPT_20722]. The function must be distinguished from the interface of the same name in ProtectedKeyImportCtx, which serves to unpack imported public keys [SWS_CRYPT_50211].

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

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/crypto/cryp/cryobj/private_key.h"
Scopeclass ara::crypto::cryp::PrivateKey
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result< PublicKey::Sptr >A result containing a shared pointer to the public key correspondent to this private key

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_22511
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_22511@rel:R25-11#f0d041e7
Content hash
f0d041e7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_22511
Status: valid/unmigrated Version: rel:R25-11#e5f0457b 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_22511@rel:R25-11#e5f0457b
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#f0d041e72026-09-30
  • R19-11rel:R19-11#bb931c232026-10-14
  • R20-11rel:R20-11#85846a1e2026-10-14
  • R21-11rel:R21-11#85846a1e2026-10-14
  • R22-11rel:R22-11#99b114f02026-10-14
  • R23-11rel:R23-11#6fdc19552026-10-14
  • R24-11rel:R24-11#a752dbfc2026-10-14
  • R25-11rel:R25-11#e5f0457b2026-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

Type alias documentation

type alias Sptr [SWS_CRYPT_22501] Upstream: RS_CRYPTO_02306

using Sptr = std::shared_ptr<PrivateKey>;

shared smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/cryobj/private_key.h"
Scopeclass ara::crypto::cryp::PrivateKey
SymbolSptr

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

Record
AUTOSAR/AP/record/SWS_CRYPT_22501
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_22501@rel:R25-11#568a064f
Content hash
568a064f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_22501
Status: valid/unmigrated Version: rel:R25-11#48b56da1 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_22501@rel:R25-11#48b56da1
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#568a064f2026-09-30
  • R19-11rel:R19-11#c428ba2c2026-10-14
  • R20-11rel:R20-11#fb4c3bbd2026-10-14
  • R21-11rel:R21-11#fb4c3bbd2026-10-14
  • R22-11rel:R22-11#6e7979fe2026-10-14
  • R23-11rel:R23-11#d106cca42026-10-14
  • R24-11rel:R24-11#5eb65ced2026-10-14
  • R25-11rel:R25-11#48b56da12026-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