EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Office documents signature validation

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#23233
Posted: 01/17/2013 06:05:04
by ingbabic  (Standard support level)
Joined: 09/27/2011
Posts: 114

Hello
How can I get signature type when validating office document (whether is XAdES-EPES, or XAdES-T, for example.) and how to get information whether is document timestamped (TSA and signing time)? Using TElOfficeOpenXMLSignatureHandler I can generate different kind of signatures (including timestamped ones), but how to get that info back when I am validating a document.
#23240
Posted: 01/17/2013 06:32:53
by Dmytro Bogatskyy (EldoS Corp.)

Quote

I can generate different kind of signatures (including timestamped ones), but how to get that info back when I am validating a document.

After validating a signature, you can use XAdESProcessor property to retrieve XAdES info, for example:
Code
TElOfficeOpenXMLBaseSignatureHandler OpenXMLHandler = ...
if ((OpenXMLHandler.XAdESProcessor is TElXAdESVerifier) && ((TElXAdESVerifier)OpenXMLHandler.XAdESProcessor).IsEnabled)
{
  TElXAdESVerifier XAdESVerifier = (TElXAdESVerifier)OpenXMLHandler.XAdESProcessor;

  s = "Signing Time: ";
  if (XAdESVerifier.SigningTime != DateTime.MinValue)
    s += XAdESVerifier.SigningTime.ToString() + " UTC";
  else
    s += "none";

  // and etc...
  // for the sample, please, see implementation in XMLBlackbox/AdvancedSigner/XAdESInfoForm.cs
  // and in AdvancedSigner/MainForm.cs in ValidateSignature method validation of XAdESVerifier
}
#23242
Posted: 01/17/2013 06:59:16
by ingbabic  (Standard support level)
Joined: 09/27/2011
Posts: 114

Cool :). I did not know that I can cast TElXAdESProcessor to TElXAdESVerifier in case it is XAdES signed.
Thank you Dmytro.

Reply

Statistics

Topic viewed 545 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!