Aspose::Words::Loading::LoadOptions::get_Password method

LoadOptions::get_Password method

Gets or sets the password for opening an encrypted document. Can be null or empty string. Default is null.

System::String Aspose::Words::Loading::LoadOptions::get_Password() const


You need to know the password to open an encrypted document. If the document is not encrypted, set this to null or empty string.


Shows how to sign encrypted document file.

// Create an X.509 certificate from a PKCS#12 store, which should contain a private key.
SharedPtr<CertificateHolder> certificateHolder = CertificateHolder::Create(MyDir + u"morzal.pfx", u"aw");

// Create a comment, date, and decryption password which will be applied with our new digital signature.
auto signOptions = MakeObject<SignOptions>();

// Set a local system filename for the unsigned input document, and an output filename for its new digitally signed copy.
String inputFileName = MyDir + u"Encrypted.docx";
String outputFileName = ArtifactsDir + u"DigitalSignatureUtil.DecryptionPassword.docx";

DigitalSignatureUtil::Sign(inputFileName, outputFileName, certificateHolder, signOptions);

See Also