DrtRegisterKey function (drt.h)
The DrtRegisterKey function registers a key in the DRT.
Syntax
HRESULT DrtRegisterKey(
[in] HDRT hDrt,
[in] DRT_REGISTRATION *pRegistration,
[in, optional] PVOID pvKeyContext,
[out] HDRT_REGISTRATION_CONTEXT *phKeyRegistration
);
Parameters
[in] hDrt
A pointer to a handle returned by the DrtOpen function.
[in] pRegistration
A pointer to a handle to the DRT_REGISTRATION structure.
[in, optional] pvKeyContext
Pointer to the context data associated with the key in the DRT. This data is passed to the key-specific functions of the security provider.
[out] phKeyRegistration
Pointer to a handle for a key that has been registered.
Return value
This function returns S_OK on success. Other possible values include:
Return code | Description |
---|---|
|
|
|
hDrt is an invalid handle or phKeyRegistration is an invalid handle |
|
The size of cb value of the key member of the DRT_REGISTRATION structure is not equal to 256 bits or the pb value of the key member of the DRT_REGISTRATION structure is NULL.. |
|
The DRT cloud is in the faulted state. |
|
The key is already registered. |
|
The provided certification chain is invalid. |
|
Supplied certificate provider is not AES capable. |
|
Supplied key does not match generated key. |
|
Valid address not found. |
|
Transport is shutting down. |
|
Transport provider is NULL. |
|
Transport is not attached. |
|
Security provider is not attached. |
|
Transport is not currently bound. |
|
The system is out of memory. |
|
|
|
An unexpected fatal error has occurred. |
Remarks
A node can register keys while in the DRT_ACTIVE, DRT_ALONE, or DRT_NO_NETWORK state. However, keys registered in DRT_ALONE and DRT_NO_NETWORK states can only be recognized by other DRTs after the local node has transitioned to DRT_ACTIVE.
To update an existing key, an application must first deregister the key with DrtUnregisterKey before calling DrtRegisterKey to register the updated key.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 Professional [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | drt.h |
Library | Drt.lib |
DLL | Drt.dll |