> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFEntityGetSecretKeySize

> Gets the size of the buffer needed to hold the PlayFab secretKey. Will fail with E_PF_NOSECRETKEY if there is no Secret Key associated with the provided Entity.

Gets the size of the buffer needed to hold the PlayFab secretKey. Will fail with E\_PF\_NOSECRETKEY if there is no Secret Key associated with the provided Entity.

## Syntax

```cpp theme={null}
HRESULT PFEntityGetSecretKeySize(  
    PFEntityHandle handle,  
    size_t* secretKeySize  
)  
```

### Parameters

**`handle`**   PFEntityHandle

Entity handle.

**`secretKeySize`**   size\_t\*<br />*output*

Buffer size required for the secretKey (including null terminator).

### Return value

Type: HRESULT

Result code for this API operation.

## Requirements

**Header:** PFEntity.h

## See also

[PFEntity members](/services/playfab/api-references/c/pfentity/pfentity_members)


## Related topics

- [Entity Handles](/services/playfab/sdks/c/entity-handles.md)
- [Services C API overview - PFEntity.h](/services/playfab/api-references/c/pfentity/pfentity_members.md)
- [PFEntityGetSecretKey](/services/playfab/api-references/c/pfentity/functions/pfentitygetsecretkey.md)
- [PFAuthenticationGetEntityWithSecretKeyGetResult](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationgetentitywithsecretkeygetresult.md)
- [PFAuthenticationGetEntityWithSecretKeyAsync](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationgetentitywithsecretkeyasync.md)
