This page covers configuration and management of View collection objects.

Object Overview

Encryption keys are the key material used to encrypt and decrypt data.

Endpoint, URL, and Supported Methods

Objects are managed via the Configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/encryptionkeys

Supported methods include: GET HEAD PUT DELETE

Structure

Objects have the following structure:

{
    "GUID": "c3c8b73d-859b-48a2-bfaf-511e83423585",
    "TenantGUID": "00000000-0000-0000-0000-000000000000",
    "OwnerGUID": "00000000-0000-0000-0000-000000000000",
    "KeyBase64": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    "KeyHex": "0000000000000000000000000000000000000000000000000000000000000000",
    "IvBase64": "AAAAAAAAAAAAAAAAAAAAAA==",
    "IvHex": "00000000000000000000000000000000",
    "SaltBase64": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    "SaltHex": "0000000000000000000000000000000000000000000000000000000000000000",
    "Name": "Another default key",
    "Description": "Another default key",
    "CreatedUtc": "2025-03-29T08:38:38.457116Z"
}

  • GUID GUID globally unique identifier for the object
  • TenantGUID GUID globally unique identifier for the tenant
  • OwnerGUID GUID globally unique identifier for the owner
  • Name string name of the object
  • KeyBase64 string key on base 64 string
  • KeyHex``string key in hex format
  • IvBase64 strgin Iv in base 64 string
  • IvHex stringIv in Hex format
  • SaltBase64 string Salt in base 64 string
  • SaltHex string Salt in Hex format
  • Description string description of the object
  • CreatedUtc datetime timestamp from creation, in UTC time

Create

To create, call PUT /v1.0/tenants/[tenant-guid]/encryptionkeys with the following properties using the Configuration server

curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/encryptionkeys' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "KeyBase64": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    "KeyHex": "0000000000000000000000000000000000000000000000000000000000000000",
    "IvBase64": "AAAAAAAAAAAAAAAAAAAAAA==",
    "IvHex": "00000000000000000000000000000000",
    "SaltBase64": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    "SaltHex": "0000000000000000000000000000000000000000000000000000000000000000",
    "Name": "Another default key",
    "Description": "Another default key"
}'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

const createEncryptionKeys = async () => {
  try {
    const response = await api.createEncryptionKey({
      KeyBase64: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
      KeyHex:
        "0000000000000000000000000000000000000000000000000000000000000000",
      IvBase64: "AAAAAAAAAAAAAAAAAAAAAA==",
      IvHex: "00000000000000000000000000000000",
      SaltBase64: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
      SaltHex:
        "0000000000000000000000000000000000000000000000000000000000000000",
      Name: "Another default key ash test",
      Description: "Another default key",
    });
    console.log(response, "Encryption keys created successfully");
  } catch (err) {
    console.log("Error creating Encryption keys:", err);
  }
};

createEncryptionKeys();

Enumerate

Enumerate objects by using GET /v2.0/tenants/[tenant-guid]/encryptionkeys

curl --location 'http://view.homedns.org:8000/v2.0/tenants/00000000-0000-0000-0000-000000000000/encryptionkeys/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);


const enumerateEncryptionKeys = async () => {
  try {
    const response = await api.enumerateEncryptionKeys();
    console.log(response, "Encryption keys fetched successfully");
  } catch (err) {
    console.log("Error fetching Encryption keys:", err);
  }
};

enumerateEncryptionKeys();

Read

To read an object by GUID, call GET /v1.0/tenants/[tenant-guid]/encryptionkeys/[encryptionkey-guid]. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound error response.

curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/encryptionkeys/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);
const readEncryptionKey = async () => {
  try {
    const response = await api.retrieveEncryptionKey(
      "00000000-0000-0000-0000-000000000000"
    );
    console.log(response, "Encryption key fetched successfully");
  } catch (err) {
    console.log("Error fetching Encryption key:", err);
  }
};

readEncryptionKey();

Read all

o read all objects, call GET /v1.0/tenants/[tenant-guid]/encryptionkeys/. If the object exists, it will be returned as an array of JSON object in the response body

curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/encryptionkeys/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

const readAllEncryptionKeys = async () => {
  try {
    const response = await api.retrieveEncryptionKeys();
    console.log(response, "All encryption keys fetched successfully");
  } catch (err) {
    console.log("Error fetching All encryption keys:", err);
  }
};

readAllEncryptionKeys();

Update

To update, call PUT /v1.0/tenants/[tenant-guid]/encryptionkeys/{encryptionkey-guid} with the object properties using the Configuration server

curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/encryptionkeys/00000000-0000-0000-0000-000000000000' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "KeyBase64": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    "KeyHex": "0000000000000000000000000000000000000000000000000000000000000000",
    "IvBase64": "AAAAAAAAAAAAAAAAAAAAAA==",
    "IvHex": "00000000000000000000000000000000",
    "SaltBase64": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    "SaltHex": "0000000000000000000000000000000000000000000000000000000000000000",
    "Name": "Default key, updated",
    "Description": "Default key"
}'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

const updateEncryptionKey = async () => {
  try {
    const response = await api.updateEncryptionKey({
      GUID: "d81a743f-1b02-42a6-a66b-df4c8e93a243",
      TenantGUID: "00000000-0000-0000-0000-000000000000",
      OwnerGUID: "00000000-0000-0000-0000-000000000000",
      KeyBase64: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
      KeyHex:
        "0000000000000000000000000000000000000000000000000000000000000000",
      IvBase64: "AAAAAAAAAAAAAAAAAAAAAA==",
      IvHex: "00000000000000000000000000000000",
      SaltBase64: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
      SaltHex:
        "0000000000000000000000000000000000000000000000000000000000000000",
      Name: "Another default key ash test [UPDATED]",
      Description: "Another default key",
      CreatedUtc: "2025-03-29T08:44:07.522780Z",
    });
    console.log(response, "Encryption key updated successfully");
  } catch (err) {
    console.log("Error updating Encryption key:", err);
  }
};

updateEncryptionKey();

Delete

To delete an object by GUID, call DELETE /v1.0/tenants/[tenant-guid]/encryptionkeys/[encryptionkey-guid].

curl --location --request DELETE 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/encryptionkeys/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);
const deleteEncryptionKey = async () => {
  try {
    const response = await api.deleteEncryptionKey(
      "d81a743f-1b02-42a6-a66b-df4c8e93a243"
    );
    console.log(response, "Encryption key deleted successfully");
  } catch (err) {
    console.log("Error deleting Encryption key:", err);
  }
};

deleteEncryptionKey();

Check Existence

Note: the HEAD method can be used as an alternative to get to simply check the existence of the object. HEAD requests return either a 200/OK in the event the object exists, or a 404/Not Found if not. No response body is returned with a HEAD request.

curl --location --head 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/encryptionkey/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

const encryptionKeyExists = async () => {
  try {
    const response = await api.existsEncryptionKey(
      "d81a743f-1b02-42a6-a66b-df4c8e93a243"
    );
    console.log(response, "Encryption key exists");
  } catch (err) {
    console.log("Error checking Encryption key:", err);
  }
};

encryptionKeyExists();