<div class="content" name="LsarRetrievePrivateData" uuid="b46f3725-d3de-46b7-8245-a14edeb278a1"><p>The LsarRetrievePrivateData method is invoked to retrieve a
secret value.</p><dl>
<dd>
<div><pre> NTSTATUS LsarRetrievePrivateData(
   [in] LSAPR_HANDLE PolicyHandle,
   [in] PRPC_UNICODE_STRING KeyName,
   [in, out] PLSAPR_CR_CIPHER_VALUE* EncryptedData
 );
</pre></div>
</dd></dl><p><b>PolicyHandle: </b>An <span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> context handle
obtained from either <span><a href="2a482ccf-1f89-4693-8594-855ff738ae8a" data-linktype="relative-path">LsarOpenPolicy</a></span> or <span><a href="9456a963-7c21-4710-af77-d0a2f5a72d6b" data-linktype="relative-path">LsarOpenPolicy2</a></span>.</p><p><b>KeyName: </b>The name identifying the secret value
to be retrieved.</p><p><b>EncryptedData: </b>Receives the encrypted value of
the <span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_9720ddb8-c802-40b7-8dba-5e7520c3396d" data-linktype="relative-path">secret
object</a></span>.</p><p><b>Return Values: </b>The following is a summary of
the return values that an implementation MUST return, as specified by the
message processing that follows.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 STATUS_SUCCESS</td>
  <td>The request was successfully completed.</td>
 </tr><tr>
  <td>0xC0000022 STATUS_ACCESS_DENIED</td>
  <td>The caller does not have the permissions to perform this operation.</td>
 </tr><tr>
  <td>0xC000000D STATUS_INVALID_PARAMETER</td>
  <td>One of the supplied parameters was invalid.</td>
 </tr><tr>
  <td>0xC0000008 STATUS_INVALID_HANDLE</td>
  <td>PolicyHandle is not a valid handle.</td>
 </tr><tr>
  <td>0xC0000034 STATUS_OBJECT_NAME_NOT_FOUND</td>
  <td>The key with the specified name was not found.</td>
 </tr></tbody></table>
</dd></dl><p>Processing:</p><p>This message takes three arguments:</p><p><i>PolicyHandle</i>: An open handle to the policy object. If
the handle is not a valid context handle to the policy object or <i>PolicyHandle</i>.HandleType
does not equal &#34;Policy&#34;, the server MUST return
STATUS_INVALID_HANDLE. The server MUST verify that <i>PolicyHandle</i> grants
access as specified in section <span><a href="d1c2802a-70d5-4f81-843c-6523ab0c5e03" data-linktype="relative-path">3.1.4.2.2</a></span> with RequiredAccess
set to SECRET_QUERY_VALUE.</p><p><i>KeyName</i>: A string identifying the name of the secret
object to be queried. If IsRequestorAnonymous() returns TRUE (section <span><a href="5d50b55f-e9c7-4af6-bf85-02e8043f66ea" data-linktype="relative-path">3.1.4.2.3</a></span>)
and LsaRestrictAnonymous is set to TRUE, the call MUST fail with
STATUS_OBJECT_NAME_NOT_FOUND. If a secret object by this name does not exist,
the server MUST return STATUS_OBJECT_NAME_NOT_FOUND.</p><p><i>EncryptedData</i>: Used to return an encrypted version of
the secret value. This value is encrypted as specified in section <span><a href="cce8ae78-0138-4129-954e-c65e0c0bffed" data-linktype="relative-path">5.1.2</a></span>.</p></div>