Aspose::Pdf::Document::Encrypt method

Document::Encrypt(Aspose::Pdf::Permissions, Aspose::Pdf::CryptoAlgorithm, const 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, const 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.
publicCertificatesconst System::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(const System::String&, const System::String&, Aspose::Pdf::Permissions, Aspose::Pdf::CryptoAlgorithm) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(const System::String &userPassword, const System::String &ownerPassword, Aspose::Pdf::Permissions permissions, Aspose::Pdf::CryptoAlgorithm cryptoAlgorithm)
ParameterTypeDescription
userPasswordconst System::String&User password.
ownerPasswordconst System::String&Owner 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(const System::String&, const System::String&, Aspose::Pdf::Permissions, Aspose::Pdf::CryptoAlgorithm, bool) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(const System::String &userPassword, const System::String &ownerPassword, Aspose::Pdf::Permissions permissions, Aspose::Pdf::CryptoAlgorithm cryptoAlgorithm, bool usePdf20)
ParameterTypeDescription
userPasswordconst System::String&User password.
ownerPasswordconst System::String&Owner 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(const System::String&, const System::String&, Aspose::Pdf::Permissions, const System::SharedPtr<Security::ICustomSecurityHandler>&) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(const System::String &userPassword, const System::String &ownerPassword, Aspose::Pdf::Permissions permissions, const System::SharedPtr<Security::ICustomSecurityHandler> &customHandler)
ParameterTypeDescription
userPasswordconst System::String&User password.
ownerPasswordconst System::String&Owner password.
permissionsAspose::Pdf::PermissionsDocument permissions, see Permissions for details.
customHandlerconst System::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(const System::String&, const System::String&, const System::SharedPtr<Facades::DocumentPrivilege>&, Aspose::Pdf::CryptoAlgorithm, bool) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(const System::String &userPassword, const System::String &ownerPassword, const System::SharedPtr<Facades::DocumentPrivilege> &privileges, Aspose::Pdf::CryptoAlgorithm cryptoAlgorithm, bool usePdf20)
ParameterTypeDescription
userPasswordconst System::String&User password.
ownerPasswordconst System::String&Owner password.
privilegesconst System::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(const System::String&, const System::String&, const System::SharedPtr<Facades::DocumentPrivilege>&, const System::SharedPtr<Security::ICustomSecurityHandler>&) method

Encrypts the document.

void Aspose::Pdf::Document::Encrypt(const System::String &userPassword, const System::String &ownerPassword, const System::SharedPtr<Facades::DocumentPrivilege> &privileges, const System::SharedPtr<Security::ICustomSecurityHandler> &customHandler)
ParameterTypeDescription
userPasswordconst System::String&User password.
ownerPasswordconst System::String&Owner password.
privilegesconst System::SharedPtr<Facades::DocumentPrivilege>&Document permissions, see Permissions for details.
customHandlerconst System::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