00001 /* 00002 * 00003 * Copyright (C) 1998-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmsign 00019 * 00020 * Author: Norbert Loxen, Marco Eichelberg 00021 * 00022 * Purpose: 00023 * classes: SiPrivateKey 00024 * 00025 * Last Update: $Author: meichel $ 00026 * Update Date: $Date: 2005/12/08 16:04:41 $ 00027 * CVS/RCS Revision: $Revision: 1.5 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef SIPRIVAT_H 00035 #define SIPRIVAT_H 00036 00037 #include "dcmtk/config/osconfig.h" 00038 #include "dcmtk/dcmsign/sitypes.h" 00039 00040 #ifdef WITH_OPENSSL 00041 00042 #include "dcmtk/ofstd/ofstring.h" 00043 00044 class SiAlgorithm; 00045 class SiCertificate; 00046 struct evp_pkey_st; 00047 typedef struct evp_pkey_st EVP_PKEY; 00048 00049 00052 class SiPrivateKey 00053 { 00054 public: 00056 SiPrivateKey(); 00057 00059 virtual ~SiPrivateKey(); 00060 00067 void setPrivateKeyPasswd(const char *thePasswd); 00068 00072 void setPrivateKeyPasswdFromConsole(); 00073 00081 OFCondition loadPrivateKey(const char *filename, int filetype); 00082 00085 E_KeyType getKeyType() const; 00086 00092 SiAlgorithm *createAlgorithmForPrivateKey(); 00093 00098 OFBool matchesCertificate(SiCertificate& cert); 00099 00100 private: 00101 00103 SiPrivateKey(SiPrivateKey& arg); 00104 00106 SiPrivateKey& operator=(SiPrivateKey& arg); 00107 00109 OFString privateKeyPasswd; 00110 00112 OFBool usePrivateKeyPassword; 00113 00115 EVP_PKEY* pkey; 00116 00117 }; 00118 00119 #endif 00120 #endif 00121 00122 /* 00123 * $Log: siprivat.h,v $ 00124 * Revision 1.5 2005/12/08 16:04:41 meichel 00125 * Changed include path schema for all DCMTK header files 00126 * 00127 * Revision 1.4 2003/06/04 14:21:03 meichel 00128 * Simplified include structure to avoid preprocessor limitation 00129 * (max 32 #if levels) on MSVC5 with STL. 00130 * 00131 * Revision 1.3 2001/09/26 14:30:21 meichel 00132 * Adapted dcmsign to class OFCondition 00133 * 00134 * Revision 1.2 2001/06/01 15:50:50 meichel 00135 * Updated copyright header 00136 * 00137 * Revision 1.1 2000/11/07 16:48:57 meichel 00138 * Initial release of dcmsign module for DICOM Digital Signatures 00139 * 00140 * 00141 */ 00142