GDCM 3.2.1

gdcmOpenSSLP7CryptographicMessageSyntax.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 GDCMOPENSSLP7CRYPTOGRAPHICMESSAGESYNTAX_H
15#define GDCMOPENSSLP7CRYPTOGRAPHICMESSAGESYNTAX_H
16
17#include "gdcmCryptographicMessageSyntax.h"
18#include "gdcmTypes.h"
19
20 namespace gdcm
21{
22 class CryptographicMessageSyntaxInternals;
23//-----------------------------------------------------------------------------
24
34 class GDCM_EXPORT OpenSSLP7CryptographicMessageSyntax : public CryptographicMessageSyntax
35{
36 public:
37 OpenSSLP7CryptographicMessageSyntax();
38 ~OpenSSLP7CryptographicMessageSyntax();
39
40 // X.509
41 bool ParseCertificateFile( const char *filename );
42 bool ParseKeyFile( const char *filename );
43
44 // PBE
45 bool SetPassword(const char * /*pass*/, size_t /*passLen*/)
46 {
47 gdcmWarningMacro( "Openssl using PKCS7 does not support Password Based Encryption." );
48 return false;
49 }
50
53 void SetCipherType(CipherTypes type);
54 CipherTypes GetCipherType() const;
55
57 bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const;
58
60 bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const;
61
62 private:
63 CryptographicMessageSyntaxInternals *Internals;
64 private:
65 OpenSSLP7CryptographicMessageSyntax(const OpenSSLP7CryptographicMessageSyntax&); // Not implemented.
66 void operator=(const OpenSSLP7CryptographicMessageSyntax&); // Not implemented.
67};
68} // end namespace gdcm
69//-----------------------------------------------------------------------------
70#endif //GDCMOPENSSLP7CRYPTOGRAPHICMESSAGESYNTAX_H
gdcm::CryptographicMessageSyntax::CipherTypes
CipherTypes
Definition gdcmCryptographicMessageSyntax.h:31
gdcm::CryptographicMessageSyntax::CryptographicMessageSyntax
CryptographicMessageSyntax()=default
gdcm::OpenSSLP7CryptographicMessageSyntax::Encrypt
bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const
create a PKCS#7 envelopedData structure
gdcm::OpenSSLP7CryptographicMessageSyntax::ParseKeyFile
bool ParseKeyFile(const char *filename)
gdcm::OpenSSLP7CryptographicMessageSyntax::Decrypt
bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const
decrypt content from a PKCS#7 envelopedData structure
gdcm::OpenSSLP7CryptographicMessageSyntax::~OpenSSLP7CryptographicMessageSyntax
~OpenSSLP7CryptographicMessageSyntax()
gdcm::OpenSSLP7CryptographicMessageSyntax::ParseCertificateFile
bool ParseCertificateFile(const char *filename)
gdcm::OpenSSLP7CryptographicMessageSyntax::GetCipherType
CipherTypes GetCipherType() const
gdcm::OpenSSLP7CryptographicMessageSyntax::SetPassword
bool SetPassword(const char *, size_t)
Definition gdcmOpenSSLP7CryptographicMessageSyntax.h:45
gdcm::OpenSSLP7CryptographicMessageSyntax::OpenSSLP7CryptographicMessageSyntax
OpenSSLP7CryptographicMessageSyntax()
gdcm::OpenSSLP7CryptographicMessageSyntax::SetCipherType
void SetCipherType(CipherTypes type)
gdcmCryptographicMessageSyntax.h
gdcmWarningMacro
#define gdcmWarningMacro(msg)
Warning.
Definition gdcmTrace.h:142
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21