Downloading and decrypting a file from Clearance

Genetec Clearance™ Developer Guide

Content type
Guides > Developer guides
Product line
Clearance
ft:locale
en-US
Applies to
Clearance

To download an evidence entity from Genetec Clearance™, you must use the Document Service API as your entry point. An evidence entity is composed of one or many resources that represent different segments or tracks of a media archive that can be downloaded individually. Each resource must be downloaded separately and stored locally to recreate the full context of the evidence.

Files are represented as resources in the API, and the resources are grouped under one evidence item.

When a video is uploaded inside Genetec Clearance™, the video is converted into a playable MP4 video file that is assigned to the evidence. The original and the converted file are both resources attached to the evidence.


image

Consult Operations on Block Blobs - Put Block for more information.


image

To download a file from an evidence:

  1. List all resources from an evidence and select the resource you want to download.

    You can list all resources for an evidence using List resources.

  2. Using the resource ID and concurrency ID, obtain the resource information, encrypted key, and Blob URI from the GetProtected resource endpoint in the Document Service API.

    Ensure that the desired action on the request is set to DownloadWithEncryptedKey.

  3. Use the obtained EncryptedKey to reach the KeyStore Service API and Unwrap it so it can be used to decrypt the file from the obtained URI.

    KeyStore UnwrapKey

  4. Download the file using the URI obtained in step 2 from the resource and store it locally for proper use.

  5. Decrypt the downloaded file using the unwraped key from step 3.

  6. Repeat steps 2 to 5 for every resource you want to download from that evidence entity.