GDCM 2.0.17
|
00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 Module: $URL$ 00005 00006 Copyright (c) 2006-2010 Mathieu Malaterre 00007 All rights reserved. 00008 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 #ifndef GDCMCRYPTOGRAPHICMESSAGESYNTAX_H 00016 #define GDCMCRYPTOGRAPHICMESSAGESYNTAX_H 00017 00018 #include "gdcmTypes.h" 00019 00020 namespace gdcm 00021 { 00022 class CryptographicMessageSyntaxInternals; 00023 //----------------------------------------------------------------------------- 00024 00034 class GDCM_EXPORT CryptographicMessageSyntax 00035 { 00036 public : 00037 CryptographicMessageSyntax(); 00038 ~CryptographicMessageSyntax(); 00039 00040 // X.509 00041 bool ParseCertificateFile( const char *filename ); 00042 bool ParseKeyFile( const char *filename ); 00043 00044 typedef enum { 00045 DES_CIPHER, // DES 00046 DES3_CIPHER, // Triple DES 00047 AES128_CIPHER, // CBC AES 00048 AES192_CIPHER, // ' ' 00049 AES256_CIPHER // ' ' 00050 } CipherTypes; 00051 00054 void SetCipherType(CipherTypes type); 00055 CipherTypes GetCipherType() const; 00056 00058 bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const; 00059 00061 bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const; 00062 00063 private: 00064 CryptographicMessageSyntaxInternals *Internals; 00065 private: 00066 CryptographicMessageSyntax(const CryptographicMessageSyntax&); // Not implemented. 00067 void operator=(const CryptographicMessageSyntax&); // Not implemented. 00068 }; 00069 } // end namespace gdcm 00070 //----------------------------------------------------------------------------- 00071 #endif //GDCMCRYPTOGRAPHICMESSAGESYNTAX_H