GDCM
2.4.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
Source
Common
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
17
#include "
gdcmCryptographicMessageSyntax.h
"
18
#include <openssl/cms.h>
19
#include <openssl/evp.h>
20
21
namespace
gdcm
22
{
23
24
class
GDCM_EXPORT
OpenSSLCryptographicMessageSyntax
:
public
CryptographicMessageSyntax
25
{
26
public
:
27
OpenSSLCryptographicMessageSyntax
();
28
~
OpenSSLCryptographicMessageSyntax
();
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
:
59
OpenSSLCryptographicMessageSyntax
(
const
OpenSSLCryptographicMessageSyntax
&);
// Not implemented.
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
Generated on Thu Oct 17 2013 10:05:56 for GDCM by
1.8.4