GDCM 3.0.24
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
19namespace gdcm
20{
21
23{
24public:
26
27 virtual ~CryptographicMessageSyntax() = default;
30
31 typedef enum {
32 DES3_CIPHER, // Triple DES
33 AES128_CIPHER, // CBC AES
35 AES256_CIPHER // ' '
36 } CipherTypes;
37
38 // X.509
39 virtual bool ParseCertificateFile( const char *filename ) = 0;
40 virtual bool ParseKeyFile( const char *filename ) = 0;
41
42 // PBE
43 virtual bool SetPassword(const char * pass, size_t passLen) = 0;
44
46 virtual bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const = 0;
48 virtual bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const = 0;
49
50 virtual void SetCipherType(CipherTypes type) = 0;
51
52 virtual CipherTypes GetCipherType() const = 0;
53};
54
55} // end namespace gdcm
56
57#endif //GDCMCRYPTOGRAPHICMESSAGESYNTAX_H
Definition gdcmCryptographicMessageSyntax.h:23
virtual ~CryptographicMessageSyntax()=default
virtual void SetCipherType(CipherTypes type)=0
virtual bool ParseKeyFile(const char *filename)=0
virtual bool ParseCertificateFile(const char *filename)=0
virtual bool SetPassword(const char *pass, size_t passLen)=0
CipherTypes
Definition gdcmCryptographicMessageSyntax.h:31
@ AES192_CIPHER
Definition gdcmCryptographicMessageSyntax.h:34
@ AES128_CIPHER
Definition gdcmCryptographicMessageSyntax.h:33
@ DES3_CIPHER
Definition gdcmCryptographicMessageSyntax.h:32
CryptographicMessageSyntax(const CryptographicMessageSyntax &)=delete
void operator=(const CryptographicMessageSyntax &)=delete
virtual bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const =0
create a CMS envelopedData structure
virtual bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const =0
decrypt content from a CMS envelopedData structure
virtual CipherTypes GetCipherType() const =0
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21