> ## 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.

# PFEntityGetSecretKey

> Obtiene la secretKey de PlayFab asociada a una entidad de título. Se producirá un error E_PF_NOSECRETKEY si no hay ninguna clave secreta asociada a la entidad proporcionada.

Obtiene la secretKey de PlayFab asociada a una entidad de título. Se producirá un error E\_PF\_NOSECRETKEY si no hay ninguna clave secreta asociada a la entidad proporcionada.

## Sintaxis

```cpp theme={null}
HRESULT PFEntityGetSecretKey(  
    PFEntityHandle handle,  
    size_t secretKeySize,  
    char* secretKey,  
    size_t* secretKeyUsed  
)  
```

### Parámetros

**`handle`**   PFEntityHandle

Identificador de entidad.

**`secretKeySize`**   size\_t

Tamaño del búfer proporcionado. El tamaño necesario puede obtenerse mediante PFServiceConfigGetSecretKeySize.

**`secretKey`**   char\*<br />*Out\_writes(secretKeySize)*

Búfer en el que se escribirá la secretKey.

**`secretKeyUsed`**   size\_t\*<br />*optional output*

El número de bytes usados en el búfer, incluido el terminador nulo.

### Valor devuelto

Tipo: HRESULT

Código de resultado de esta operación de API.

## Requisitos

**Encabezado:** PFEntity.h

## Consulte también

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


## Related topics

- [Identificadores de entidad](/es/services/playfab/sdks/c/entity-handles.md)
- [Información general de la API de C de Services - PFEntity.h](/es/services/playfab/api-references/c/pfentity/pfentity_members.md)
- [PFEntityGetSecretKeySize](/es/services/playfab/api-references/c/pfentity/functions/pfentitygetsecretkeysize.md)
- [PFAuthenticationGetEntityWithSecretKeyGetResult](/es/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationgetentitywithsecretkeygetresult.md)
- [PFAuthenticationGetEntityWithSecretKeyAsync](/es/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationgetentitywithsecretkeyasync.md)
