DCMTK Version 3.6.8
OFFIS DICOM Toolkit
Public Member Functions | Private Attributes | List of all members
SiTimeStampFS Class Reference

timestamp client based on filesystem interactions. More...

+ Inheritance diagram for SiTimeStampFS:

Public Member Functions

 SiTimeStampFS ()
 default constructor
 
virtual ~SiTimeStampFS ()
 destructor
 
virtual OFCondition stamp (const unsigned char *inputData, unsigned long inputDataSize)
 takes a block of raw data, creates a time stamp query for a hash of this raw data, and stores it locally in this object. More...
 
virtual OFCondition write (DcmItem &item)
 writes the time stamp query created with SiTimeStampFS::stamp() to a file. More...
 
virtual void setTSQFilename (const char *fname)
 set the time stamp query filename to be written More...
 
virtual void setTSRFilename (const char *fname)
 set the time stamp response filename to be read More...
 
virtual void setUIDFilename (const char *fname)
 set the uid file filename to be written More...
 
virtual OFCondition getUIDFromFile (OFString &uid)
 load UID file and retrieve digital signature UID More...
 
virtual OFCondition load_ts_query_from_file ()
 load timestamp query from file More...
 
virtual OFCondition load_ts_response_from_file ()
 load timestamp response from file More...
 
virtual OFCondition check_ts_response (DcmItem &ditem)
 check consistency between timestamp query (if available), timestamp response and DICOM digital signature. More...
 
virtual OFCondition write_ts_token (DcmItem &ditem)
 insert timestamp token into DICOM dataset The response file must have been loaded and checked prior to this method call. More...
 
- Public Member Functions inherited from SiTimeStamp
 SiTimeStamp ()
 default constructor
 
virtual ~SiTimeStamp ()
 destructor
 
virtual OFCondition stamp (const unsigned char *inputData, unsigned long inputDataSize)=0
 takes a block of raw data and requests a time stamp for this raw data. More...
 
virtual OFCondition read (DcmItem &item)
 reads the current timestamp from an item of the Digital Signatures Sequence and creates a timestamp ticket object. More...
 
virtual OFCondition write (DcmItem &item)=0
 writes the current timestamp into an item of the Digital Signatures Sequence and creates the timestamp type information in the item. More...
 
virtual void setPolicyOID (const char *oid)
 set the requested policy OID to be included into the time stamp query More...
 
virtual void setNonce (OFBool nonce)
 sets the flag controlling whether or not a nonce is included into the timestamp query. More...
 
virtual void setCertificateRequested (OFBool creq)
 sets the flag controlling whether the timestamp authority will be requested to include its certificate into the timestamp reply. More...
 
virtual void setMAC (E_MACType mac)
 sets the message authentication code to be used for creating the hash value in the timestamp query. More...
 
virtual OFBool have_tsinfo () const
 checks if this object contains a timestamp ticket info object More...
 
virtual long get_tsinfo_version () const
 returns the timestamp ticket info version number More...
 
virtual void get_tsinfo_policy_oid (OFString &oid) const
 returns the timestamp ticket info policy OID More...
 
virtual void get_tsinfo_imprint_algorithm_name (OFString &mac) const
 returns the timestamp ticket info MAC algorithm name More...
 
virtual void get_tsinfo_serial_number (OFString &serial) const
 returns the timestamp ticket info serial number More...
 
virtual void get_tsinfo_nonce (OFString &nonce) const
 returns the timestamp ticket info nonce, if present More...
 
virtual void get_tsinfo_tsa_name (OFString &tsa) const
 returns the timestamp ticket info timestamp authority (TSA) name, if present More...
 
virtual OFBool get_tsinfo_ordering () const
 returns the timestamp ticket info ordering flag More...
 
virtual void get_tsinfo_accuracy (OFString &accuracy) const
 returns the timestamp ticket info accuracy, if present More...
 
virtual void get_tsinfo_timestamp (OFString &ts) const
 returns the timestamp date/time information, if present More...
 
virtual int get_tsinfo_numextensions () const
 returns the number of extensions in the timestamp ticket More...
 
virtual void get_tsinfo_extension (OFString &ext, int idx) const
 returns one timestamp extension, if present More...
 
virtual OFCondition verifyTSSignature (SiCertificateVerifier &cv)
 this method performs the following functions: More...
 
virtual OFCondition verifyTSToken (SiCertificateVerifier &cv, DcmItem &ditem, SiCertificate &cert)
 Verify the timestamp token by checking that its imprint is indeed a hash of the DICOM signature, that the version number is as expected and that the TSA name, if provided in the timestamp ticket structure, matches the name of the TSA given in the TSA certificate. More...
 
void lastError (OFString &err) const
 returns an error string containing a textual description of the result of the last call to verifyTSSignature() or verifyTSToken() if that call returned SI_EC_TimestampSignatureVerificationFailed. More...
 

