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