Class TimeStampServer
Represent a time stamp to add in PDF document,
Inheritance
System.Object
TimeStampServer
Namespace: Syncfusion.Pdf.Security
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class TimeStampServer : Object
Examples
// Creates a new document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Load the x509 certificate.
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
//Find by subject.
PdfCertificate pdfCert = new PdfCertificate(cert);
//Creates a signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 100));
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
//Create a new PDF time stamp server
TimeStampServer timeStampServer = new TimeStampServer(new Uri("http://syncfusion.digistamp.com"), "user", "123456");
//Add time stamp.
signature.TimeStampServer = timeStampServer;
//Save the document.
document.Save("output.pdf");
//Close the document.
document.Close(true);
' Creates a new document
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Load the x509 certificate.
Dim cert As New X509Certificate2("certificate.pfx", "password")
'Find by subject.
Dim pdfCert As New PdfCertificate(cert)
'Creates a signature.
Dim signature As New PdfSignature(document, page, pdfCert, "Signature")
signature.Bounds = New RectangleF(New PointF(0, 0), New SizeF(100, 100))
signature.ContactInfo = "johndoe@owned.us"
signature.LocationInfo = "Honolulu, Hawaii"
signature.Reason = "I am author of this document."
'Create a new PDF time stamp server
Dim timeStampServer As TimeStampServer = New TimeStampServer(New Uri("http://syncfusion.digistamp.com"), "user", "123456")
'Add time stamp.
signature.TimeStampServer = timeStampServer
'Save the document.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Constructors
TimeStampServer(Uri)
Initialize a new instance of the TimeStampServer class.
Declaration
public TimeStampServer(Uri server)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | server | The timestamp server uri |
Examples
// Creates a new document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Load the x509 certificate.
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
//Find by subject.
PdfCertificate pdfCert = new PdfCertificate(cert);
//Creates a signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 100));
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
//Create a new PDF time stamp server
TimeStampServer timeStampServer = new TimeStampServer(new Uri("http://syncfusion.digistamp.com"));
//Add time stamp.
signature.TimeStampServer = timeStampServer;
//Save the document.
document.Save("output.pdf");
//Close the document.
document.Close(true);
' Creates a new document
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Load the x509 certificate.
Dim cert As New X509Certificate2("certificate.pfx", "password")
'Find by subject.
Dim pdfCert As New PdfCertificate(cert)
'Creates a signature.
Dim signature As New PdfSignature(document, page, pdfCert, "Signature")
signature.Bounds = New RectangleF(New PointF(0, 0), New SizeF(100, 100))
signature.ContactInfo = "johndoe@owned.us"
signature.LocationInfo = "Honolulu, Hawaii"
signature.Reason = "I am author of this document."
'Create a new PDF time stamp server
Dim timeStampServer As TimeStampServer = New TimeStampServer(New Uri("http://syncfusion.digistamp.com"))
'Add time stamp.
signature.TimeStampServer = timeStampServer
'Save the document.
document.Save("output.pdf")
'Close the document.
document.Close(True)
TimeStampServer(Uri, String, String)
Initialize a new instance of the TimeStampServer class.
Declaration
public TimeStampServer(Uri server, string username, string password)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | server | The time stamp server uri. |
System.String | username | The user name of the timestamp server. |
System.String | password | The password of the timestamp server. |
Examples
// Creates a new document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Load the x509 certificate.
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
//Find by subject.
PdfCertificate pdfCert = new PdfCertificate(cert);
//Creates a signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 100));
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
//Create a new PDF time stamp server
TimeStampServer timeStampServer = new TimeStampServer(new Uri("http://syncfusion.digistamp.com"), "user", "123456");
//Add time stamp.
signature.TimeStampServer = timeStampServer;
//Save the document.
document.Save("output.pdf");
//Close the document.
document.Close(true);
' Creates a new document
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Load the x509 certificate.
Dim cert As New X509Certificate2("certificate.pfx", "password")
'Find by subject.
Dim pdfCert As New PdfCertificate(cert)
'Creates a signature.
Dim signature As New PdfSignature(document, page, pdfCert, "Signature")
signature.Bounds = New RectangleF(New PointF(0, 0), New SizeF(100, 100))
signature.ContactInfo = "johndoe@owned.us"
signature.LocationInfo = "Honolulu, Hawaii"
signature.Reason = "I am author of this document."
'Create a new PDF time stamp server
Dim timeStampServer As TimeStampServer = New TimeStampServer(New Uri("http://syncfusion.digistamp.com"), "user", "123456")
'Add time stamp.
signature.TimeStampServer = timeStampServer
'Save the document.
document.Save("output.pdf")
'Close the document.
document.Close(True)
TimeStampServer(Uri, String, String, Int32)
Initialize a new instance of the TimeStampServer class.
Declaration
public TimeStampServer(Uri server, string username, string password, int timeOut)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | server | The timestamp server uri. |
System.String | username | The user name of the timestamp server. |
System.String | password | The password of the user. |
System.Int32 | timeOut | The time out seconds. |
Examples
// Creates a new document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Load the x509 certificate.
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
//Find by subject.
PdfCertificate pdfCert = new PdfCertificate(cert);
//Creates a signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 100));
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
//Create a new PDF time stamp server
TimeStampServer timeStampServer = new TimeStampServer(new Uri("http://syncfusion.digistamp.com"), "user", "123456", 5);
//Add time stamp.
signature.TimeStampServer = timeStampServer;
//Save the document.
document.Save("output.pdf");
//Close the document.
document.Close(true);
' Creates a new document
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Load the x509 certificate.
Dim cert As New X509Certificate2("certificate.pfx", "password")
'Find by subject.
Dim pdfCert As New PdfCertificate(cert)
'Creates a signature.
Dim signature As New PdfSignature(document, page, pdfCert, "Signature")
signature.Bounds = New RectangleF(New PointF(0, 0), New SizeF(100, 100))
signature.ContactInfo = "johndoe@owned.us"
signature.LocationInfo = "Honolulu, Hawaii"
signature.Reason = "I am author of this document."
'Create a new PDF time stamp server
Dim timeStampServer As TimeStampServer = New TimeStampServer(New Uri("http://syncfusion.digistamp.com"), "user", "123456", 5)
'Add time stamp.
signature.TimeStampServer = timeStampServer
'Save the document.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Properties
IsValid
Gets a value indicating whether the Timestamp URL is valid.
Declaration
public bool IsValid { get; }
Property Value
Type |
---|
System.Boolean |
Examples
//Create a timestamp server.
TimeStampServer tsServer = new TimeStampServer(new Uri("http://timestampurl.com/"));
//Check whether the Timestamp URL is valid or not.
bool isValid = tsServer.IsValid;
'Create a timestamp server.
Dim tsServer As TimeStampServer = New TimeStampServer(New Uri("http://timestampurl.com/"))
'Check whether the Timestamp URL is valid or not.
Dim isValid As Boolean = tsServer.IsValid
Password
Gets or set the password.
Declaration
public string Password { get; set; }
Property Value
Type |
---|
System.String |
Examples
// Creates a new document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Load the x509 certificate.
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
//Find by subject.
PdfCertificate pdfCert = new PdfCertificate(cert);
//Creates a signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 100));
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
//Create a new PDF time stamp server
TimeStampServer timeStampServer = new TimeStampServer(new Uri("http://syncfusion.digistamp.com"));
//Set server uri.
timeStampServer.Server = new Uri("http://syncfusion.digistamp.com");
//Set user.
timeStampServer.UserName = "user";
//Set password.
timeStampServer.Password = "123456";
//Set time out.
timeStampServer.TimeOut = 5;
//Add time stamp.
signature.TimeStampServer = timeStampServer;
//Save the document.
document.Save("output.pdf");
//Close the document.
document.Close(true);
' Creates a new document
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Load the x509 certificate.
Dim cert As New X509Certificate2("certificate.pfx", "password")
'Find by subject.
Dim pdfCert As New PdfCertificate(cert)
'Creates a signature.
Dim signature As New PdfSignature(document, page, pdfCert, "Signature")
signature.Bounds = New RectangleF(New PointF(0, 0), New SizeF(100, 100))
signature.ContactInfo = "johndoe@owned.us"
signature.LocationInfo = "Honolulu, Hawaii"
signature.Reason = "I am author of this document."
'Create a new PDF time stamp server
Dim timeStampServer As New TimeStampServer(New Uri("http://syncfusion.digistamp.com"))
'Set server uri.
timeStampServer.Server = New Uri("http://syncfusion.digistamp.com")
'Set user.
timeStampServer.UserName = "user"
'Set password.
timeStampServer.Password = "123456"
'Set time out.
timeStampServer.TimeOut = 5
'Add time stamp.
signature.TimeStampServer = timeStampServer
'Save the document.
document.Save("output.pdf")
'Close the document.
document.Close(True)
Server
Gets or set the server uri.
Declaration
public Uri Server { get; set; }
Property Value
Type |
---|
System.Uri |
Examples
// Creates a new document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Load the x509 certificate.
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
//Find by subject.
PdfCertificate pdfCert = new PdfCertificate(cert);
//Creates a signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 100));
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
//Create a new PDF time stamp server
TimeStampServer timeStampServer = new TimeStampServer(new Uri("http://syncfusion.digistamp.com"));
//Set server uri.
timeStampServer.Server = new Uri("http://syncfusion.digistamp.com");
//Set user.
timeStampServer.UserName = "user";
//Set password.
timeStampServer.Password = "123456";
//Set time out.
timeStampServer.TimeOut = 5;
//Add time stamp.
signature.TimeStampServer = timeStampServer;
//Save the document.
document.Save("output.pdf");
//Close the document.
document.Close(true);
' Creates a new document
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Load the x509 certificate.
Dim cert As New X509Certificate2("certificate.pfx", "password")
'Find by subject.
Dim pdfCert As New PdfCertificate(cert)
'Creates a signature.
Dim signature As New PdfSignature(document, page, pdfCert, "Signature")
signature.Bounds = New RectangleF(New PointF(0, 0), New SizeF(100, 100))
signature.ContactInfo = "johndoe@owned.us"
signature.LocationInfo = "Honolulu, Hawaii"
signature.Reason = "I am author of this document."
'Create a new PDF time stamp server
Dim timeStampServer As New TimeStampServer(New Uri("http://syncfusion.digistamp.com"))
'Set server uri.
timeStampServer.Server = New Uri("http://syncfusion.digistamp.com")
'Set user.
timeStampServer.UserName = "user"
'Set password.
timeStampServer.Password = "123456"
'Set time out.
timeStampServer.TimeOut = 5
'Add time stamp.
signature.TimeStampServer = timeStampServer
'Save the document.
document.Save("output.pdf")
'Close the document.
document.Close(True)
TimeOut
Gets or set the timeout.
Declaration
public int TimeOut { get; set; }
Property Value
Type |
---|
System.Int32 |
Examples
// Creates a new document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Load the x509 certificate.
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
//Find by subject.
PdfCertificate pdfCert = new PdfCertificate(cert);
//Creates a signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 100));
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
//Create a new PDF time stamp server
TimeStampServer timeStampServer = new TimeStampServer(new Uri("http://syncfusion.digistamp.com"));
//Set server uri.
timeStampServer.Server = new Uri("http://syncfusion.digistamp.com");
//Set user.
timeStampServer.UserName = "user";
//Set password.
timeStampServer.Password = "123456";
//Set time out.
timeStampServer.TimeOut = 5;
//Add time stamp.
signature.TimeStampServer = timeStampServer;
//Save the document.
document.Save("output.pdf");
//Close the document.
document.Close(true);
' Creates a new document
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Load the x509 certificate.
Dim cert As New X509Certificate2("certificate.pfx", "password")
'Find by subject.
Dim pdfCert As New PdfCertificate(cert)
'Creates a signature.
Dim signature As New PdfSignature(document, page, pdfCert, "Signature")
signature.Bounds = New RectangleF(New PointF(0, 0), New SizeF(100, 100))
signature.ContactInfo = "johndoe@owned.us"
signature.LocationInfo = "Honolulu, Hawaii"
signature.Reason = "I am author of this document."
'Create a new PDF time stamp server
Dim timeStampServer As New TimeStampServer(New Uri("http://syncfusion.digistamp.com"))
'Set server uri.
timeStampServer.Server = New Uri("http://syncfusion.digistamp.com")
'Set user.
timeStampServer.UserName = "user"
'Set password.
timeStampServer.Password = "123456"
'Set time out.
timeStampServer.TimeOut = 5
'Add time stamp.
signature.TimeStampServer = timeStampServer
'Save the document.
document.Save("output.pdf")
'Close the document.
document.Close(True)
UserName
Gets or set the user name.
Declaration
public string UserName { get; set; }
Property Value
Type |
---|
System.String |
Examples
// Creates a new document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Load the x509 certificate.
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
//Find by subject.
PdfCertificate pdfCert = new PdfCertificate(cert);
//Creates a signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 100));
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
//Create a new PDF time stamp server
TimeStampServer timeStampServer = new TimeStampServer(new Uri("http://syncfusion.digistamp.com"));
//Set server uri.
timeStampServer.Server = new Uri("http://syncfusion.digistamp.com");
//Set user.
timeStampServer.UserName = "user";
//Set password.
timeStampServer.Password = "123456";
//Set time out.
timeStampServer.TimeOut = 5;
//Add time stamp.
signature.TimeStampServer = timeStampServer;
//Save the document.
document.Save("output.pdf");
//Close the document.
document.Close(true);
' Creates a new document
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Load the x509 certificate.
Dim cert As New X509Certificate2("certificate.pfx", "password")
'Find by subject.
Dim pdfCert As New PdfCertificate(cert)
'Creates a signature.
Dim signature As New PdfSignature(document, page, pdfCert, "Signature")
signature.Bounds = New RectangleF(New PointF(0, 0), New SizeF(100, 100))
signature.ContactInfo = "johndoe@owned.us"
signature.LocationInfo = "Honolulu, Hawaii"
signature.Reason = "I am author of this document."
'Create a new PDF time stamp server
Dim timeStampServer As New TimeStampServer(New Uri("http://syncfusion.digistamp.com"))
'Set server uri.
timeStampServer.Server = New Uri("http://syncfusion.digistamp.com")
'Set user.
timeStampServer.UserName = "user"
'Set password.
timeStampServer.Password = "123456"
'Set time out.
timeStampServer.TimeOut = 5
'Add time stamp.
signature.TimeStampServer = timeStampServer
'Save the document.
document.Save("output.pdf")
'Close the document.
document.Close(True)