función 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.
usar
El método puramente virtual CompareKey de la clase ara::diag::SecurityAccess [SWS_DM_00765] se implementa en la aplicación para validar la clave transmitida por el cliente en el servicio UDS 0x27 (SecurityAccess) SWS Diagnostics §7.3.2.8.9 «Service 0x27 – SecurityAccess». Junto con GetSeed, conforma la base para el mecanismo estático de semilla-clave según ISO 14229-1 [SWS_DM_00863].
Los parámetros de la función comprenden:
key: Unara::core::Span<const std::uint8_t>a los datos de clave que se van a comprobar. El búfer sigue siendo válido hasta que se cumpla la promesa asociada o se cancele el procesamiento a través delcancellationHandler[SWS_DM_00765].metaInfo: Metainformación de la petición de diagnóstico entrante [SWS_DM_00765].cancellationHandler: Permite consultar una cancelación mediantecancellationHandler.IsCanceled, así como registrar una función de notificación víacancellationHandler.SetNotifieren caso de cancelación de la conversación [SWS_DM_00765].
El resultado de la comprobación se proporciona de forma asíncrona a través de ara::core::Future<KeyCompareResultType> [SWS_DM_00765].
Tratamiento de errores e interacción
Si la comparación de claves falla o se produce un error durante el procesamiento, debe pasarse a través del future un Negative Response Code (NRC) adecuado según ISO 14229-1 mediante DiagUdsNrcErrc [SWS_DM_00765]. Si la subfunción solicitada no está configurada para CompareKey, la petición se responde con NRC 0x12 (kSubFunctionNotSupported) [SWS_DM_00363]. El Diagnostic Server cuenta los intentos fallidos [SWS_DM_00270] y los compara con valores de umbral [SWS_DM_00271].
Si el acceso de seguridad se habilita con éxito, el servidor actualiza internamente el nivel de seguridad [SWS_DM_00846], restablece el contador de intentos fallidos [SWS_DM_00270] y notifica el evento de seguridad SEV_UDS_SECURITY_ACCESS_SUCCESSFUL al IdsM [SWS_DM_02019].
Concurrencia y restricciones
La interfaz está declarada como noexcept y es segura ante excepciones (exception safe) [SWS_DM_00765]. La seguridad frente a hilos es condicional (conditional): Si la implementación debe ser segura frente a hilos se determina mediante el ConcurrencyType pasado en el constructor de SecurityAccess [SWS_DM_00765].
Esta nota de uso fue generada por una IA sobre la base de la especificación de AUTOSAR.
Guía del implementador pendiente (complejidad 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#84aeba15- Content hash
84aeba15- 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 · Original en alemán