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

# Get Title Public Key

> Returns the title's base 64 encoded RSA CSP blob.

## Error codes

This operation may return the following PlayFab errors:

| Error | Code |
| --- | --- |
| EncryptionKeyBroken | 1291 |
| InvalidSharedSecretKey | 1296 |
| NoSharedSecretKeyConfigured | 1292 |




## OpenAPI

````yaml /services/playfab/api-references/rest/client/client.openapi.json post /Client/GetTitlePublicKey
openapi: 3.0.0
info:
  version: '260922'
  title: PlayFab Client API
  description: >-
    APIs which provide the full range of PlayFab features available to the
    client - authentication, account and data management, inventory, friends,
    matchmaking, reporting, and platform-specific functionality
  termsOfService: https://playfab.com/terms/
  contact:
    url: https://community.playfab.com/index.html
  license:
    name: Apache 2.0
    url: https://github.com/PlayFab/API_Specs/blob/master/LICENSE
servers:
  - url: https://{titleId}.playfabapi.com
    description: PlayFab title endpoint
    variables:
      titleId:
        default: your_title_id
        description: Your PlayFab title ID (hex).
security: []
tags:
  - name: Account Management
    description: Account Management APIs
  - name: Advertising
    description: Advertising APIs
  - name: Analytics
    description: Analytics APIs
  - name: Authentication
    description: Authentication APIs
  - name: Character Data
    description: Character Data APIs
  - name: Characters
    description: Characters APIs
  - name: Content
    description: Content Service APIs
  - name: Friend List Management
    description: Friend List Management APIs
  - name: Matchmaking
    description: Matchmaking APIs
  - name: Platform Specific Methods
    description: Platform Specific Methods APIs
  - name: Player Data Management
    description: Player Data Management APIs
  - name: Player Item Management
    description: Player Item Management APIs
  - name: PlayStream
    description: PlayStream Management APIs
  - name: Server-Side Cloud Script
    description: Server-Side Cloud Script APIs
  - name: Shared Group Data
    description: Shared Group Data APIs
  - name: Title-Wide Data Management
    description: Title-Wide Data Management APIs
  - name: Trading
    description: Trading Management APIs
paths:
  /Client/GetTitlePublicKey:
    post:
      tags:
        - Authentication
      summary: Get Title Public Key
      description: |
        Returns the title's base 64 encoded RSA CSP blob.

        ## Error codes

        This operation may return the following PlayFab errors:

        | Error | Code |
        | --- | --- |
        | EncryptionKeyBroken | 1291 |
        | InvalidSharedSecretKey | 1296 |
        | NoSharedSecretKeyConfigured | 1292 |
      operationId: GetTitlePublicKey
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetTitlePublicKeyRequest'
        description: >-
          An RSA CSP blob to be used to encrypt the payload of account creation
          requests when that API requires a signature header. For example if
          Client/LoginWithCustomId requires signature headers but the player
          does not have an account yet follow these steps: 1) Call
          Client/GetTitlePublicKey with one of the title's shared secrets. 2)
          Convert the Base64 encoded CSP blob to a byte array and create an RSA
          signing object. 3) Encrypt the UTF8 encoded JSON body of the
          registration request and place the Base64 encoded result into the
          EncryptedRequest and with the TitleId field, all other fields can be
          left empty when performing the API request. 4) Client receives
          authentication token as normal. Future requests to LoginWithCustomId
          will require the X-PlayFab-Signature header.
      responses:
        '200':
          $ref: '#/components/responses/GetTitlePublicKeyResult'
        '400':
          $ref: '#/components/responses/ApiErrorWrapper'
      security: []
components:
  schemas:
    GetTitlePublicKeyRequest:
      description: >-
        An RSA CSP blob to be used to encrypt the payload of account creation
        requests when that API requires a signature header. For example if
        Client/LoginWithCustomId requires signature headers but the player does
        not have an account yet follow these steps: 1) Call
        Client/GetTitlePublicKey with one of the title's shared secrets. 2)
        Convert the Base64 encoded CSP blob to a byte array and create an RSA
        signing object. 3) Encrypt the UTF8 encoded JSON body of the
        registration request and place the Base64 encoded result into the
        EncryptedRequest and with the TitleId field, all other fields can be
        left empty when performing the API request. 4) Client receives
        authentication token as normal. Future requests to LoginWithCustomId
        will require the X-PlayFab-Signature header.
      type: object
      properties:
        TitleId:
          description: >-
            Unique identifier for the title, found in the Settings > Game
            Properties section of the PlayFab developer site when a title has
            been selected.
          type: string
        TitleSharedSecret:
          description: The shared secret key for this title
          type: string
      required:
        - TitleId
        - TitleSharedSecret
      example:
        TitleId: ID
        TitleSharedSecret: ExampleSecret
    GetTitlePublicKeyResult:
      type: object
      properties:
        RSAPublicKey:
          description: >-
            Base64 encoded RSA CSP byte array blob containing the title's public
            RSA key
          type: string
      example:
        RSAPublicKey: dGVzdCBrZXkgaGVyZQ==
    ApiErrorWrapper:
      description: The basic wrapper around every failed API response
      type: object
      properties:
        code:
          description: Numerical HTTP code
          type: integer
        status:
          description: String HTTP code
          type: string
        error:
          description: Playfab error code
          type: string
        errorCode:
          description: Numerical PlayFab error code
          type: integer
        errorMessage:
          description: Description for the PlayFab errorCode
          type: string
        errorDetails:
          description: Detailed description of individual issues with the request object
          type: object
      required:
        - code
        - errorCode
  responses:
    GetTitlePublicKeyResult:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                description: >-
                  The Http status code. If X-ReportErrorAsSuccess header is set
                  to true, this will report the actual http error code.
              status:
                type: string
                description: The Http status code as a string.
              data:
                $ref: '#/components/schemas/GetTitlePublicKeyResult'
            example:
              code: 200
              status: OK
              data:
                RSAPublicKey: dGVzdCBrZXkgaGVyZQ==
    ApiErrorWrapper:
      description: This is the outer wrapper for all responses with errors
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorWrapper'

````

## Related topics

- [Get Title Public Key](/services/playfab/api-references/rest/client/authentication/get-title-public-key.md)
- [Player Encryption Services](/services/playfab/identity/player-identity/encryption/player-encryption-services.md)
- [Get Player Shared Secrets](/services/playfab/api-references/rest/admin/authentication/get-player-shared-secrets.md)
- [Create Player Shared Secret](/services/playfab/api-references/rest/admin/authentication/create-player-shared-secret.md)
- [Get User Data](/services/playfab/api-references/rest/client/player-data-management/get-user-data.md)
