function CompareKey [SWS_DM_00765] Upstream: RS_AP_00138, RS_Diag_04005, RS_Diag_04170, RS_AP_00119
virtual ara::core::Future< KeyCompareResultType > CompareKey (ara::core::Span< const std::uint8_t > key, const MetaInfo &metaInfo, CancellationHandler cancellationHandler) noexcept=0;
This method is called, when a diagnostic request has been finished, to notify about the outcome.
use
The pure virtual method CompareKey from class ara::diag::SecurityAccess [SWS_DM_00765] is implemented application-side to validate the key transmitted by the client in UDS service 0x27 (SecurityAccess) SWS Diagnostics §7.3.2.8.9 “Service 0x27 – SecurityAccess”. Together with GetSeed, it forms the basis for the static seed-key mechanism according to ISO 14229-1 [SWS_DM_00863].
The parameters of the function include:
key: Aara::core::Span<const std::uint8_t>to the key data to be verified. The buffer remains valid until the associated promise is fulfilled or processing is canceled viacancellationHandler[SWS_DM_00765].metaInfo: Meta-information of the incoming diagnostic request [SWS_DM_00765].cancellationHandler: Enables querying a cancellation viacancellationHandler.IsCanceledas well as registering a notification function viacancellationHandler.SetNotifierupon cancellation of conversation [SWS_DM_00765].
The check result is provided asynchronously via ara::core::Future<KeyCompareResultType> [SWS_DM_00765].
Error Handling and Interaction
If key comparison fails or an error occurs during processing, an appropriate Negative Response Code (NRC) in accordance with ISO 14229-1 must be passed via the future using DiagUdsNrcErrc [SWS_DM_00765]. If the requested sub-function is not configured for CompareKey, the request is answered with NRC 0x12 (kSubFunctionNotSupported) [SWS_DM_00363]. The Diagnostic Server counts failed attempts [SWS_DM_00270] and compares them with threshold values [SWS_DM_00271].
If security access is successfully unlocked, the server updates the security level internally [SWS_DM_00846], resets the failed attempt counter [SWS_DM_00270], and reports the security event SEV_UDS_SECURITY_ACCESS_SUCCESSFUL to the IdsM [SWS_DM_02019].
Concurrency and Limitations
The interface is declared as noexcept and exception safe [SWS_DM_00765]. Thread safety is conditional: whether the implementation must be thread-safe is determined via the ConcurrencyType passed in the constructor of SecurityAccess [SWS_DM_00765].
This usage note was generated by an AI based on the AUTOSAR specification.
Implementer's Guide to follow (complexity I2)
| Header-Datei | #include "ara/diag/security_access.h" |
|---|---|
| Scope | class ara::diag::SecurityAccess |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | conditional whether the function has to be implemented thread safe or non-thread safe is determined by the ConcurrencyType given in the constructor |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| key | The key to be validated. Lifetime: Valid until Promise is fulfilled or the processing is cancelled by the cancellationHandler. |
| metaInfo | MetaInfo of the request. |
| cancellationHandler | This parameter is used to • Query the current cancellation status by calling cancellationHandler.IsCanceled. Returns TRUE in case, the current conversation has been cancelled and FALSE otherwise. • Register a notifier function by calling cancellationHandler.SetNotifier. The registered notifier is called if the current conversation is cancelled. |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Future< KeyCompareResultType > | Result of the key validation. |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| Please use an applicable NRC, as defined in ISO 14229-1, using DiagUdsNrcErrc. | |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_DM_00765- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_DM_00765@rel:R25-11#d4d3823f- Content hash
d4d3823f- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00765
Status: valid/unmigrated
Version: rel:R25-11#fcff65aa
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_DM_00765@rel:R25-11#fcff65aa
Recorded Revisions (8):
- R25-11
rel:R25-11#d4d3823f2026-09-30 - R19-11
rel:R19-11#4bf18d9e2026-10-14 - R20-11
rel:R20-11#52ff58612026-10-14 - R21-11
rel:R21-11#42d7f4462026-10-14 - R22-11
rel:R22-11#94736e912026-10-14 - R23-11
rel:R23-11#cbc123ea2026-10-14 - R24-11
rel:R24-11#e09a76d52026-10-14 - R25-11
rel:R25-11#fcff65aa2026-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 · German original