Skip to main content

TimestampServer

Version: 11.0

cete.dynamicpdf.timestampserver

TimestampServer​

Represents a class which contains the Timestamp Server details.

public class TimestampServer
Public Class TimestampServer

Inheritance: Object → TimestampServer

Examples​

This example shows how to create a signature and sign it with a certificate using timestamp server.

Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Forms
Imports ceTe.DynamicPDF.Text

Module MyModule

Sub Main()
'Create a PDF Document
Dim document As Document = New Document

'Create a Page
Dim page As Page = New Page

'Create a signature form field
Dim signature As Signature = New Signature("SigField", 10, 10, 250, 100)

' Add signature field to the page
page.Elements.Add(signature)

' Add the page to the document
document.Pages.Add(page)

'Create a Certificate from the file
Dim certificate As Certificate = New Certificate("c:\MyPersonalCertificate.pfx", "CertificatePassword")

'Create TimestampServer
Dim timestampServer As TimestampServer = New TimestampServer("Url of the Timestamp Server")

' Sign the document referring the sign field
document.Sign("SigField", certificate, timestampServer)

' Save the document
document.Draw("C:\MySignedDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.Forms;

class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();

// Create a PDF Page
Page page = new Page();

// Create a signature form field
Signature signature = new Signature("SigField", 10, 10, 250, 100);

// Add signature field to the page
page.Elements.Add(signature);

// Add the page to the document
document.Pages.Add(page);

// Create a Certificate from the file
Certificate certificate = new Certificate(@"c:\MyPersonalCertificate.pfx", "CertificatePassword");

// Create TimestampServer
TimestampServer timestampServer = new TimestampServer("Url of the Timestamp Server");

// Sign the document referring the sign field
document.Sign("SigField", certificate, timestampServer);

// Save the document
document.Draw(@"C:\MySignedDocument.pdf");
}
}

Remarks​

This class is not available for .NET standard.

Constructors​

TimestampServer(String)​

Initializes a new instance of TimestampServer class.

public TimestampServer(string tsUrl)
Public Sub New (tsUrl As String)

Parameters​

Web Url of TSA.

TimestampServer(String, String, String)​

Initializes a new instance of TimestampServer class.

public TimestampServer(string tsUrl, string userName, string password)
Public Sub New (tsUrl As String, userName As String, password As String)

Parameters​

Web Url of TSA.

UserName to use for the connection.

Password to use for the connection.

Properties​

HashAlgorithmOid​

Get or Sets the oid of the hash algorithm to be used.

public string HashAlgorithmOid { get; set; }
Public Property HashAlgorithmOid As String

Property Value​

String

Remarks​

The deault value "2.16.840.1.101.3.4.2.1" indicates SHA-256 hash algorithm. Setting incorrect oid value will raise exception.

Password​

Gets or Sets the Password to use for the connection.

public string Password { get; set; }
Public Property Password As String

Property Value​

String

Timeout​

Gets or Sets the Timeout for the connection.

public int Timeout { get; set; }
Public Property Timeout As Int32

Property Value​

Int32

Url​

Gets or Sets the Url of the TSA.

public string Url { get; set; }
Public Property Url As String

Property Value​

String

UserName​

Gets or Sets the UserName to use for the connection.

public string UserName { get; set; }
Public Property UserName As String

Property Value​

String

Methods​

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF