1. Retrieve public key

Verifik Biometric Wallet API Documentation

Endpoint: Get Public Key

GET /api/sessions/yek-cilbup

This endpoint retrieves the public key associated with a specified identifier.

Request

  • Endpoint: /api/sessions/yek-cilbup

  • Method: GET

  • Content-Type: application/json

  • Query Parameters:

    • identifier: string (Required) - The unique identifier associated with the session or entity for which the public key is being requested.

Example Request

GET /api/sessions/yek-cilbup?identifier=your_unique_device_identifier

Response

  • 200 OK: The request was successful, and the public key is returned in the response body.

    • Response Body:

      {
        "data": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n<base64-encoded public key>\n-----END PGP PUBLIC KEY BLOCK-----"
      }
  • Headers: The request does not require any specific headers, but it may include standard headers like Authorization if the API is secured.

Node.js (Axios) Example Code

const axios = require('axios');

let config = {
  method: 'get',
  url: 'http://localhost:3002/api/sessions/yek-cilbup?identifier=AGED',
  headers: { }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

Response Details

  • data: string - Contains the public key in PGP format, which can be used for encrypting data or verifying signatures associated with the identifier.

Example Response

{
  "data": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n<base64-encoded public key>\n-----END PGP PUBLIC KEY BLOCK-----"
}

Use Cases

  • Data Encryption: The retrieved public key can be used to encrypt data that can only be decrypted by the corresponding private key holder.

  • Signature Verification: The public key can be used to verify signatures made by the corresponding private key, ensuring the authenticity and integrity of the data.

Error Handling

  • 400 Bad Request: Returned if the identifier parameter is missing or invalid.

  • 404 Not Found: Returned if no public key is found for the given identifier.

  • 500 Internal Server Error: Returned if there is an issue on the server side processing the request.


This documentation provides a clear and structured explanation of how to use the GET /api/sessions/yek-cilbup endpoint to retrieve a public key, including an example using Node.js and Axios for making the request. If you need more details or further examples, feel free to ask us at miguel@verifik.co!

Last updated