Funzione DrtRegisterKey (drt.h)

La funzione DrtRegisterKey registra una chiave in DRT.

Sintassi

HRESULT DrtRegisterKey(
  [in]           HDRT                      hDrt,
  [in]           DRT_REGISTRATION          *pRegistration,
  [in, optional] PVOID                     pvKeyContext,
  [out]          HDRT_REGISTRATION_CONTEXT *phKeyRegistration
);

Parametri

[in] hDrt

Puntatore a un handle restituito dalla funzione DrtOpen .

[in] pRegistration

Puntatore a un handle alla struttura DRT_REGISTRATION .

[in, optional] pvKeyContext

Puntatore ai dati di contesto associati alla chiave in DRT. Questi dati vengono passati alle funzioni specifiche della chiave del provider di sicurezza.

[out] phKeyRegistration

Puntatore a un handle per una chiave registrata.

Valore restituito

Questa funzione restituisce S_OK in caso di esito positivo. Altri valori possibili includono:

Codice restituito Descrizione
E_INVALIDARG
  • pRegistration è NULL
  • Il valore cb del membro appData della struttura di DRT_REGISTRATION è troppo grande (ovvero minore di 1).
  • Il valore cb del membro appData della struttura DRT_REGISTRATION è troppo grande (ad esempio più di 5120).
  • Il valore pb del membro chiave della struttura DRT_REGISTRATION è NULL.
  • phKeyRegistration è NULL
E_HANDLE
hDrt è un handle non valido o phKeyRegistration è un handle non valido
DRT_E_INVALID_KEY_SIZE
Le dimensioni del valore cb del membro chiave della struttura DRT_REGISTRATION non sono uguali a 256 bit o il valore pb del membro chiavedella struttura DRT_REGISTRATION è NULL.
DRT_E_FAULTED
Il cloud DRT si trova nello stato di errore.
DRT_E_DUPLICATE_KEY
La chiave è già registrata.
DRT_E_INVALID_CERT_CHAIN
La catena di certificazione fornita non è valida.
DRT_E_CAPABILITY_MISMATCH
Il provider di certificati fornito non è compatibile con AES.
DRT_E_INVALID_KEY
La chiave specificata non corrisponde alla chiave generata.
DRT_E_TRANSPORT_NO_DEST_ADDRESSES
Indirizzo valido non trovato.
DRT_E_TRANSPORT_SHUTTING_DOWN
Il trasporto viene arrestato.
DRT_E_INVALID_TRANSPORT_PROVIDER
Il provider di trasporto è NULL.
DRT_E_TRANSPORTPROVIDER_NOT_ATTACHED
Il trasporto non è collegato.
DRT_E_SECURITYPROVIDER_NOT_ATTACHED
Il provider di sicurezza non è collegato.
DRT_E_TRANSPORT_NOT_BOUND
Il trasporto non è attualmente associato.
E_OUTOFMEMORY
Il sistema non è in memoria.
E_UNEXPECTED
  • GlobalControl.HandleTable è NULL.
  • Il cloud sta chiudendo.
  • DRT sta arrestando.
E_FAIL
Si è verificato un errore irreversibile imprevisto.
 
 

Commenti

Un nodo può registrare le chiavi durante lo stato DRT_ACTIVE, DRT_ALONE o DRT_NO_NETWORK . Tuttavia, le chiavi registrate in DRT_ALONE e gli stati di DRT_NO_NETWORK possono essere riconosciuti solo da altre unità di ripristino di emergenza dopo che il nodo locale è passato a DRT_ACTIVE.

Per aggiornare una chiave esistente, un'applicazione deve prima annullare la registrazione della chiave con DrtUnregisterKey prima di chiamare DrtRegisterKey per registrare la chiave aggiornata.

Requisiti

   
Client minimo supportato Windows 7 Professional [solo app desktop]
Server minimo supportato Windows Server 2008 R2 [solo app desktop]
Piattaforma di destinazione Windows
Intestazione drt.h
Libreria Drt.lib
DLL Drt.dll

Vedi anche

DRT_REGISTRATION

DrtOpen

DrtUnregisterKey