Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings Class Reference

Detailed Description

Contains settings of the digital signature timestamp.

Examples

Shows how to sign a saved PDF document digitally and timestamp it.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Signed PDF contents.");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
auto options = MakeObject<PdfSaveOptions>();
// Create a digital signature and assign it to our SaveOptions object to sign the document when we save it to PDF.
SharedPtr<CertificateHolder> certificateHolder = CertificateHolder::Create(MyDir + u"morzal.pfx", u"aw");
options->set_DigitalSignatureDetails(
MakeObject<PdfDigitalSignatureDetails>(certificateHolder, u"Test Signing", u"Aspose Office", System::DateTime::get_Now()));
// Create a timestamp authority-verified timestamp.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword"));
// The default lifespan of the timestamp is 100 seconds.
ASPOSE_ASSERT_EQ(100.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
// We can set our timeout period via the constructor.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword", System::TimeSpan::FromMinutes(30)));
ASPOSE_ASSERT_EQ(1800.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
ASSERT_EQ(u"https://freetsa.org/tsr", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_ServerUrl());
ASSERT_EQ(u"JohnDoe", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_UserName());
ASSERT_EQ(u"MyPassword", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Password());
// The "Save" method will apply our signature to the output document at this time.
doc->Save(ArtifactsDir + u"PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf", options);

#include <Aspose.Words.Cpp/Saving/PdfDigitalSignatureTimestampSettings.h>

+ Inheritance diagram for Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings:

Public Member Functions

 PdfDigitalSignatureTimestampSettings ()
 Initializes an instance of this class. More...
 
 PdfDigitalSignatureTimestampSettings (const String &serverUrl, const String &userName, const String &password)
 Initializes an instance of this class. More...
 
 PdfDigitalSignatureTimestampSettings (const String &serverUrl, const String &userName, const String &password, TimeSpan timeout)
 Initializes an instance of this class. More...
 
String get_Password () const
 Timestamp server password. More...
 
String get_ServerUrl () const
 Timestamp server URL. More...
 
TimeSpan get_Timeout () const
 Time-out value for accessing timestamp server. More...
 
String get_UserName () const
 Timestamp server user name. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_Password (const String &value)
 Setter for get_Password. More...
 
void set_ServerUrl (const String &value)
 Setter for get_ServerUrl. More...
 
void set_Timeout (TimeSpan value)
 Setter for get_Timeout. More...
 
void set_UserName (const String &value)
 Setter for get_UserName. More...
 

Static Public Member Functions

static const TypeInfoType ()
 

Constructor & Destructor Documentation

◆ PdfDigitalSignatureTimestampSettings() [1/3]

Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::PdfDigitalSignatureTimestampSettings ( )

Initializes an instance of this class.

◆ PdfDigitalSignatureTimestampSettings() [2/3]

Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::PdfDigitalSignatureTimestampSettings ( const System::String serverUrl,
const System::String userName,
const System::String password 
)

Initializes an instance of this class.

Parameters
serverUrlTimestamp server URL.
userNameTimestamp server user name.
passwordTimestamp server password.
Examples

Shows how to sign a saved PDF document digitally and timestamp it.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Signed PDF contents.");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
auto options = MakeObject<PdfSaveOptions>();
// Create a digital signature and assign it to our SaveOptions object to sign the document when we save it to PDF.
SharedPtr<CertificateHolder> certificateHolder = CertificateHolder::Create(MyDir + u"morzal.pfx", u"aw");
options->set_DigitalSignatureDetails(
MakeObject<PdfDigitalSignatureDetails>(certificateHolder, u"Test Signing", u"Aspose Office", System::DateTime::get_Now()));
// Create a timestamp authority-verified timestamp.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword"));
// The default lifespan of the timestamp is 100 seconds.
ASPOSE_ASSERT_EQ(100.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
// We can set our timeout period via the constructor.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword", System::TimeSpan::FromMinutes(30)));
ASPOSE_ASSERT_EQ(1800.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
ASSERT_EQ(u"https://freetsa.org/tsr", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_ServerUrl());
ASSERT_EQ(u"JohnDoe", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_UserName());
ASSERT_EQ(u"MyPassword", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Password());
// The "Save" method will apply our signature to the output document at this time.
doc->Save(ArtifactsDir + u"PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf", options);

◆ PdfDigitalSignatureTimestampSettings() [3/3]

Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::PdfDigitalSignatureTimestampSettings ( const System::String serverUrl,
const System::String userName,
const System::String password,
System::TimeSpan  timeout 
)

Initializes an instance of this class.

Parameters
serverUrlTimestamp server URL.
userNameTimestamp server user name.
passwordTimestamp server password.
timeoutTime-out value for accessing timestamp server.
Examples

Shows how to sign a saved PDF document digitally and timestamp it.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Signed PDF contents.");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
auto options = MakeObject<PdfSaveOptions>();
// Create a digital signature and assign it to our SaveOptions object to sign the document when we save it to PDF.
SharedPtr<CertificateHolder> certificateHolder = CertificateHolder::Create(MyDir + u"morzal.pfx", u"aw");
options->set_DigitalSignatureDetails(
MakeObject<PdfDigitalSignatureDetails>(certificateHolder, u"Test Signing", u"Aspose Office", System::DateTime::get_Now()));
// Create a timestamp authority-verified timestamp.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword"));
// The default lifespan of the timestamp is 100 seconds.
ASPOSE_ASSERT_EQ(100.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
// We can set our timeout period via the constructor.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword", System::TimeSpan::FromMinutes(30)));
ASPOSE_ASSERT_EQ(1800.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
ASSERT_EQ(u"https://freetsa.org/tsr", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_ServerUrl());
ASSERT_EQ(u"JohnDoe", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_UserName());
ASSERT_EQ(u"MyPassword", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Password());
// The "Save" method will apply our signature to the output document at this time.
doc->Save(ArtifactsDir + u"PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf", options);

Member Function Documentation

◆ get_Password()

System::String Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::get_Password ( ) const

Timestamp server password.

Examples

Shows how to sign a saved PDF document digitally and timestamp it.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Signed PDF contents.");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
auto options = MakeObject<PdfSaveOptions>();
// Create a digital signature and assign it to our SaveOptions object to sign the document when we save it to PDF.
SharedPtr<CertificateHolder> certificateHolder = CertificateHolder::Create(MyDir + u"morzal.pfx", u"aw");
options->set_DigitalSignatureDetails(
MakeObject<PdfDigitalSignatureDetails>(certificateHolder, u"Test Signing", u"Aspose Office", System::DateTime::get_Now()));
// Create a timestamp authority-verified timestamp.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword"));
// The default lifespan of the timestamp is 100 seconds.
ASPOSE_ASSERT_EQ(100.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
// We can set our timeout period via the constructor.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword", System::TimeSpan::FromMinutes(30)));
ASPOSE_ASSERT_EQ(1800.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
ASSERT_EQ(u"https://freetsa.org/tsr", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_ServerUrl());
ASSERT_EQ(u"JohnDoe", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_UserName());
ASSERT_EQ(u"MyPassword", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Password());
// The "Save" method will apply our signature to the output document at this time.
doc->Save(ArtifactsDir + u"PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf", options);

◆ get_ServerUrl()

System::String Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::get_ServerUrl ( ) const

Timestamp server URL.

Examples

Shows how to sign a saved PDF document digitally and timestamp it.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Signed PDF contents.");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
auto options = MakeObject<PdfSaveOptions>();
// Create a digital signature and assign it to our SaveOptions object to sign the document when we save it to PDF.
SharedPtr<CertificateHolder> certificateHolder = CertificateHolder::Create(MyDir + u"morzal.pfx", u"aw");
options->set_DigitalSignatureDetails(
MakeObject<PdfDigitalSignatureDetails>(certificateHolder, u"Test Signing", u"Aspose Office", System::DateTime::get_Now()));
// Create a timestamp authority-verified timestamp.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword"));
// The default lifespan of the timestamp is 100 seconds.
ASPOSE_ASSERT_EQ(100.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
// We can set our timeout period via the constructor.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword", System::TimeSpan::FromMinutes(30)));
ASPOSE_ASSERT_EQ(1800.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
ASSERT_EQ(u"https://freetsa.org/tsr", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_ServerUrl());
ASSERT_EQ(u"JohnDoe", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_UserName());
ASSERT_EQ(u"MyPassword", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Password());
// The "Save" method will apply our signature to the output document at this time.
doc->Save(ArtifactsDir + u"PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf", options);

◆ get_Timeout()

System::TimeSpan Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::get_Timeout ( ) const

Time-out value for accessing timestamp server.

Examples

Shows how to sign a saved PDF document digitally and timestamp it.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Signed PDF contents.");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
auto options = MakeObject<PdfSaveOptions>();
// Create a digital signature and assign it to our SaveOptions object to sign the document when we save it to PDF.
SharedPtr<CertificateHolder> certificateHolder = CertificateHolder::Create(MyDir + u"morzal.pfx", u"aw");
options->set_DigitalSignatureDetails(
MakeObject<PdfDigitalSignatureDetails>(certificateHolder, u"Test Signing", u"Aspose Office", System::DateTime::get_Now()));
// Create a timestamp authority-verified timestamp.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword"));
// The default lifespan of the timestamp is 100 seconds.
ASPOSE_ASSERT_EQ(100.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
// We can set our timeout period via the constructor.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword", System::TimeSpan::FromMinutes(30)));
ASPOSE_ASSERT_EQ(1800.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
ASSERT_EQ(u"https://freetsa.org/tsr", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_ServerUrl());
ASSERT_EQ(u"JohnDoe", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_UserName());
ASSERT_EQ(u"MyPassword", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Password());
// The "Save" method will apply our signature to the output document at this time.
doc->Save(ArtifactsDir + u"PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf", options);

◆ get_UserName()

System::String Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::get_UserName ( ) const

Timestamp server user name.

Examples

Shows how to sign a saved PDF document digitally and timestamp it.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Signed PDF contents.");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
auto options = MakeObject<PdfSaveOptions>();
// Create a digital signature and assign it to our SaveOptions object to sign the document when we save it to PDF.
SharedPtr<CertificateHolder> certificateHolder = CertificateHolder::Create(MyDir + u"morzal.pfx", u"aw");
options->set_DigitalSignatureDetails(
MakeObject<PdfDigitalSignatureDetails>(certificateHolder, u"Test Signing", u"Aspose Office", System::DateTime::get_Now()));
// Create a timestamp authority-verified timestamp.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword"));
// The default lifespan of the timestamp is 100 seconds.
ASPOSE_ASSERT_EQ(100.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
// We can set our timeout period via the constructor.
options->get_DigitalSignatureDetails()->set_TimestampSettings(
MakeObject<PdfDigitalSignatureTimestampSettings>(u"https://freetsa.org/tsr", u"JohnDoe", u"MyPassword", System::TimeSpan::FromMinutes(30)));
ASPOSE_ASSERT_EQ(1800.0, options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Timeout().get_TotalSeconds());
ASSERT_EQ(u"https://freetsa.org/tsr", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_ServerUrl());
ASSERT_EQ(u"JohnDoe", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_UserName());
ASSERT_EQ(u"MyPassword", options->get_DigitalSignatureDetails()->get_TimestampSettings()->get_Password());
// The "Save" method will apply our signature to the output document at this time.
doc->Save(ArtifactsDir + u"PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf", options);

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::GetType ( ) const
overridevirtual

Reimplemented from System::Object.

◆ Is()

virtual bool Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from System::Object.

◆ set_Password()

void Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::set_Password ( const System::String value)

◆ set_ServerUrl()

void Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::set_ServerUrl ( const System::String value)

◆ set_Timeout()

void Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::set_Timeout ( System::TimeSpan  value)

◆ set_UserName()

void Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::set_UserName ( const System::String value)

◆ Type()

static const System::TypeInfo& Aspose::Words::Saving::PdfDigitalSignatureTimestampSettings::Type ( )
static