1 /*
2  *
3  *  Copyright (C) 2019, 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: SiStructuredReportingProfile
20  *
21  */
22 
23 #ifndef SISRPR_H
24 #define SISRPR_H
25 
26 #include "dcmtk/config/osconfig.h"
27 #include "dcmtk/dcmsign/sibrsapr.h"   /* for SiBaseRSAProfile */
28 
29 #ifdef WITH_OPENSSL
30 
31 /** Structured Reporting RSA Digital Signature Profile
32  *  @remark this class is only available if DCMTK is compiled with
33  *  OpenSSL support enabled.
34  */
35 class DCMTK_DCMSIGN_EXPORT SiStructuredReportingProfile: public SiBaseRSAProfile
36 {
37 public:
38 
39   /// default constructor
SiStructuredReportingProfile()40   SiStructuredReportingProfile() { }
41 
42   /// destructor
~SiStructuredReportingProfile()43   virtual ~SiStructuredReportingProfile() { }
44 
45   /** checks whether an attribute with the given tag is required to be signed
46    *  for the current security profile if the attribute is present in the dataset
47    *  @param key tag key to be checked
48    *  @return true if required, false otherwise.
49    */
50   virtual OFBool attributeRequiredIfPresent(const DcmTagKey& key) const;
51 
52   /** checks whether all attributes that are required unconditionally
53    *  to be signed in this profile are included in the given tagList.
54    *  @param taglist attribute tag list
55    *  @return true if requirements for profile are fulfilled, false otherwise.
56    */
57   virtual OFBool checkRequiredAttributeList(DcmAttributeTag& tagList) const;
58 
59   /** some digital signature profiles specify conditions under which certain
60    *  attributes must be included into the signature.
61    *  This method allows the signature profile to inspect the dataset in order
62    *  to determine whether or not the conditions are met.
63    *  This method should be called before DcmSignature::createSignature() is executed.
64    *  @param item the dataset or item to which the signature will be added
65    *  @return status code
66    */
67   virtual OFCondition inspectSignatureDataset(DcmItem &item);
68 
69   /** returns true if this signature profile only applies to main dataset level
70    *  @return OFTrue if this signature profile only applies to main dataset level, OFFalse otherwise
71    */
72   virtual OFBool mainDatasetRequired() const;
73 
74 };
75 
76 #endif
77 #endif
78