# Add and Manage Service Credentials source: https://developer.mastercard.com/mastercard-developers-api/documentation/tutorials-and-guides/manage-service-credentials/index.md ###### Time to complete: \*30 minutes\* ## Overview {#overview} Follow the steps in this tutorial to add and manage service credentials. 1. Log in to [Mastercard Developers](https://developer.mastercard.com/dashboard) and navigate to your **Account** page. 2. In your Account page, go to the Developers API Keys section and click **Add key**. 3. **Choose Key Creation Method:** * **Option 1: Browser Keystore** 1. Select **Generate key**. 2. Enter a **Key name** and **Key password**. 3. If prompted, review and accept the **Mastercard Developers API Terms \& Conditions** to proceed. 4. Click **Create key**. 5. Click **Download key** to download the [signing key](https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/#the-signing-key) as a PKCS#12 keystore. Download and save your key file in a secure location. Once you exit this screen, you won't be able to download it. 6. Get your [consumer key](https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/#the-consumer-key) from the Developers API Keys section of your Account page. * **Option 2: Certificate Signing Request (CSR)** 1. Select **Upload a CSR**. 2. Enter a **Key name** and click **Add an attachment** to upload your CSR file. 3. If prompted, review and accept the **Mastercard Developers API Terms \& Conditions** to proceed. 4. Click **Create Key**. 5. Get your [consumer key](https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/#the-consumer-key) from the Developers API Keys section of your Account page. **Key Limits and Status:** * After adding a key, its status will appear as **Pending**. You will receive an email notification once the key is approved, after which you can start sending requests to Developers API. * You can add a maximum of **2 keys**. * If a key request is declined, you must revoke the declined key before adding a new one. You now have everything you need to start sending the Developers API requests. *** ** * ** *** Start using the Developers API without the need to write any code. Run the Developers API Postman Collection to explore and test all the endpoints. > To get started using the Postman collection, you will need a [Postman account](https://identity.getpostman.com/signup?addAccount=1), and you can optionally download the [Postman desktop application](https://www.postman.com/downloads/). 1. Extract the signing key (private key) from your PKCS#12 keystore using the following command (use the passphrase protecting your PKCS#12 file): ```OpenSSL openssl pkcs12 -in 'mykey.p12' -nocerts -nodes -passin pass:{password} | openssl rsa -out mykey.pem ``` Expected result: ```java -----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAzSdC+wm6Dv4ynlhU5tuMLMsX7AeMWoysQKAaCDCStEWUHyj4 K84X+ZQH0kIJkpWS0M1+vWHTSAu0QvHNDPRIJKMNE2cCRVKApVZ8jQ9DhFkVYE0j AhggCNQTJ0kXDBvc1mZPOJDmXusvHIG3BbRSE6ohZHoUXAuAg4bbwZwmvgDgMrmN 9A9upgMrVZMfrCWeKiBUKoGnwGwUf0iMiHXJhD1Wjdtf0+VAsZNI7r05n9FTHmiC ... YlR8szTbz1WEx//hU5Ea2sfcKmPDTNWQnx0IgSmPu5I9qf7KJxSYhOk= -----END RSA PRIVATE KEY----- ``` 2. Click the following links to download the files: [mastercard_developers_api_postman.json](https://static.developer.mastercard.com/content/mastercard-developers-api/swagger/mastercard_developers_api_postman.json) (115KB) [mastercard_developers_api_postman_environment.json](https://static.developer.mastercard.com/content/mastercard-developers-api/swagger/mastercard_developers_api_postman_environment.json) (562B) 3. In Postman, click **Import** and import **mastercard_developers_postman.json** and **mastercard_developers_postman_environment.json**: ![Import Postman Collection](https://static.developer.mastercard.com/content/mastercard-developers-api/uploads/postman-import-button.png) 4. Click **Environments** (top-right corner drop-down), then select **Mastercard Developers** . Copy the Consumer Key from the Developers API keys section of your Account page and update the `consumerKey` variable. Use the private key extracted in step 1 and update the `privateKey` variable. ![Postman Environment](https://static.developer.mastercard.com/content/mastercard-developers-api/uploads/postman-environment-keys_3.png) 5. You can then test the other endpoints by clicking **Send** on individual requests, or **Run collection**. *** ** * ** *** 1. To know your `project_id` and `service_id`, you can first call the [GET /projects](https://developer.mastercard.com/mastercard-developers-api/documentation/api-reference/index.md) endpoint in your Postman collection. The response will contain the list of projects available on the [project dashboard](https://developer.mastercard.com/dashboard) of your Mastercard Developer's account including their `project_id` and `service_id`. Note: The project status returned in the [GET /projects](https://developer.mastercard.com/mastercard-developers-api/documentation/api-reference/index.md) call is currently invalid for both sandbox and production environments. Please disregard it. 2. To add a service credential to a project, select the [POST Add a service credential to a project](https://developer.mastercard.com/mastercard-developers-api/documentation/api-reference/index.md) endpoint in your Postman collection and provide the `project_id` and `service_id` in the request URL. Ensure the body of your request includes all the required fields and click **Send** . To learn about the different service credentials and their purposes, see [Service Credentials](https://developer.mastercard.com/mastercard-developers-api/documentation/use-cases/manage_project_credentials/index.md#service-credentials). API Reference: `POST /projects/{project_id}/services/{service_id}/credentials` Diagram addservicecred *** ** * ** *** To activate Mastercard Encryption Key or the Client Signature Verification key, select [PUT projects/{project_id}/services/{service_id}/credentials/{credential_id}/status](https://developer.mastercard.com/mastercard-developers-api/documentation/api-reference/index.md) in your Postman collection and provide the `project_id`, `service_id` and `credential_id` and click **Send**. API Reference: `PUT /projects/{project_id}/services/{service_id}/credentials/{credential_id}/status` Diagram updateservicecred *** ** * ** *** To retrieve credential information by the `credential_id`, select [GET projects/{project_id}/services/{service_id}/credentials/{credential_id}](https://developer.mastercard.com/mastercard-developers-api/documentation/api-reference/index.md) from your Postman collection and provide the `project_id`, `service_id` and `credential_id` and click **Send**. API Reference: `GET /projects/{project_id}/services/{service_id}/credentials/{credential_id}` Diagram getservicecreds *** ** * ** ***