Document.Encrypt
Encrypt(Permissions, CryptoAlgorithm, IList<X509Certificate2>)
Encrypts the document.
public void Encrypt(Permissions permissions, CryptoAlgorithm cryptoAlgorithm,
IList<X509Certificate2> publicCertificates)
| Parameter | Type | Description |
|---|---|---|
| permissions | Permissions | Document permissions, see Permissions for details. |
| cryptoAlgorithm | CryptoAlgorithm | Cryptographic algorithm, see CryptoAlgorithm for details. |
| publicCertificates | IList`1 | 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
- enum Permissions
- enum CryptoAlgorithm
- class Document
- namespace Aspose.Pdf
- assembly Aspose.PDF
Encrypt(string, string, DocumentPrivilege, ICustomSecurityHandler)
Encrypts the document.
public void Encrypt(string userPassword, string ownerPassword, DocumentPrivilege privileges,
ICustomSecurityHandler customHandler)
| Parameter | Type | Description |
|---|---|---|
| userPassword | String | User password. |
| ownerPassword | String | Owner password. |
| privileges | DocumentPrivilege | Document permissions, see Permissions for details. |
| customHandler | 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
- class DocumentPrivilege
- interface ICustomSecurityHandler
- class Document
- namespace Aspose.Pdf
- assembly Aspose.PDF
Encrypt(string, string, Permissions, ICustomSecurityHandler)
Encrypts the document.
public void Encrypt(string userPassword, string ownerPassword, Permissions permissions,
ICustomSecurityHandler customHandler)
| Parameter | Type | Description |
|---|---|---|
| userPassword | String | User password. |
| ownerPassword | String | Owner password. |
| permissions | Permissions | Document permissions, see Permissions for details. |
| customHandler | 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
- enum Permissions
- interface ICustomSecurityHandler
- class Document
- namespace Aspose.Pdf
- assembly Aspose.PDF
Encrypt(string, string, DocumentPrivilege, CryptoAlgorithm, bool)
Encrypts the document.
public void Encrypt(string userPassword, string ownerPassword, DocumentPrivilege privileges,
CryptoAlgorithm cryptoAlgorithm, bool usePdf20)
| Parameter | Type | Description |
|---|---|---|
| userPassword | String | User password. |
| ownerPassword | String | Owner password. |
| privileges | DocumentPrivilege | Document permissions, see Permissions for details. |
| cryptoAlgorithm | CryptoAlgorithm | Cryptographic algorithm, see CryptoAlgorithm for details. |
| usePdf20 | Boolean | Support 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
- class DocumentPrivilege
- enum CryptoAlgorithm
- class Document
- namespace Aspose.Pdf
- assembly Aspose.PDF
Encrypt(string, string, Permissions, CryptoAlgorithm)
Encrypts the document.
public void Encrypt(string userPassword, string ownerPassword, Permissions permissions,
CryptoAlgorithm cryptoAlgorithm)
| Parameter | Type | Description |
|---|---|---|
| userPassword | String | User password. |
| ownerPassword | String | Owner password. |
| permissions | Permissions | Document permissions, see Permissions for details. |
| cryptoAlgorithm | CryptoAlgorithm | Cryptographic 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
- enum Permissions
- enum CryptoAlgorithm
- class Document
- namespace Aspose.Pdf
- assembly Aspose.PDF
Encrypt(string, string, Permissions, CryptoAlgorithm, bool)
Encrypts the document.
public void Encrypt(string userPassword, string ownerPassword, Permissions permissions,
CryptoAlgorithm cryptoAlgorithm, bool usePdf20)
| Parameter | Type | Description |
|---|---|---|
| userPassword | String | User password. |
| ownerPassword | String | Owner password. |
| permissions | Permissions | Document permissions, see Permissions for details. |
| cryptoAlgorithm | CryptoAlgorithm | Cryptographic algorithm, see CryptoAlgorithm for details. |
| usePdf20 | Boolean | Support 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
- enum Permissions
- enum CryptoAlgorithm
- class Document
- namespace Aspose.Pdf
- assembly Aspose.PDF