Public Member Functions | |
DcmSignature () | |
default constructor | |
virtual | ~DcmSignature () |
destructor | |
void | attach (DcmItem *dataset) |
attaches a DICOM dataset or item to the signature object. | |
void | detach () |
detaches an attached DICOM dataset from the signature object. | |
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. | |
unsigned long | numberOfSignatures () |
returns the number of signatures in the dataset. | |
OFCondition | removeSignature (unsigned long i) |
removes a signature from the dataset. | |
OFCondition | selectSignature (unsigned long i) |
selects one of the digital signatures from the attached dataset for reading. | |
OFCondition | verifyCurrent () |
verifies the current signature. | |
OFCondition | getCurrentMacID (Uint16 &macID) |
returns the MAC ID of the current signature. | |
OFCondition | getCurrentMacXferSyntaxName (OFString &str) |
returns the MAC Calculation Transfer Syntax of the current signature. | |
OFCondition | getCurrentMacName (OFString &str) |
returns the MAC Algorithm Name of the current signature. | |
OFCondition | getCurrentSignatureUID (OFString &str) |
returns the Digital Signature UID of the current signature. | |
OFCondition | getCurrentSignatureDateTime (OFString &str) |
returns the Signature Date/Time of the current signature. | |
OFCondition | getCurrentDataElementsSigned (DcmAttributeTag &desig) |
returns the Data Elements Signed attribute of the current signature if present. | |
SiCertificate * | getCurrentCertificate () |
returns the certificate of the current signature if present. | |
void | setDumpFile (FILE *f) |
dump all data that is fed into the MAC algorithm into the given file, which must be opened and closed by caller. | |
Static Public Member Functions | |
static void | initializeLibrary () |
initializes the dcmsign library including the underlying OpenSSL library. | |
static DcmItem * | findFirstSignatureItem (DcmItem &item, DcmStack &stack) |
recursively browses through the given dataset and searches the first occurence of the DigitalSignaturesSequence. | |
static DcmItem * | findNextSignatureItem (DcmItem &item, DcmStack &stack) |
recursively browses through the given dataset and searches the next occurence of the DigitalSignaturesSequence. | |
Private Member Functions | |
DcmSignature (DcmSignature &arg) | |
private undefined copy constructor | |
DcmSignature & | operator= (DcmSignature &arg) |
private undefined copy assignment operator | |
void | deselect () |
removes the selection of a current signature if present | |
OFCondition | allocateMACID (Uint16 &newID) |
allocates a new mac ID number for a new signature. | |
Static Private Member Functions | |
static Uint16 | getMACIDnumber (DcmItem &item) |
searches a given item for the DCM_MACIDnumber element and returns its value if present, otherwise returns 0. | |
static void | currentDateTime (OFString &str) |
returns the current date and time as a DICOM DT string. | |
Private Attributes | |
DcmItem * | currentItem |
pointer to current item if attached, NULL otherwise | |
DcmSequenceOfItems * | macParametersSq |
pointer to mac parameters sequence of attached item, may be NULL if not attached or not yet present | |
DcmSequenceOfItems * | signatureSq |
pointer to digital signatures sequence of attached item, may be NULL if not attached or not yet present | |
FILE * | dumpFile |
if nonzero, the data fed to the MAC algorithm is also stored in this file. | |
DcmItem * | selectedSignatureItem |
pointer to currently selected signature item | |
DcmItem * | selectedMacParametersItem |
pointer to currently selected mac parameters item | |
SiCertificate * | selectedCertificate |
pointer to certificate for currently selected signature item |
The methods in this class do not handle digital signatures embedded in sequence items within the dataset, other than providing helper functions that allow to locate and attach the sub-items separately.
Definition at line 64 of file dcsignat.h.
|
allocates a new mac ID number for a new signature. examines all mac ID numbers in the digital signatures sequence and in the mac parameters sequence and returns an unused number.
|
|
attaches a DICOM dataset or item to the signature object. The dataset is detached by a call to detach() or by destruction of the signature object. This object may modify but never deletes an attached dataset.
|
|
creates a new digital signature in the current dataset. Checks whether private and public key match and whether all requirements of the given security profile are fulfilled.
|
|
returns the current date and time as a DICOM DT string.
|
|
recursively browses through the given dataset and searches the first occurence of the DigitalSignaturesSequence. If found, returns a pointer to the Item in which the sequence is contained.
|
|
recursively browses through the given dataset and searches the next occurence of the DigitalSignaturesSequence. If found, returns a pointer to the Item in which the sequence is contained.
|
|
returns the certificate of the current signature if present. Current signature must be selected with selectSignature(). May return NULL if certificate is unavailable.
|
|
returns the Data Elements Signed attribute of the current signature if present. Current signature must be selected with selectSignature(). If a valid signature is selected but the signature does not contain the Data Elements Signed element (i.e. all attributes are signed), this method returns an error code.
|
|
returns the MAC ID of the current signature. Current signature must be selected with selectSignature().
|
|
returns the MAC Algorithm Name of the current signature. Current signature must be selected with selectSignature().
|
|
returns the MAC Calculation Transfer Syntax of the current signature. If the transfer syntax is well-known, the UID is replaced by the transfer syntax name preceded by '='. Current signature must be selected with selectSignature().
|
|
returns the Signature Date/Time of the current signature. Current signature must be selected with selectSignature().
|
|
returns the Digital Signature UID of the current signature. Current signature must be selected with selectSignature().
|
|
searches a given item for the DCM_MACIDnumber element and returns its value if present, otherwise returns 0.
|
|
initializes the dcmsign library including the underlying OpenSSL library. this method should be called by main() before any object of the dcmsign library is created or used. |
|
returns the number of signatures in the dataset. Does not count signatures embedded in sequence items within the dataset. |
|
removes a signature from the dataset.
|
|
selects one of the digital signatures from the attached dataset for reading.
|
|
dump all data that is fed into the MAC algorithm into the given file, which must be opened and closed by caller.
|
|
verifies the current signature. Current signature must be selected with selectSignature().
|