Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
CipherAlgorithm.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5namespace Stroika::Foundation::Cryptography::Providers::OpenSSL {
6
7#if qStroika_HasComponent_OpenSSL
8
9 /*
10 ********************************************************************************
11 ***************************** OpenSSL::CipherAlgorithm *************************
12 ********************************************************************************
13 */
14 inline CipherAlgorithm::CipherAlgorithm (const CipherAlgorithm& src)
15 : CipherAlgorithm{src.fCipher_}
16 {
17 }
18 inline CipherAlgorithm& CipherAlgorithm::operator= (const CipherAlgorithm& src)
19 {
20 fCipher_ = src.fCipher_;
21 return *this;
22 }
23 inline CipherAlgorithm::operator const EVP_CIPHER* () const
24 {
25 return fCipher_;
26 }
27 inline auto CipherAlgorithm::operator<=> (const CipherAlgorithm& rhs) const
28 {
29 return fCipher_ <=> rhs.fCipher_;
30 }
31 inline bool CipherAlgorithm::operator== (const CipherAlgorithm& rhs) const
32 {
33 return fCipher_ == rhs.fCipher_;
34 }
35 inline String CipherAlgorithm::ToString () const
36 {
37 return String{::EVP_CIPHER_name (fCipher_)};
38 }
39 inline size_t CipherAlgorithm::KeyLength () const
40 {
41 return ::EVP_CIPHER_key_length (fCipher_);
42 }
43 inline size_t CipherAlgorithm::IVLength () const
44 {
45 return ::EVP_CIPHER_iv_length (fCipher_);
46 }
47#endif
48
49}