This module contains classes to create digital signatures in DICOM data sets, to verify and to remove signatures. Signatures are conforming to the DICOM "Digital
Signatures" extension (formerly Supplement 41). This module requires the external OpenSSL library.
The main interface classes are:
Tools
This module contains the following command line tool:
Examples
The following example shows how to verify all signatures in a DICOM file:
{
int counter = 0;
int corrupt_counter = 0;
while (sigItem)
{
{
{
++counter;
corrupt_counter++;
}
}
}
if (counter == 0)
cerr << "no signatures found in dataset." << endl;
else
cerr << counter << " signatures verified in dataset, "
<< corrupt_counter << " corrupted." << endl;
}
a class handling the DICOM dataset format (files without meta header)
Definition: dcdatset.h:42
a class representing a list of DICOM elements in which each element has a different tag and elements ...
Definition: dcitem.h:48
this class provides the main interface to the dcmsign module - it allows to create,...
Definition: dcsignat.h:56
static DcmItem * findNextSignatureItem(DcmItem &item, DcmStack &stack)
recursively browses through the given dataset and searches the next occurence of the DigitalSignature...
unsigned long numberOfSignatures()
returns the number of signatures in the dataset.
OFCondition verifyCurrent()
verifies the current signature.
OFCondition selectSignature(unsigned long i)
selects one of the digital signatures from the attached dataset for reading.
void attach(DcmItem *dataset)
attaches a DICOM dataset or item to the signature object.
static DcmItem * findFirstSignatureItem(DcmItem &item, DcmStack &stack)
recursively browses through the given dataset and searches the first occurence of the DigitalSignatur...
void detach()
detaches an attached DICOM dataset from the signature object.
this class manages a stack of pointers to DcmObject instances.
Definition: dcstack.h:72
OFBool bad() const
check if the status is not OK, i.e. error or failure.
Definition: ofcond.h:305
OFBool good() const
check if the status is OK.
Definition: ofcond.h:296
The following example shows how to sign a DICOM file:
{
{
cerr << "unable to load certificate" << endl;
return;
}
{
cerr << "unable to load private key" << endl;
return;
}
{
}
}
OFCondition createSignature(SiPrivateKey &key, SiCertificate &cert, SiMAC &mac, SiSecurityProfile &profile, E_TransferSyntax xfer=EXS_LittleEndianExplicit, const DcmAttributeTag *tagList=NULL, SiTimeStamp *timeStamp=NULL)
creates a new digital signature in the current dataset.
a class representing X.509 public key certificates.
Definition: sicert.h:43
OFCondition loadCertificate(const char *filename, int filetype)
loads an X.509 certificate from file.
Creator RSA Digital Signature Profile.
Definition: sicreapr.h:36
a class representing a private key.
Definition: siprivat.h:44
OFCondition loadPrivateKey(const char *filename, int filetype)
loads a private key from file.
a class implementing the hash function RIPEMD160
Definition: siripemd.h:41