Description

Encryption APIs for KMS

Hierarchy

  • unknown
    • default

Implements

Properties

namespace: "cypher" = CYPHER
registered: boolean = false

Constructors

  • Constructs an instance of the class.

    Remarks

    This constructor calls the superclass constructor with the provided arguments. It also assigns the webex property to the $webex property, ignoring TypeScript errors.

    Parameters

    • Rest ...args: any[]

      The arguments to pass to the superclass constructor.

    Returns default

Methods

  • Registers the device to WDM. This is required for metrics and other services.

    Returns

    Returns Promise<void>

  • Deregisters the device.

    Returns

    Returns Promise<void>

  • Downloads and decrypts a file from the given URI.

    Returns

    A promise that resolves to the decrypted ArrayBuffer.

    Throws

    If the file download or decryption fails.

    Example

    const attachmentURL = 'https:/myfileurl.xyz/zzz/fileid?keyUri=somekeyuri&JWE=somejwe';
    const options: FileDownloadOptions = {
    useFileService: false,
    jwe: somejwe, // Provide the JWE here if not already present in the attachmentURL
    keyUri: someKeyUri, // Provide the keyURI here if not already present in the attachmentURL
    };
    const decryptedBuf = await webex.cypher.downloadAndDecryptFile(attachmentURL, options);
    const file = new File([decryptedBuf], "myFileName.jpeg", {type: 'image/jpeg'});

    Parameters

    • fileUri: string

      The URI of the file to be decrypted.

    • options: FileDownloadOptions = {}

      The options for file download.

    Returns Promise<ArrayBuffer>