Aspose::Pdf::Facades::PdfFileSecurity::TryChangePassword method

PdfFileSecurity::TryChangePassword(System::String, System::String, System::String) method

Changes the user password and owner password by owner password, keeps the original security settings. The new user password and the new owner password can be null or empty. The owner password will be replaced Does not throw an exception if process failed. with a random string if the new owner password is null or empty.

bool Aspose::Pdf::Facades::PdfFileSecurity::TryChangePassword(System::String ownerPassword, System::String newUserPassword, System::String newOwnerPassword)
ParameterTypeDescription
ownerPasswordSystem::StringOriginal Owner password.
newUserPasswordSystem::StringNew User password.
newOwnerPasswordSystem::StringNew Owner password.

ReturnValue

True for success,or false.

See Also

PdfFileSecurity::TryChangePassword(System::String, System::String, System::String, System::SharedPtr<DocumentPrivilege>, KeySize) method

Changes the user password and password by owner password, allows to reset Pdf documnent security. The new user password and the new owner password can be null or empty. The owner password will be replaced with a random string if the new owner password is null or empty. Does not throw an exception if process failed.

bool Aspose::Pdf::Facades::PdfFileSecurity::TryChangePassword(System::String ownerPassword, System::String newUserPassword, System::String newOwnerPassword, System::SharedPtr<DocumentPrivilege> privilege, KeySize keySize)
ParameterTypeDescription
ownerPasswordSystem::StringOriginal owner password.
newUserPasswordSystem::StringNew User password.
newOwnerPasswordSystem::StringNew Owner password.
privilegeSystem::SharedPtr<DocumentPrivilege>Reset security.
keySizeKeySizeKeySize.x40 for 40 bits encryption, KeySize.x128 for 128 bits encryption and KeySize.x256 for 256 bits encryption.

ReturnValue

True for success, or false.

See Also

PdfFileSecurity::TryChangePassword(System::String, System::String, System::String, System::SharedPtr<DocumentPrivilege>, KeySize, Algorithm) method

Changes the user password and password by owner password, allows to reset Pdf documnent security. The new user password and the new owner password can be null or empty. The owner password will be replaced with a random string if the new owner password is null or empty. There are 6 possible combinations of KeySize and Algorithm values. However (KeySize.x40, Algorithm.AES) and (KeySize.x256, Algorithm.RC4) are invalid and corresponding exception will be raised if kit encounters this combination. Does not throw an exception if process failed.

bool Aspose::Pdf::Facades::PdfFileSecurity::TryChangePassword(System::String ownerPassword, System::String newUserPassword, System::String newOwnerPassword, System::SharedPtr<DocumentPrivilege> privilege, KeySize keySize, Algorithm cipher)
ParameterTypeDescription
ownerPasswordSystem::StringOriginal owner password.
newUserPasswordSystem::StringNew User password.
newOwnerPasswordSystem::StringNew Owner password.
privilegeSystem::SharedPtr<DocumentPrivilege>Reset security.
keySizeKeySizeKeySize.x40 for 40 bits encryption, KeySize.x128 for 128 bits encryption and KeySize.x256 for 256 bits encryption.
cipherAlgorithmAlgorithm.AES to encrypt using AES algorithm or Algorithm.RC4 for RC4 encryption.

ReturnValue

True for success, or false.

See Also