Logo Search packages:      
Sourcecode: gdcm version File versions  Download package



  Program: GDCM (Grassroots DICOM). A DICOM library
  Module:  $URL$

  Copyright (c) 2006-2009 Mathieu Malaterre
  All rights reserved.
  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

#ifndef __gdcmCryptographicMessageSyntax_h
#define __gdcmCryptographicMessageSyntax_h

#include "gdcmTypes.h"

namespace gdcm
class CryptographicMessageSyntaxInternals;

 * \brief 
 * Class for CryptographicMessageSyntax encryption. This is just a simple
 * wrapper around openssl PKCS7_encrypt functionalities
 * See online documentation
 * http://www.openssl.org/docs/crypto/PKCS7_encrypt.html
00034 class GDCM_EXPORT CryptographicMessageSyntax
public :

  // X.509
  bool ParseCertificateFile( const char *filename );
  bool ParseKeyFile( const char *filename );

  typedef enum {
    DES_CIPHER,    // DES
    DES3_CIPHER,   // Triple DES
    AES192_CIPHER, // '   '
    AES256_CIPHER  // '   '
  } CipherTypes;

  void SetCipherType( CipherTypes type);
  CipherTypes GetCipherType() const;

  bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const;
  bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const;

  CryptographicMessageSyntaxInternals *Internals;
  CryptographicMessageSyntax(const CryptographicMessageSyntax&);  // Not implemented.
  void operator=(const CryptographicMessageSyntax&);  // Not implemented.
} // end namespace gdcm
#endif //__gdcmCryptographicMessageSyntax_h

Generated by  Doxygen 1.6.0   Back to index