GDCM  2.4.5
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 
21 namespace gdcm
22 {
23 
25 {
26 public:
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 
39  void SetCipherType(CipherTypes type);
40  CipherTypes GetCipherType() const;
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 
46 private:
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 
58 private:
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
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
CipherTypes
Definition: gdcmCryptographicMessageSyntax.h:29
Definition: gdcmCryptographicMessageSyntax.h:22
Definition: gdcmASN1.h:20
Definition: gdcmOpenSSLCryptographicMessageSyntax.h:24

Generated on Fri Sep 25 2015 17:58:23 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo