java.lang.Objectcom.aspose.words.PdfDigitalSignatureTimestampSettings
public class PdfDigitalSignatureTimestampSettings
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("Signed PDF contents.");
// Create a digital signature for the document that we will save
CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");
PdfSaveOptions options = new PdfSaveOptions();
options.setDigitalSignatureDetails(new PdfDigitalSignatureDetails(certificateHolder, "Test Signing", "Aspose Office", new Date()));
// We can set a verified timestamp for our signature as well, with a valid timestamp authority
options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword"));
// The default lifespan of the timestamp is 100 seconds
Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 100000);
// We can set our own timeout period via the constructor
options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword", (long) 30.0));
Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 30);
Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getServerUrl(), "https://freetsa.org/tsr");
Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getUserName(), "JohnDoe");
Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getPassword(), "MyPassword");
doc.save(getArtifactsDir() + "PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf");
Constructor Summary |
---|
PdfDigitalSignatureTimestampSettings()
Initializes an instance of this class. |
PdfDigitalSignatureTimestampSettings(java.lang.String serverUrl, java.lang.String userName, java.lang.String password)
Initializes an instance of this class. |
Property Getters/Setters Summary | ||
---|---|---|
java.lang.String | getPassword() | |
void | setPassword(java.lang.String value) | |
Timestamp server password. | ||
java.lang.String | getServerUrl() | |
void | setServerUrl(java.lang.String value) | |
Timestamp server URL. | ||
System.TimeSpan | getTimeout() | |
Time-out value in milliseconds for accessing timestamp server. | ||
java.lang.String | getUserName() | |
void | setUserName(java.lang.String value) | |
Timestamp server user name. |
Constructor Detail |
---|
public PdfDigitalSignatureTimestampSettings()
Example:
Shows how to sign a generated PDF and timestamp it using Aspose.Words.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.writeln("Signed PDF contents."); // Create a digital signature for the document that we will save CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw"); PdfSaveOptions options = new PdfSaveOptions(); options.setDigitalSignatureDetails(new PdfDigitalSignatureDetails(certificateHolder, "Test Signing", "Aspose Office", new Date())); // We can set a verified timestamp for our signature as well, with a valid timestamp authority options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword")); // The default lifespan of the timestamp is 100 seconds Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 100000); // We can set our own timeout period via the constructor options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword", (long) 30.0)); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 30); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getServerUrl(), "https://freetsa.org/tsr"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getUserName(), "JohnDoe"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getPassword(), "MyPassword"); doc.save(getArtifactsDir() + "PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf");
public PdfDigitalSignatureTimestampSettings(java.lang.String serverUrl, java.lang.String userName, java.lang.String password)
serverUrl
- Timestamp server URL.userName
- Timestamp server user name.password
- Timestamp server password.Example:
Shows how to sign a generated PDF and timestamp it using Aspose.Words.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.writeln("Signed PDF contents."); // Create a digital signature for the document that we will save CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw"); PdfSaveOptions options = new PdfSaveOptions(); options.setDigitalSignatureDetails(new PdfDigitalSignatureDetails(certificateHolder, "Test Signing", "Aspose Office", new Date())); // We can set a verified timestamp for our signature as well, with a valid timestamp authority options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword")); // The default lifespan of the timestamp is 100 seconds Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 100000); // We can set our own timeout period via the constructor options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword", (long) 30.0)); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 30); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getServerUrl(), "https://freetsa.org/tsr"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getUserName(), "JohnDoe"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getPassword(), "MyPassword"); doc.save(getArtifactsDir() + "PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf");
Property Getters/Setters Detail |
---|
getPassword/setPassword | |
public java.lang.String getPassword() / public void setPassword(java.lang.String value) |
Example:
Shows how to sign a generated PDF and timestamp it using Aspose.Words.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.writeln("Signed PDF contents."); // Create a digital signature for the document that we will save CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw"); PdfSaveOptions options = new PdfSaveOptions(); options.setDigitalSignatureDetails(new PdfDigitalSignatureDetails(certificateHolder, "Test Signing", "Aspose Office", new Date())); // We can set a verified timestamp for our signature as well, with a valid timestamp authority options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword")); // The default lifespan of the timestamp is 100 seconds Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 100000); // We can set our own timeout period via the constructor options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword", (long) 30.0)); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 30); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getServerUrl(), "https://freetsa.org/tsr"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getUserName(), "JohnDoe"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getPassword(), "MyPassword"); doc.save(getArtifactsDir() + "PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf");
getServerUrl/setServerUrl | |
public java.lang.String getServerUrl() / public void setServerUrl(java.lang.String value) |
Example:
Shows how to sign a generated PDF and timestamp it using Aspose.Words.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.writeln("Signed PDF contents."); // Create a digital signature for the document that we will save CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw"); PdfSaveOptions options = new PdfSaveOptions(); options.setDigitalSignatureDetails(new PdfDigitalSignatureDetails(certificateHolder, "Test Signing", "Aspose Office", new Date())); // We can set a verified timestamp for our signature as well, with a valid timestamp authority options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword")); // The default lifespan of the timestamp is 100 seconds Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 100000); // We can set our own timeout period via the constructor options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword", (long) 30.0)); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 30); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getServerUrl(), "https://freetsa.org/tsr"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getUserName(), "JohnDoe"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getPassword(), "MyPassword"); doc.save(getArtifactsDir() + "PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf");
getTimeout | |
public System.TimeSpan getTimeout() |
Example:
Shows how to sign a generated PDF and timestamp it using Aspose.Words.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.writeln("Signed PDF contents."); // Create a digital signature for the document that we will save CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw"); PdfSaveOptions options = new PdfSaveOptions(); options.setDigitalSignatureDetails(new PdfDigitalSignatureDetails(certificateHolder, "Test Signing", "Aspose Office", new Date())); // We can set a verified timestamp for our signature as well, with a valid timestamp authority options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword")); // The default lifespan of the timestamp is 100 seconds Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 100000); // We can set our own timeout period via the constructor options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword", (long) 30.0)); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 30); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getServerUrl(), "https://freetsa.org/tsr"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getUserName(), "JohnDoe"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getPassword(), "MyPassword"); doc.save(getArtifactsDir() + "PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf");
getUserName/setUserName | |
public java.lang.String getUserName() / public void setUserName(java.lang.String value) |
Example:
Shows how to sign a generated PDF and timestamp it using Aspose.Words.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.writeln("Signed PDF contents."); // Create a digital signature for the document that we will save CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw"); PdfSaveOptions options = new PdfSaveOptions(); options.setDigitalSignatureDetails(new PdfDigitalSignatureDetails(certificateHolder, "Test Signing", "Aspose Office", new Date())); // We can set a verified timestamp for our signature as well, with a valid timestamp authority options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword")); // The default lifespan of the timestamp is 100 seconds Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 100000); // We can set our own timeout period via the constructor options.getDigitalSignatureDetails().setTimestampSettings(new PdfDigitalSignatureTimestampSettings("https://freetsa.org/tsr", "JohnDoe", "MyPassword", (long) 30.0)); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getTimeout(), 30); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getServerUrl(), "https://freetsa.org/tsr"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getUserName(), "JohnDoe"); Assert.assertEquals(options.getDigitalSignatureDetails().getTimestampSettings().getPassword(), "MyPassword"); doc.save(getArtifactsDir() + "PdfSaveOptions.PdfDigitalSignatureTimestamp.pdf");