Foxit PDF SDK

Public Member Functions | List of all members
com.foxit.sdk.pdf.StdEncryptData Class Reference

## Public Member Functions
| StdEncryptData (boolean is_encrypt_metadata, int user_permissions, int cipher, int key_length)
| Constructor, with parameters. More...
| StdEncryptData ()
| Constructor.
| StdEncryptData (StdEncryptData other)
| Constructor, with another standard encrypt data object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
int | getCipher ()
| Get cipher type. More...
boolean | getIs_encrypt_metadata ()
| Get a boolean value to decide whether to encrypt metadata or not. More...
int | getKey_length ()
| Get the key length, in bytes. More...
int | getUser_permissions ()
| Get the user permissions. More...
void | set (boolean is_encrypt_metadata, int user_permissions, int cipher, int key_length)
| Set value. More...
void | setCipher (int value)
| Set cipher type. More...
void | setIs_encrypt_metadata (boolean value)
| Set a boolean value to decide whether to encrypt metadata or not. More...
void | setKey_length (int value)
| Set the key length, in bytes. More...
void | setUser_permissions (int value)
| Set the user permissions. More...

## Detailed Description

This class represents some data used for class StdSecurityHandler .

## Constructor & Destructor Documentation

## ◆ StdEncryptData() [1/2]

com.foxit.sdk.pdf.StdEncryptData.StdEncryptData | ( | boolean | is_encrypt_metadata,
|  | int | user_permissions,
|  | int | cipher,
|  | int | key_length
| ) |  |

Constructor, with parameters.

Parameters

  [in] | is_encrypt_metadata | true means to encrypt metadata, and false means not to encrypt metadata.
  [in] | user_permissions | The user permissions. Please refer to values starting from com.foxit.sdk.pdf.PDFDoc.e_PermPrint and this should be one or combination of these values.
  [in] | cipher | Cipher type. Please refer to values starting from com.foxit.sdk.pdf.SecurityHandler.e_CipherRC4 and this should be one of these values except com.foxit.sdk.pdf.SecurityHandler.e_CipherNone .
  [in] | key_length | The key length, in bytes. For com.foxit.sdk.pdf.SecurityHandler.e_CipherRC4 cipher, this value should be between 5 and 16. The preferred one should be 16. For com.foxit.sdk.pdf.SecurityHandler.e_CipherAES cipher, this value should be 16 (as AES-128) or 32 (as AES-256, only supported in PDF 2.0).

## ◆ StdEncryptData() [2/2]

com.foxit.sdk.pdf.StdEncryptData.StdEncryptData | ( | StdEncryptData | other | ) |

Constructor, with another standard encrypt data object.

Parameters

  [in] | other | Another standard encrypt data object.

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.pdf.StdEncryptData.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ getCipher()

com.foxit.sdk.pdf.StdEncryptData.getCipher | ( |  | ) |

Get cipher type.

Returns
  Cipher type. Please refer to values starting from com.foxit.sdk.pdf.SecurityHandler.e_CipherRC4 and this should be one of these values except com.foxit.sdk.pdf.SecurityHandler.e_CipherNone .

## ◆ getIs_encrypt_metadata()

com.foxit.sdk.pdf.StdEncryptData.getIs_encrypt_metadata | ( |  | ) |

Get a boolean value to decide whether to encrypt metadata or not.

Returns
  A boolean value to decide whether to encrypt metadata or not. true means to encrypt metadata, and false means not to encrypt metadata.

## ◆ getKey_length()

com.foxit.sdk.pdf.StdEncryptData.getKey_length | ( |  | ) |

Get the key length, in bytes.

- For com.foxit.sdk.pdf.SecurityHandler.e_CipherRC4 cipher, this value should be between 5 and 16. The preferred one should be 16.

- For com.foxit.sdk.pdf.SecurityHandler.e_CipherAES cipher, this value should be 16 (as AES-128) or 32 (as AES-256, only supported in PDF 2.0).

Returns
  The key length, in bytes.

## ◆ getUser_permissions()

com.foxit.sdk.pdf.StdEncryptData.getUser_permissions | ( |  | ) |

Get the user permissions.

Returns
  The user permissions. Please refer to values starting from com.foxit.sdk.pdf.PDFDoc.e_PermPrint and this should be one or combination of these values.

## ◆ set()

void com.foxit.sdk.pdf.StdEncryptData.set | ( | boolean | is_encrypt_metadata,
|  | int | user_permissions,
|  | int | cipher,
|  | int | key_length
| ) |  |

Set value.

Parameters

  [in] | is_encrypt_metadata | true means to encrypt metadata, and false means not to encrypt metadata.
  [in] | user_permissions | The user permissions. Please refer to values starting from com.foxit.sdk.pdf.PDFDoc.e_PermPrint and this should be one or combination of these values.
  [in] | cipher | Cipher type. Please refer to values starting from com.foxit.sdk.pdf.SecurityHandler.e_CipherRC4 and this should be one of these values except com.foxit.sdk.pdf.SecurityHandler.e_CipherNone .
  [in] | key_length | The key length, in bytes. For com.foxit.sdk.pdf.SecurityHandler.e_CipherRC4 cipher, this value should be between 5 and 16. The preferred one should be 16. For com.foxit.sdk.pdf.SecurityHandler.e_CipherAES cipher, this value should be 16 (as AES-128) or 32 (as AES-256, only supported in PDF 2.0).

Returns
  None.

## ◆ setCipher()

com.foxit.sdk.pdf.StdEncryptData.setCipher | ( | int | value | ) |

Set cipher type.

Parameters

  [in] | value | Cipher type. Please refer to values starting from com.foxit.sdk.pdf.SecurityHandler.e_CipherRC4 and this should be one of these values except com.foxit.sdk.pdf.SecurityHandler.e_CipherNone .

Returns
  None.

## ◆ setIs_encrypt_metadata()

com.foxit.sdk.pdf.StdEncryptData.setIs_encrypt_metadata | ( | boolean | value | ) |

Set a boolean value to decide whether to encrypt metadata or not.

Parameters

  [in] | value | A boolean value to decide whether to encrypt metadata or not. true means to encrypt metadata, and false means not to encrypt metadata.

Returns
  None.

## ◆ setKey_length()

com.foxit.sdk.pdf.StdEncryptData.setKey_length | ( | int | value | ) |

Set the key length, in bytes.

- For com.foxit.sdk.pdf.SecurityHandler.e_CipherRC4 cipher, this value should be between 5 and 16. The preferred one should be 16.

- For com.foxit.sdk.pdf.SecurityHandler.e_CipherAES cipher, this value should be 16 (as AES-128) or 32 (as AES-256, only supported in PDF 2.0).

Parameters

  [in] | value | The key length, in bytes.

Returns
  None.

## ◆ setUser_permissions()

com.foxit.sdk.pdf.StdEncryptData.setUser_permissions | ( | int | value | ) |

Set the user permissions.

Parameters

  [in] | value | The user permissions. Please refer to values starting from com.foxit.sdk.pdf.PDFDoc.e_PermPrint and this should be one or combination of these values.

Returns
  None.