OFFIS DCMTK  Version 3.6.0
siprivat.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: Norbert Loxen, Marco Eichelberg
17  *
18  * Purpose:
19  * classes: SiPrivateKey
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:17:25 $
23  * CVS/RCS Revision: $Revision: 1.6 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef SIPRIVAT_H
31 #define SIPRIVAT_H
32 
33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/dcmsign/sitypes.h"
35 
36 #ifdef WITH_OPENSSL
37 
38 #include "dcmtk/ofstd/ofstring.h"
39 
40 class SiAlgorithm;
41 class SiCertificate;
42 struct evp_pkey_st;
43 typedef struct evp_pkey_st EVP_PKEY;
44 
45 
49 {
50 public:
52  SiPrivateKey();
53 
55  virtual ~SiPrivateKey();
56 
63  void setPrivateKeyPasswd(const char *thePasswd);
64 
69 
77  OFCondition loadPrivateKey(const char *filename, int filetype);
78 
81  E_KeyType getKeyType() const;
82 
89 
94  OFBool matchesCertificate(SiCertificate& cert);
95 
96 private:
97 
100 
103 
106 
109 
111  EVP_PKEY* pkey;
112 
113 };
114 
115 #endif
116 #endif
117 
118 /*
119  * $Log: siprivat.h,v $
120  * Revision 1.6 2010-10-14 13:17:25 joergr
121  * Updated copyright header. Added reference to COPYRIGHT file.
122  *
123  * Revision 1.5 2005-12-08 16:04:41 meichel
124  * Changed include path schema for all DCMTK header files
125  *
126  * Revision 1.4 2003/06/04 14:21:03 meichel
127  * Simplified include structure to avoid preprocessor limitation
128  * (max 32 #if levels) on MSVC5 with STL.
129  *
130  * Revision 1.3 2001/09/26 14:30:21 meichel
131  * Adapted dcmsign to class OFCondition
132  *
133  * Revision 1.2 2001/06/01 15:50:50 meichel
134  * Updated copyright header
135  *
136  * Revision 1.1 2000/11/07 16:48:57 meichel
137  * Initial release of dcmsign module for DICOM Digital Signatures
138  *
139  *
140  */
141 
OFString privateKeyPasswd
contains the password for the private key if set on command line
Definition: siprivat.h:105
virtual ~SiPrivateKey()
destructor
OFBool usePrivateKeyPassword
true if the privateKeyPasswd contains the password, false otherwise.
Definition: siprivat.h:108
SiAlgorithm * createAlgorithmForPrivateKey()
creates an SiAlgorithm object for the private key contained in this certificate.
SiPrivateKey()
default constructor
a class representing X.509 public key certificates.
Definition: sicert.h:47
EVP_PKEY * pkey
the private key managed by this object, may be NULL if not loaded yet
Definition: siprivat.h:111
OFCondition loadPrivateKey(const char *filename, int filetype)
loads a private key from file.
a class representing a private key.
Definition: siprivat.h:48
pure virtual base class of the public key crypto systems used for signature creation and verification...
Definition: sialgo.h:46
void setPrivateKeyPasswdFromConsole()
sets the password string to be used when loading an encrypted private key file to be read from the co...
OFBool matchesCertificate(SiCertificate &cert)
checks if the private key and the certificate set using setPrivateKeyFile() and setCertificateFile() ...
SiPrivateKey & operator=(SiPrivateKey &arg)
private undefined copy assignment operator
a simple string class that implements a subset of std::string.
Definition: ofstring.h:86
void setPrivateKeyPasswd(const char *thePasswd)
sets the password string to be used when loading an encrypted private key file in PEM format (ASN...
E_KeyType getKeyType() const
returns the type of public key stored in this certificate
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Wed Dec 28 2016 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.8