OFFIS DCMTK  Version 3.6.0
sicert.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
17  *
18  * Purpose:
19  * classes: SiCertificate
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:17:24 $
23  * CVS/RCS Revision: $Revision: 1.8 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef SICERT_H
31 #define SICERT_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" /* for class OFString */
39 
40 class DcmItem;
41 class SiAlgorithm;
42 struct x509_st;
43 typedef struct x509_st X509;
44 
48 {
49 public:
50 
52  SiCertificate();
53 
55  virtual ~SiCertificate();
56 
62  OFCondition loadCertificate(const char *filename, int filetype);
63 
69  OFCondition read(DcmItem& item);
70 
76  OFCondition write(DcmItem& item);
77 
80  E_KeyType getKeyType();
81 
88 
93  long getX509Version();
94 
99  void getCertSubjectName(OFString& str);
100 
105  void getCertIssuerName(OFString& str);
106 
111  long getCertSerialNo();
112 
118 
124 
130  long getCertKeyBits();
131 
135  X509 *getRawCertificate();
136 
137 private:
138 
141 
144 
146  X509* x509;
147 
148 };
149 
150 #endif
151 #endif
152 
153 /*
154  * $Log: sicert.h,v $
155  * Revision 1.8 2010-10-14 13:17:24 joergr
156  * Updated copyright header. Added reference to COPYRIGHT file.
157  *
158  * Revision 1.7 2010-02-22 11:39:54 uli
159  * Remove some unneeded includes.
160  *
161  * Revision 1.6 2005-12-08 16:04:33 meichel
162  * Changed include path schema for all DCMTK header files
163  *
164  * Revision 1.5 2003/07/04 13:28:13 meichel
165  * Replaced forward declarations for OFString with explicit includes,
166  * needed when compiling with HAVE_STD_STRING
167  *
168  * Revision 1.4 2003/06/04 14:21:03 meichel
169  * Simplified include structure to avoid preprocessor limitation
170  * (max 32 #if levels) on MSVC5 with STL.
171  *
172  * Revision 1.3 2001/09/26 14:30:19 meichel
173  * Adapted dcmsign to class OFCondition
174  *
175  * Revision 1.2 2001/06/01 15:50:47 meichel
176  * Updated copyright header
177  *
178  * Revision 1.1 2000/11/07 16:48:53 meichel
179  * Initial release of dcmsign module for DICOM Digital Signatures
180  *
181  *
182  */
183 
a class representing a list of DICOM elements in which each element has a different tag and elements ...
Definition: dcitem.h:51
void getCertIssuerName(OFString &str)
returns the issuer name (distinguished name) of the current certificate.
long getX509Version()
returns the format version of the X.509 certificate.
X509 * getRawCertificate()
returns a pointer to the raw certificate structure or NULL if no certificate present.
SiCertificate()
default constructor
SiAlgorithm * createAlgorithmForPublicKey()
creates an SiAlgorithm object for the public key contained in this certificate.
OFCondition loadCertificate(const char *filename, int filetype)
loads an X.509 certificate from file.
E_KeyType getKeyType()
returns the type of public key stored in this certificate
virtual ~SiCertificate()
destructor
void getCertValidityNotAfter(OFString &str)
returns the end of validity of the current certificate in human readable form.
a class representing X.509 public key certificates.
Definition: sicert.h:47
SiCertificate & operator=(SiCertificate &arg)
private undefined copy assignment operator
void getCertValidityNotBefore(OFString &str)
returns the start of validity of the current certificate in human readable form.
X509 * x509
OpenSSL X.509 structure.
Definition: sicert.h:146
OFCondition write(DcmItem &item)
writes the current X.509 certificate into an item of the Digital Signatures Sequence and creates the ...
pure virtual base class of the public key crypto systems used for signature creation and verification...
Definition: sialgo.h:46
long getCertSerialNo()
returns the serial number of the X.509 certificate.
OFCondition read(DcmItem &item)
reads an X.509 certificate from an item of the Digital Signatures Sequence and checks the certificate...
a simple string class that implements a subset of std::string.
Definition: ofstring.h:86
void getCertSubjectName(OFString &str)
returns the subject name (distinguished name) of the current certificate.
long getCertKeyBits()
returns the strength (number of bits) of the public key contained in the current certificate.
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Wed Jan 4 2017 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.6