OnEncryption

function OnEncryption(
  obj: object,
  obj.type: string,
  obj.password: string,
  obj.data: string,
  obj.check: boolean,
  obj.docinfo: string,
  obj.hash: string,
  obj.error: string,
): void

Description

Encrypts the document.

Parameters

objobject

The encryption properties.

obj.typestring

The type of encrypting operation: generatePassword - generates a password for the document, getPasswordByFile - sends the password when opening the document, encryptData - encrypts changes when co-editing, decryptData - decrypts changes when co-editing.

obj.passwordstring

A string value specifying the password to access the document.

obj.datastring

Encrypted/decrypted changes.

obj.checkboolean

Checks if the encryption/decryption operation is successful or not (used only for encryptData or decryptData types).

obj.docinfostring

An unencrypted part of the encrypted file.

obj.hashstring

A string value specifying a file hash (sha256 by default).

obj.errorstring

A string value specifying an error that occurs (the "" value means that the operation is successful).

Returns

void

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).