Private Attributes

OFString tsqFilename_
 filename of the timestamp query file to be written
 
OFString tsrFilename_
 filename of the timestamp response file to be read
 
OFString uidFilename_
 filename of the UID file to be written
 

Additional Inherited Members

- Protected Member Functions inherited from SiTimeStamp
virtual OFCondition create_ts_query (const unsigned char *inputData, unsigned long inputDataSize)
 takes a block of raw data, computes a message digest and creates a time stamp query object. More...
 
virtual TS_REQ * getTSQ ()
 return pointer to timestamp query object, may be NULL. More...
 
virtual TS_RESP * getTSR ()
 return pointer to timestamp response object, may be NULL. More...
 
virtual PKCS7 * getTS ()
 return pointer to timestamp ticket object, may be NULL. More...
 
virtual TS_TST_INFO * getTSInfo ()
 return pointer to timestamp ticket info object, may be NULL. More...
 
virtual OFCondition load_ts_query (const char *fname)
 load timestamp query from file More...
 
virtual OFCondition load_ts_response (const char *fname)
 load timestamp response from file More...
 
- Static Protected Member Functions inherited from SiTimeStamp
static OFCondition check_ts_response (TS_REQ *tsq, TS_RESP *tsr, DcmItem &ditem)
 check consistency between timestamp query (if available), timestamp response and DICOM digital signature. More...
 
static OFCondition write_ts_token (TS_RESP *tsr, DcmItem &ditem)
 insert timestamp token into DICOM dataset The timestamp response must have been checked prior to this method call. More...
 

Detailed Description

timestamp client based on filesystem interactions.

This timestamp client will write a timestamp query in DES encoding to file. The interaction with the time stamp authority must then take place separately (e.g. manually, using a command line tool like curl). This client then offers functionality to import a timestamp response (i.e. a timestamp) from file and place it into the signed DICOM file for which the timestamp was requested.

Remarks
this class is only available if DCMTK is compiled with OpenSSL support enabled.

Member Function Documentation

◆ check_ts_response()

virtual OFCondition SiTimeStampFS::check_ts_response ( DcmItem ditem)
virtual

check consistency between timestamp query (if available), timestamp response and DICOM digital signature.

Query and response files must have been loaded prior to this method call.

Parameters
ditemitem of the DigitalSignaturesSequence to which this timestamp belongs
Returns
status code

◆ getUIDFromFile()

virtual OFCondition SiTimeStampFS::getUIDFromFile ( OFString uid)
virtual

load UID file and retrieve digital signature UID

Parameters
uiddigital signature returned in this parameter if successful
Returns
EC_Normal if successful, an error code otherwise.

◆ load_ts_query_from_file()

virtual OFCondition SiTimeStampFS::load_ts_query_from_file ( )
virtual

load timestamp query from file

Returns
status code

◆ load_ts_response_from_file()

virtual OFCondition SiTimeStampFS::load_ts_response_from_file ( )
virtual

load timestamp response from file

Returns
status code

◆ setTSQFilename()

virtual void SiTimeStampFS::setTSQFilename ( const char *  fname)
virtual

set the time stamp query filename to be written

Parameters
fnamefilename

◆ setTSRFilename()

virtual void SiTimeStampFS::setTSRFilename ( const char *  fname)
virtual

set the time stamp response filename to be read

Parameters
fnamefilename

◆ setUIDFilename()

virtual void SiTimeStampFS::setUIDFilename ( const char *  fname)
virtual

set the uid file filename to be written

Parameters
fnamefilename

◆ stamp()

virtual OFCondition SiTimeStampFS::stamp ( const unsigned char *  inputData,
unsigned long  inputDataSize 
)
virtual

takes a block of raw data, creates a time stamp query for a hash of this raw data, and stores it locally in this object.

Parameters
inputDatapointer to raw data
inputDataSizelength of raw data block in bytes
Returns
status code

Implements SiTimeStamp.

◆ write()

virtual OFCondition SiTimeStampFS::write ( DcmItem item)
virtual

writes the time stamp query created with SiTimeStampFS::stamp() to a file.

Also writes a "UID file" that contains the Digital Signature UID of the signature to which the timestamp request belongs. This file will be read later by the import function. The filenames of timestamp query file and UID file must be set prior to calling this method.

Parameters
itemitem of the DigitalSignatureSQ to which the timestamp is written
Returns
dcmdata OFCondition status code

Implements SiTimeStamp.

◆ write_ts_token()

virtual OFCondition SiTimeStampFS::write_ts_token ( DcmItem ditem)
virtual

insert timestamp token into DICOM dataset The response file must have been loaded and checked prior to this method call.

Parameters
ditemitem of the DigitalSignaturesSequence to which this timestamp is written
Returns
status code

The documentation for this class was generated from the following file:


Generated on Tue Dec 19 2023 for DCMTK Version 3.6.8 by Doxygen 1.9.4