Aspose::Pdf::Document::Encrypt method

Document::Encrypt(Aspose::Pdf::Permissions, Aspose::Pdf::CryptoAlgorithm, System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<System::Security::Cryptography::X509Certificates::X509Certificate2>>>) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(Aspose::Pdf::Permissions permissions, Aspose::Pdf::CryptoAlgorithm cryptoAlgorithm, System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<System::Security::Cryptography::X509Certificates::X509Certificate2>>> publicCertificates)
ParameterTypeDescription
permissionsAspose::Pdf::PermissionsDocument permissions, see Permissions for details.
cryptoAlgorithmAspose::Pdf::CryptoAlgorithmCryptographic algorithm, see CryptoAlgorithm for details.
publicCertificatesSystem::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<System::Security::Cryptography::X509Certificates::X509Certificate2>>>The public certificates used for encryption — one per recipient.

Remarks

This method prepares for encryption. To encrypt a document, you need to call the Save method to save it.

See Also

Document::Encrypt(System::String, System::String, Aspose::Pdf::Permissions, Aspose::Pdf::CryptoAlgorithm) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(System::String userPassword, System::String ownerPassword, Aspose::Pdf::Permissions permissions, Aspose::Pdf::CryptoAlgorithm cryptoAlgorithm)
ParameterTypeDescription
userPasswordSystem::StringUser password.
ownerPasswordSystem::StringOwner password.
permissionsAspose::Pdf::PermissionsDocument permissions, see Permissions for details.
cryptoAlgorithmAspose::Pdf::CryptoAlgorithmCryptographic algorithm, see CryptoAlgorithm for details.

Remarks

This method prepares for encryption. To encrypt a document, you need to call the Save method to save it.

See Also

Document::Encrypt(System::String, System::String, Aspose::Pdf::Permissions, Aspose::Pdf::CryptoAlgorithm, bool) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(System::String userPassword, System::String ownerPassword, Aspose::Pdf::Permissions permissions, Aspose::Pdf::CryptoAlgorithm cryptoAlgorithm, bool usePdf20)
ParameterTypeDescription
userPasswordSystem::StringUser password.
ownerPasswordSystem::StringOwner password.
permissionsAspose::Pdf::PermissionsDocument permissions, see Permissions for details.
cryptoAlgorithmAspose::Pdf::CryptoAlgorithmCryptographic algorithm, see CryptoAlgorithm for details.
usePdf20boolSupport for revision 6 (Extension 8).

Remarks

This method prepares for encryption. To encrypt a document, you need to call the Save method to save it.

See Also

Document::Encrypt(System::String, System::String, Aspose::Pdf::Permissions, System::SharedPtr<Security::ICustomSecurityHandler>) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(System::String userPassword, System::String ownerPassword, Aspose::Pdf::Permissions permissions, System::SharedPtr<Security::ICustomSecurityHandler> customHandler)
ParameterTypeDescription
userPasswordSystem::StringUser password.
ownerPasswordSystem::StringOwner password.
permissionsAspose::Pdf::PermissionsDocument permissions, see Permissions for details.
customHandlerSystem::SharedPtr<Security::ICustomSecurityHandler>The custom security handler.

Remarks

This method prepares for encryption. To encrypt a document, you need to call the Save method to save it.

See Also

Document::Encrypt(System::String, System::String, System::SharedPtr<Facades::DocumentPrivilege>, Aspose::Pdf::CryptoAlgorithm, bool) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(System::String userPassword, System::String ownerPassword, System::SharedPtr<Facades::DocumentPrivilege> privileges, Aspose::Pdf::CryptoAlgorithm cryptoAlgorithm, bool usePdf20)
ParameterTypeDescription
userPasswordSystem::StringUser password.
ownerPasswordSystem::StringOwner password.
privilegesSystem::SharedPtr<Facades::DocumentPrivilege>Document permissions, see Permissions for details.
cryptoAlgorithmAspose::Pdf::CryptoAlgorithmCryptographic algorithm, see CryptoAlgorithm for details.
usePdf20boolSupport for revision 6 (Extension 8).

Remarks

This method prepares for encryption. To encrypt a document, you need to call the Save method to save it.

See Also

Document::Encrypt(System::String, System::String, System::SharedPtr<Facades::DocumentPrivilege>, System::SharedPtr<Security::ICustomSecurityHandler>) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(System::String userPassword, System::String ownerPassword, System::SharedPtr<Facades::DocumentPrivilege> privileges, System::SharedPtr<Security::ICustomSecurityHandler> customHandler)
ParameterTypeDescription
userPasswordSystem::StringUser password.
ownerPasswordSystem::StringOwner password.
privilegesSystem::SharedPtr<Facades::DocumentPrivilege>Document permissions, see Permissions for details.
customHandlerSystem::SharedPtr<Security::ICustomSecurityHandler>The custom security handler.

Remarks

This method prepares for encryption. To encrypt a document, you need to call the Save method to save it.

See Also