dcmsign/include/dcmtk/dcmsign/siprivat.h

00001 /*
00002  *
00003  *  Copyright (C) 1998-2010, OFFIS e.V.
00004  *  All rights reserved.  See COPYRIGHT file for details.
00005  *
00006  *  This software and supporting documentation were developed by
00007  *
00008  *    OFFIS e.V.
00009  *    R&D Division Health
00010  *    Escherweg 2
00011  *    D-26121 Oldenburg, Germany
00012  *
00013  *
00014  *  Module: dcmsign
00015  *
00016  *  Author: Norbert Loxen, Marco Eichelberg
00017  *
00018  *  Purpose:
00019  *    classes: SiPrivateKey
00020  *
00021  *  Last Update:      $Author: joergr $
00022  *  Update Date:      $Date: 2010-10-14 13:17:25 $
00023  *  CVS/RCS Revision: $Revision: 1.6 $
00024  *  Status:           $State: Exp $
00025  *
00026  *  CVS/RCS Log at end of file
00027  *
00028  */
00029 
00030 #ifndef SIPRIVAT_H
00031 #define SIPRIVAT_H
00032 
00033 #include "dcmtk/config/osconfig.h"
00034 #include "dcmtk/dcmsign/sitypes.h"
00035 
00036 #ifdef WITH_OPENSSL
00037 
00038 #include "dcmtk/ofstd/ofstring.h"
00039 
00040 class SiAlgorithm;
00041 class SiCertificate;
00042 struct evp_pkey_st;
00043 typedef struct evp_pkey_st EVP_PKEY;
00044 
00045 
00048 class SiPrivateKey
00049 {     
00050 public:
00052   SiPrivateKey();
00053   
00055   virtual ~SiPrivateKey();
00056 
00063   void setPrivateKeyPasswd(const char *thePasswd);
00064 
00068   void setPrivateKeyPasswdFromConsole();
00069 
00077   OFCondition loadPrivateKey(const char *filename, int filetype);
00078 
00081   E_KeyType getKeyType() const;
00082   
00088   SiAlgorithm *createAlgorithmForPrivateKey();
00089 
00094   OFBool matchesCertificate(SiCertificate& cert);
00095 
00096 private:
00097 
00099   SiPrivateKey(SiPrivateKey& arg);
00100 
00102   SiPrivateKey& operator=(SiPrivateKey& arg);
00103 
00105   OFString privateKeyPasswd;
00106 
00108   OFBool usePrivateKeyPassword;
00109 
00111   EVP_PKEY* pkey;
00112 
00113 };
00114 
00115 #endif
00116 #endif
00117 
00118 /*
00119  *  $Log: siprivat.h,v $
00120  *  Revision 1.6  2010-10-14 13:17:25  joergr
00121  *  Updated copyright header. Added reference to COPYRIGHT file.
00122  *
00123  *  Revision 1.5  2005-12-08 16:04:41  meichel
00124  *  Changed include path schema for all DCMTK header files
00125  *
00126  *  Revision 1.4  2003/06/04 14:21:03  meichel
00127  *  Simplified include structure to avoid preprocessor limitation
00128  *    (max 32 #if levels) on MSVC5 with STL.
00129  *
00130  *  Revision 1.3  2001/09/26 14:30:21  meichel
00131  *  Adapted dcmsign to class OFCondition
00132  *
00133  *  Revision 1.2  2001/06/01 15:50:50  meichel
00134  *  Updated copyright header
00135  *
00136  *  Revision 1.1  2000/11/07 16:48:57  meichel
00137  *  Initial release of dcmsign module for DICOM Digital Signatures
00138  *
00139  *
00140  */
00141 


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1