LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
openssl_symmetric_cipher_context.hpp
Go to the documentation of this file.
1
7#ifndef OPENSSL_SYMETRIC_CIPHER_CONTEXT_HPP
8#define OPENSSL_SYMETRIC_CIPHER_CONTEXT_HPP
9
11#include <memory>
12
13#include <openssl/evp.h>
14
15namespace logicalaccess
16{
17namespace openssl
18{
26{
31 {
37
42
46 Information(const Information &other) = delete; // non construction-copyable
47 Information &operator=(const Information &) = delete; // non copyable
48
52 EVP_CIPHER_CTX *ctx;
53
58
63 };
64
70
77 void setPadding(bool padding) const;
78
83 EVP_CIPHER_CTX *ctx() const;
84
89 size_t blockSize() const;
90
96
101 ByteVector &data() const;
102
106 void reset();
107
111 std::shared_ptr<Information> d_information;
112
114};
115
116inline EVP_CIPHER_CTX *OpenSSLSymmetricCipherContext::ctx() const
117{
118 return d_information->ctx;
119}
121{
122 return d_information->method;
123}
125{
126 return d_information->data;
127}
128}
129}
130
131#endif /* OPENSSL_SYMETRIC_CIPHER_CONTEXT_HPP */
An OpenSSL context class.
Definition: openssl_symmetric_cipher_context.hpp:26
void setPadding(bool padding) const
Set the padding.
Definition: openssl_symmetric_cipher_context.cpp:38
EVP_CIPHER_CTX * ctx() const
Get the data.
Definition: openssl_symmetric_cipher_context.hpp:116
ByteVector & data() const
Get the data.
Definition: openssl_symmetric_cipher_context.hpp:124
void reset()
Reset the context.
Definition: openssl_symmetric_cipher_context.cpp:50
std::shared_ptr< Information > d_information
The information.
Definition: openssl_symmetric_cipher_context.hpp:111
size_t blockSize() const
Get the block size.
Definition: openssl_symmetric_cipher_context.cpp:43
OpenSSLSymmetricCipher::Method method() const
Get the method.
Definition: openssl_symmetric_cipher_context.hpp:120
A OpenSSL symmetric cipher base class.
Definition: openssl_symmetric_cipher.hpp:33
Method
A method.
Definition: openssl_symmetric_cipher.hpp:52
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9
OpenSSL symmetric cipher base class.
The context information structure.
Definition: openssl_symmetric_cipher_context.hpp:31
EVP_CIPHER_CTX * ctx
The internal OpenSSL context.
Definition: openssl_symmetric_cipher_context.hpp:52
Information(const Information &other)=delete
Remove copy.
ByteVector data
An internal buffer.
Definition: openssl_symmetric_cipher_context.hpp:62
~Information()
Destructor.
Definition: openssl_symmetric_cipher_context.cpp:26
OpenSSLSymmetricCipher::Method method
The internal method.
Definition: openssl_symmetric_cipher_context.hpp:57