4#ifndef _Stroika_Foundation_Cryptography_OpenSSL_CipherAlgorithm_h_
5#define _Stroika_Foundation_Cryptography_OpenSSL_CipherAlgorithm_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
9#if qStroika_HasComponent_OpenSSL
10#include <openssl/evp.h>
14#include "Stroika/Foundation/Common/Common.h"
15#include "Stroika/Foundation/Common/Property.h"
16#include "Stroika/Foundation/Execution/Exceptions.h"
17#include "Stroika/Foundation/Execution/LazyInitialized.h"
18#include "Stroika/Foundation/Memory/Common.h"
25#if qStroika_HasComponent_OpenSSL
26namespace Stroika::Foundation::Cryptography::Providers::OpenSSL {
28 using Characters::String;
33 class CipherAlgorithm {
37 CipherAlgorithm (const ::EVP_CIPHER* cipher);
38 CipherAlgorithm (
const CipherAlgorithm& src);
41 nonvirtual CipherAlgorithm& operator= (
const CipherAlgorithm& src);
49 static CipherAlgorithm GetByName (
const String& cipherName);
50 static optional<CipherAlgorithm> GetByNameQuietly (
const String& cipherName);
53 nonvirtual
operator const ::EVP_CIPHER* ()
const;
58 Common::ReadOnlyProperty<String> name;
61 nonvirtual
auto operator<=> (
const CipherAlgorithm& rhs)
const;
62 nonvirtual
bool operator== (
const CipherAlgorithm& rhs)
const;
67 nonvirtual
size_t KeyLength ()
const;
72 nonvirtual
size_t IVLength ()
const;
80 const ::EVP_CIPHER* fCipher_;
86 namespace CipherAlgorithms {
87 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_128_CBC;
88 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_128_ECB;
89 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_128_OFB;
90 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_128_CFB1;
91 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_128_CFB8;
92 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_128_CFB128;
93 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_192_CBC;
94 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_192_ECB;
95 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_192_OFB;
96 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_192_CFB1;
97 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_192_CFB8;
98 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_192_CFB128;
99 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_256_CBC;
100 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_256_ECB;
101 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_256_OFB;
102 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_256_CFB1;
103 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_256_CFB8;
104 extern const Execution::LazyInitialized<CipherAlgorithm> kAES_256_CFB128;
118 extern const Execution::LazyInitialized<CipherAlgorithm> kBlowfish_CBC;
119 extern const Execution::LazyInitialized<CipherAlgorithm> kBlowfish_ECB;
120 extern const Execution::LazyInitialized<CipherAlgorithm> kBlowfish_CFB;
121 extern const Execution::LazyInitialized<CipherAlgorithm> kBlowfish_OFB;
122 extern const Execution::LazyInitialized<CipherAlgorithm> kBlowfish;
123 extern const Execution::LazyInitialized<CipherAlgorithm> kRC2_CBC;
124 extern const Execution::LazyInitialized<CipherAlgorithm> kRC2_ECB;
125 extern const Execution::LazyInitialized<CipherAlgorithm> kRC2_CFB;
126 extern const Execution::LazyInitialized<CipherAlgorithm> kRC2_OFB;
127 extern const Execution::LazyInitialized<CipherAlgorithm> kRC4;
138#include "CipherAlgorithm.inl"
STRING_TYPE ToString(FLOAT_TYPE f, const ToStringOptions &options={})