DocumentEncrypt Method (String, String, Permissions, CryptoAlgorithm)
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,
	Permissions permissions,
	CryptoAlgorithm cryptoAlgorithm
)

Parameters

userPassword
Type: SystemString
User password.
ownerPassword
Type: SystemString
Owner password.
permissions
Type: Aspose.PdfPermissions
Document permissions, see Permissions for details.
cryptoAlgorithm
Type: Aspose.PdfCryptoAlgorithm
Cryptographic algorithm, see CryptoAlgorithm for details.
See Also