GDCM 3.0.24
gdcmOpenSSLCryptographicMessageSyntax.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 GDCMOPENSSLCRYPTOGRAPHICMESSAGESYNTAX_H
15#define GDCMOPENSSLCRYPTOGRAPHICMESSAGESYNTAX_H
16
18#include <openssl/cms.h>
19#include <openssl/evp.h>
20
21namespace gdcm
22{
23
25{
26public:
29
30 // X.509
31 bool ParseCertificateFile( const char *filename );
32 bool ParseKeyFile( const char *filename );
33
34 // PBE
35 bool SetPassword(const char * pass, size_t passLen);
36
42 bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const;
44 bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const;
45
46private:
47//#ifdef GDCM_HAVE_CMS_RECIPIENT_PASSWORD
48// ::stack_st_X509 *recips;
49//#else
50 STACK_OF(X509) *recips;
51//#endif
52 ::EVP_PKEY *pkey;
53 const EVP_CIPHER *internalCipherType;
54 char * password;
55 size_t passwordLength;
56 CipherTypes cipherType;
57
58private:
60 void operator=(const OpenSSLCryptographicMessageSyntax&); // Not implemented.
61 const EVP_CIPHER *CreateCipher( CryptographicMessageSyntax::CipherTypes ciphertype);
62
63};
64
65} // end namespace gdcm
66
67#endif //GDCMOPENSSLCRYPTOGRAPHICMESSAGESYNTAX_H
Definition gdcmCryptographicMessageSyntax.h:23
CipherTypes
Definition gdcmCryptographicMessageSyntax.h:31
Definition gdcmOpenSSLCryptographicMessageSyntax.h:25
bool ParseKeyFile(const char *filename)
bool ParseCertificateFile(const char *filename)
bool Encrypt(char *output, size_t &outlen, const char *array, size_t len) const
create a CMS envelopedData structure
bool Decrypt(char *output, size_t &outlen, const char *array, size_t len) const
decrypt content from a PKCS#7 envelopedData structure
bool SetPassword(const char *pass, size_t passLen)
void SetCipherType(CipherTypes type)
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21