GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

gdcmCryptographicMessageSyntax.h
Go to the documentation of this file.
1 /*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13 =========================================================================*/
14 #ifndef GDCMCRYPTOGRAPHICMESSAGESYNTAX_H
15 #define GDCMCRYPTOGRAPHICMESSAGESYNTAX_H
16
17 #include "gdcmTypes.h"
18
19 namespace gdcm
20 {
21 class CryptographicMessageSyntaxInternals;
22 //-----------------------------------------------------------------------------
23
33 class GDCM_EXPORT CryptographicMessageSyntax
34 {
35 public :
36 CryptographicMessageSyntax();
37 ~CryptographicMessageSyntax();
38
39 // X.509
40 bool ParseCertificateFile( const char *filename );
41 bool ParseKeyFile( const char *filename );
42
43 typedef enum {
44 DES_CIPHER, // DES
45 DES3_CIPHER, // Triple DES
46 AES128_CIPHER, // CBC AES
47 AES192_CIPHER, // ' '
48 AES256_CIPHER // ' '
49 } CipherTypes;
50
53 void SetCipherType(CipherTypes type);
54 CipherTypes GetCipherType() const;
55
57 bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const;
58
60 bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const;
61
62 private:
63 CryptographicMessageSyntaxInternals *Internals;
64 private:
65 CryptographicMessageSyntax(const CryptographicMessageSyntax&); // Not implemented.
66 void operator=(const CryptographicMessageSyntax&); // Not implemented.
67 };
68 } // end namespace gdcm
69 //-----------------------------------------------------------------------------
70 #endif //GDCMCRYPTOGRAPHICMESSAGESYNTAX_H