Class TimeStampServer
- Namespace
- Syncfusion.Pdf.Security
- Assembly
- Syncfusion.Pdf.Portable.dll
Represent a time stamp to add in PDF document,
public class TimeStampServer
- Inheritance
-
TimeStampServer
- Inherited Members
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.
public TimeStampServer(Uri server)
Parameters
server
UriThe 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.
public TimeStampServer(Uri server, string username, string password)
Parameters
server
UriThe time stamp server uri.
username
stringThe user name of the timestamp server.
password
stringThe 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, int)
Initialize a new instance of the TimeStampServer class.
public TimeStampServer(Uri server, string username, string password, int timeOut)
Parameters
server
UriThe timestamp server uri.
username
stringThe user name of the timestamp server.
password
stringThe password of the user.
timeOut
intThe 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.
public bool IsValid { get; }
Property Value
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.
public string Password { get; set; }
Property Value
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.
public Uri Server { get; set; }
Property Value
- 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.
public int TimeOut { get; set; }
Property Value
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.
public string UserName { get; set; }
Property Value
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)