gdcmCryptographicMessageSyntax.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program: GDCM (Grassroots DICOM). A DICOM library
00004   Module:  $URL$
00005 
00006   Copyright (c) 2006-2009 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 
00052   void SetCipherType( CipherTypes type);
00053   CipherTypes GetCipherType() const;
00054 
00055   bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const;
00056   bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const;
00057 
00058 private:
00059   CryptographicMessageSyntaxInternals *Internals;
00060 private:
00061   CryptographicMessageSyntax(const CryptographicMessageSyntax&);  // Not implemented.
00062   void operator=(const CryptographicMessageSyntax&);  // Not implemented.
00063 };
00064 } // end namespace gdcm
00065 //-----------------------------------------------------------------------------
00066 #endif //__gdcmCryptographicMessageSyntax_h

Generated on Thu Jul 1 06:40:22 2010 for GDCM by doxygen 1.6.3
SourceForge.net Logo