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