PdfFileSecurity.ChangePassword

ChangePassword(string, string, string)

Change le mot de passe utilisateur et le mot de passe propriétaire, conserve les paramètres de sécurité d’origine. Le nouveau mot de passe utilisateur et le nouveau mot de passe propriétaire peuvent être nuls ou vides. Le mot de passe propriétaire sera remplacé par une chaîne aléatoire si le nouveau mot de passe propriétaire est nul ou vide. Lève une exception si le processus échoue.

public bool ChangePassword(string ownerPassword, string newUserPassword, string newOwnerPassword)
ParamètreTypeDescription
ownerPasswordStringMot de passe propriétaire d’origine.
newUserPasswordStringNouveau mot de passe utilisateur.
newOwnerPasswordStringNouveau mot de passe propriétaire.

Valeur de retour

Vrai pour le succès.

Exemples

[C#]
 string inFile = "D:\\input.pdf"; //The TestPath may be re-assigned.
 string outFile = "D:\\output.pdf";	//The TestPath may be re-assigned.
 PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);		
 fileSecurity.ChangePassword("owner","newuser","newowner");

[Visual Basic]
 Dim inFile As String = ".D:\\input.pdf"  'The TestPath may be re-assigned.'
 Dim outFile As String = "D:\\output.pdf"  'The TestPath may be re-assigned.'
 Dim fileSecurity As PdfFileSecurity = New PdfFileSecurity(inFile,outFile) 
 fileSecurity.ChangePassword("owner","newuser","newowner")	

Voir aussi


ChangePassword(string, string, string, DocumentPrivilege, KeySize)

Change le mot de passe utilisateur et le mot de passe par le mot de passe propriétaire, permet de réinitialiser la sécurité du document Pdf. Le nouveau mot de passe utilisateur et le nouveau mot de passe propriétaire peuvent être nuls ou vides. Le mot de passe propriétaire sera remplacé par une chaîne aléatoire si le nouveau mot de passe propriétaire est nul ou vide. Lève une exception si le processus échoue.

public bool ChangePassword(string ownerPassword, string newUserPassword, string newOwnerPassword, 
    DocumentPrivilege privilege, KeySize keySize)
ParamètreTypeDescription
ownerPasswordStringMot de passe propriétaire d’origine.
newUserPasswordStringNouveau mot de passe utilisateur.
newOwnerPasswordStringNouveau mot de passe propriétaire.
privilegeDocumentPrivilegeRéinitialiser la sécurité.
keySizeKeySizeKeySize.x40 pour le cryptage 40 bits, KeySize.x128 pour le cryptage 128 bits et KeySize.x256 pour le cryptage 256 bits.

Valeur de retour

Vrai pour le succès.

Exemples

[C#]
string inFile = ".D:\\input.pdf"; //The TestPath may be re-assigned.
string outFile = "D:\\output.pdf";	//The TestPath may be re-assigned.
PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);	
fileSecurity.ChangePassword("owner","newuser","newowner", DocumentPrivilege.Print,KeySize.x256);

[Visual Basic] 
Dim inFile As String =  ".D:\\input.pdf"  'The TestPath may be re-assigned.'
Dim outFile As String =  "D:\\output.pdf"  'The TestPath may be re-assigned.'
Dim fileSecurity As PdfFileSecurity =  New PdfFileSecurity(inFile,outFile) 
fileSecurity.ChangePassword("owner","newuser","newowner", DocumentPrivilege.Print,KeySize.x256)

Voir aussi


ChangePassword(string, string, string, DocumentPrivilege, KeySize, Algorithm)

Change le mot de passe utilisateur et le mot de passe par le mot de passe propriétaire, permet de réinitialiser la sécurité du document Pdf. Le nouveau mot de passe utilisateur et le nouveau mot de passe propriétaire peuvent être nuls ou vides. Le mot de passe propriétaire sera remplacé par une chaîne aléatoire si le nouveau mot de passe propriétaire est nul ou vide. Il existe 6 combinaisons possibles de valeurs KeySize et Algorithm. Cependant, (KeySize.x40, Algorithm.AES) et (KeySize.x256, Algorithm.RC4) sont invalides et une exception correspondante sera levée si le kit rencontre cette combinaison. Lève une exception si le processus échoue.

public bool ChangePassword(string ownerPassword, string newUserPassword, string newOwnerPassword, 
    DocumentPrivilege privilege, KeySize keySize, Algorithm cipher)
ParamètreTypeDescription
ownerPasswordStringMot de passe propriétaire d’origine.
newUserPasswordStringNouveau mot de passe utilisateur.
newOwnerPasswordStringNouveau mot de passe propriétaire.
privilegeDocumentPrivilegeRéinitialiser la sécurité.
keySizeKeySizeKeySize.x40 pour le cryptage 40 bits, KeySize.x128 pour le cryptage 128 bits et KeySize.x256 pour le cryptage 256 bits.
cipherAlgorithmAlgorithm.AES pour chiffrer en utilisant l’algorithme AES ou Algorithm.RC4 pour le chiffrement RC4.

Valeur de retour

Vrai pour le succès.

Exemples

[C#]
string inFile = ".D:\\input.pdf"; //The TestPath may be re-assigned.
string outFile = "D:\\output.pdf";	//The TestPath may be re-assigned.
PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);	
fileSecurity.ChangePassword("owner","newuser","newowner", DocumentPrivilege.Print,KeySize.x256,Algorithm.AES);

[Visual Basic] 
Dim inFile As String =  ".D:\\input.pdf"  'The TestPath may be re-assigned.'
Dim outFile As String =  "D:\\output.pdf"  'The TestPath may be re-assigned.'
Dim fileSecurity As PdfFileSecurity =  New PdfFileSecurity(inFile,outFile) 
fileSecurity.ChangePassword("owner","newuser","newowner", DocumentPrivilege.Print,KeySize.x256,Algorithm.AES)

Voir aussi