OFFIS DCMTK  Version 3.6.0
simaccon.h
1 /*
2  *
3  * Copyright (C) 1998-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmsign
15  *
16  * Author: Marco Eichelberg
17  *
18  * Purpose:
19  * classes: SiMACConstructor
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:17:25 $
23  * CVS/RCS Revision: $Revision: 1.10 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef SIMACCON_H
31 #define SIMACCON_H
32 
33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/dcmsign/sitypes.h"
35 
36 #ifdef WITH_OPENSSL
37 
38 #include "dcmtk/dcmdata/dcostrmb.h" /* for DcmOutputBufferStream */
39 #include "dcmtk/dcmdata/dcxfer.h" /* for E_TransferSyntax */
40 #include "dcmtk/dcmdata/dcdeftag.h"
41 
42 #define INCLUDE_CSTDIO
43 #include "dcmtk/ofstd/ofstdinc.h"
44 
45 class SiMAC;
46 class DcmItem;
47 class DcmElement;
48 class DcmAttributeTag;
49 
53 {
54 public:
55 
58 
60  virtual ~SiMACConstructor();
61 
87  DcmItem& item,
88  SiMAC& mac,
89  E_TransferSyntax oxfer,
90  DcmAttributeTag &tagListOut,
91  DcmAttributeTag *tagListIn = NULL);
92 
108  DcmItem& signatureItem,
109  SiMAC& mac,
110  E_TransferSyntax oxfer);
111 
116  OFCondition flush(SiMAC& mac);
117 
122  void setDumpFile(FILE *f);
123 
124 private:
125 
128 
131 
137 
145  OFCondition encodeElement(DcmElement *element, SiMAC& mac, E_TransferSyntax oxfer);
146 
155  static OFBool inTagList(const DcmElement *element, DcmAttributeTag *tagList);
156 
158  unsigned char *buf;
159 
162 
166  FILE *dumpFile;
167 };
168 
169 
170 #endif
171 #endif
172 
173 /*
174  * $Log: simaccon.h,v $
175  * Revision 1.10 2010-10-14 13:17:25 joergr
176  * Updated copyright header. Added reference to COPYRIGHT file.
177  *
178  * Revision 1.9 2005-12-08 16:04:38 meichel
179  * Changed include path schema for all DCMTK header files
180  *
181  * Revision 1.8 2003/06/04 14:21:03 meichel
182  * Simplified include structure to avoid preprocessor limitation
183  * (max 32 #if levels) on MSVC5 with STL.
184  *
185  * Revision 1.7 2002/11/27 14:53:40 meichel
186  * Adapted module dcmsign to use of new header file ofstdinc.h
187  *
188  * Revision 1.6 2002/08/27 17:21:00 meichel
189  * Initial release of new DICOM I/O stream classes that add support for stream
190  * compression (deflated little endian explicit VR transfer syntax)
191  *
192  * Revision 1.5 2001/12/10 16:40:46 meichel
193  * Fixed warnings from Sun CC 4.2
194  *
195  * Revision 1.4 2001/11/16 15:50:50 meichel
196  * Adapted digital signature code to final text of supplement 41.
197  *
198  * Revision 1.3 2001/09/26 14:30:20 meichel
199  * Adapted dcmsign to class OFCondition
200  *
201  * Revision 1.2 2001/06/01 15:50:49 meichel
202  * Updated copyright header
203  *
204  * Revision 1.1 2000/11/07 16:48:55 meichel
205  * Initial release of dcmsign module for DICOM Digital Signatures
206  *
207  *
208  */
209 
a class representing a list of DICOM elements in which each element has a different tag and elements ...
Definition: dcitem.h:51
abstract base class for all DICOM elements
Definition: dcelem.h:45
a class that allows to feed selected parts of a DICOM dataset into the MAC generation code ...
Definition: simaccon.h:52
virtual ~SiMACConstructor()
destructor
OFCondition encodeElement(DcmElement *element, SiMAC &mac, E_TransferSyntax oxfer)
feeds a DcmElement into the MAC data stream if is signable.
output stream that writes into a buffer of fixed length which must be provided by the caller...
Definition: dcostrmb.h:129
FILE * dumpFile
if nonzero, the data fed to the MAC algorithm is also stored in this file.
Definition: simaccon.h:166
OFCondition encodeDataset(DcmItem &item, SiMAC &mac, E_TransferSyntax oxfer, DcmAttributeTag &tagListOut, DcmAttributeTag *tagListIn=NULL)
encodes a DICOM dataset (or parts of it) as a byte stream in the format required for DICOM digital si...
OFCondition flush(SiMAC &mac)
flushes all buffers inside this object, finalizing the MAC code
SiMACConstructor & operator=(SiMACConstructor &arg)
private undefined copy assignment operator
static OFBool inTagList(const DcmElement *element, DcmAttributeTag *tagList)
checks whether the attribute tag of the given DcmElement is contained in the given list of tags...
void setDumpFile(FILE *f)
dump all data that is fed into the MAC algorithm into the given file, which must be opened and closed...
unsigned char * buf
the buffer to which data is written
Definition: simaccon.h:158
a base class for all classes that implement hash functions.
Definition: simac.h:41
OFCondition encodeDigitalSignatureItem(DcmItem &signatureItem, SiMAC &mac, E_TransferSyntax oxfer)
encodes the contents of the digital signature sequence except CertificateOfSigner, Signature, CertifiedTimestampType and CertifiedTimestamp as a byte stream in the format required for DICOM digital signatures and feeds the byte stream into the given MAC codec.
OFCondition flushBuffer(SiMAC &mac)
flushes the internal buffer to the given MAC and to dumpFile if open
SiMACConstructor()
constructor
DcmOutputBufferStream stream
the internal buffer stream
Definition: simaccon.h:161
General purpose class for condition codes.
Definition: ofcond.h:305
a class representing the DICOM value representation 'Attribute Tag' (AT)
Definition: dcvrat.h:40


Generated on Wed Jan 4 2017 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.6