DocumentEncrypt Method (String, String, DocumentPrivilege, CryptoAlgorithm, Boolean)
Encrypts the document. Call then Save to get encrypted version of the document.

Namespace: Aspose.Pdf
Assembly: Aspose.PDF (in Aspose.PDF.dll) Version: 20.3
Syntax
public void Encrypt(
	string userPassword,
	string ownerPassword,
	DocumentPrivilege privileges,
	CryptoAlgorithm cryptoAlgorithm,
	bool usePdf20
)

Parameters

userPassword
Type: SystemString
User password.
ownerPassword
Type: SystemString
Owner password.
privileges
Type: Aspose.Pdf.FacadesDocumentPrivilege
Document permissions, see Permissions for details.
cryptoAlgorithm
Type: Aspose.PdfCryptoAlgorithm
Cryptographic algorithm, see CryptoAlgorithm for details.
usePdf20
Type: SystemBoolean
Support for revision 6 (Extension 8).
See Also