Provides the general interface and shared pointer for asymmetric public keys.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 49ae23e669f8ProvenanceOpen questions (3)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Provides the general interface and shared pointer for asymmetric public keys.
The interface ara::crypto::cryp::PublicKey represents a general asymmetric public key object in module crypto and derives from CryptoObject. For referencing and forwarding, the class provides the type alias Sptr as std::shared_ptr<PublicKey>, which is included via header "ara/crypto/cryp/cryobj/public_key.h"[SWS_CRYPT_22701]. Interpretation: Applications likely pass instances of PublicKey::Sptr[SWS_CRYPT_22701] to cryptographic context classes for asymmetric verification or encryption. Question (open) The lifetime and release of the public key are completely governed via the reference count of the shared smart pointer.
Context
The class ara::crypto::cryp::PublicKey defines the general interface for asymmetric public keys (General Asymmetric Public Key interface) within module crypto of the AUTOSAR Adaptive Platform. According to its syntactic declaration, the class publicly inherits from CryptoObject. In this role, it acts as a base type and uniform interface contract for all asymmetric public key structures used in cryptographic operations. As a public key, an object of this class represents the mathematically open part of an asymmetric key pair, which is intended for verification or encryption purposes and contains no sensitive private key parameters. Access to the interface definition is provided via the header file #include "ara/crypto/cryp/cryobj/public_key.h" according to [SWS_CRYPT_22701]. Interpretation: Since PublicKey is directly derived from CryptoObject, the interface likely shares common properties and conventions for cryptographic objects of the platform, while simultaneously providing the specific abstraction of an asymmetric key. Question Q-83979c7ba039e328 (open)
Lifecycle
For managing and passing instances, the class provides the type alias Sptr, which is defined as std::shared_ptr<PublicKey>[SWS_CRYPT_22701]. Ownership of a public key is thus based on shared ownership. This enables different system components and callers to reference the same key instance concurrently without necessarily requiring an exclusive owner. The lifecycle of a concrete key instance is governed via the reference count of the standard smart pointer. As soon as the last reference is released and the counter reaches zero, controlled destruction of the object takes place. Interpretation: The explicit provision of alias Sptr[SWS_CRYPT_22701] likely indicates that instances of PublicKey are typically created via factories or loading routines of the crypto module and handed over directly to users as shared pointers, rather than being managed as raw pointers or value objects. Question Q-0cdb961ab357bc3b (open) Regarding concurrency, referencing via std::shared_ptr allows passing the pointer across threads; concurrent modifications typically do not occur with a pure public key, as it primarily serves as an immutable reference parameter.
Usage Path
A typical usage path for ara::crypto::cryp::PublicKey begins with including the corresponding header file "ara/crypto/cryp/cryobj/public_key.h"[SWS_CRYPT_22701]. Subsequently, the application obtains a reference to the key object in the form of the typed smart pointer ara::crypto::cryp::PublicKey::Sptr[SWS_CRYPT_22701]. This pointer represents the ready-to-use asymmetric key object. Interpretation: The obtained Sptr instance [SWS_CRYPT_22701] is likely passed to cryptographic context classes in subsequent steps, for example to verify digital signatures or asymmetrically encrypt data. Question Q-b4800044ca9f058a (open) After completion of the cryptographic verification or computation operations, the key object either remains in shared ownership for future verification procedures or is automatically released as soon as the scope of the local Sptr is exited. Due to encapsulation as an abstract interface, callers do not need to know internal algorithm details of the key, but instead interact via the uniform interface of PublicKey.
This guide is based on the AUTOSAR Adaptive specification R25-11 and was generated automatically.
UML class diagram
Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.
gemini-3.8-flash-low· 2026-10-13 · German original