Add long term validation for a specified signature to the Document Security Store.

 

   

Syntax
 

[C#]
void AddLongTermValidation(Signature signature, Uri tsaUri, Oid digestAlgorithm)

[Visual Basic]
Sub AddLongTermValidation(signature As Signature, tsaUri As Uri, digestAlgorithm As Oid)

 

   

Params
 
Name Description
signature The signature for which to add the long term validation.
tsaUri An optional timestamp server to timestamp the long term validation information. May be null.
digestAlgorithm The hash algorithm to use to create the digest of the signature to be timestamped where tsaUri is specified.

 

   

Notes
 

This method adds the signature's signing certificate chain to the Document Security Store (DSS) dictionary and the signature's Validation Related Information (VRI) dictionary. The certificate chain is extracted from the signature CMS and each certificate except the root certificate is checked for revocation.

Set the Signature.DocumentSecurityStorePolicy property to control the tpe of revocation information added to the DSS.

 

   

Example
 

The following example shows how to add long-term validation to an existing signed signature called "Signature1", prefering OCSP responses over CRLs.

[C#]
using(Doc doc = new Doc()) {
  doc.Read("SignedDoc.pdf");
  Signature theSig = (Signature)doc.Form.Fields["Signature1"];
  theSig.DocumentSecurityStorePolicy = Signature.RevocationCheckingPolicy.PreferOCSP;
  FormOperation formOp = new FormOperation(doc);
  formOp.AddLongTermValidation(theSig, null, null);
  doc.Save("LTVSignedDoc.pdf");
}


[Visual Basic]
Dim doc As Doc = New Doc()
doc.Read("SignedDoc.pdf")
Dim theSig As Signature = CType(doc.Form.Fields("Signature1"),Signature)
theSig.DocumentSecurityStorePolicy = Signature.RevocationCheckingPolicy.PreferOCSP
Dim formOp As FormOperation = New FormOperation(doc)
formOp.AddLongTermValidation(theSig, Nothing, Nothing)
doc.Save("LTVSignedDoc.pdf")