Virgil Security Crypto library  1.8.2
VirgilKDF.h
1 
37 #ifndef VIRGIL_CRYPTO_KDF_H
38 #define VIRGIL_CRYPTO_KDF_H
39 
40 #include <string>
41 
42 #include <virgil/crypto/VirgilByteArray.h>
43 #include <virgil/crypto/foundation/asn1/VirgilAsn1Compatible.h>
44 
45 namespace virgil { namespace crypto { namespace foundation {
46 
50 class VirgilKDFImpl;
53 
58 public:
63 
67  static VirgilKDF kdf1();
68 
72  static VirgilKDF kdf2();
74 
77 
83  VirgilKDF();
84 
88  virtual ~VirgilKDF() throw();
90 
97 
102  std::string name() const;
104 
107 
115  virgil::crypto::VirgilByteArray derive(const virgil::crypto::VirgilByteArray& in, size_t outSize);
117 
123  VirgilKDF(const VirgilKDF& other);
125 
126  VirgilKDF& operator=(const VirgilKDF& rhs);
128 
150  virtual size_t asn1Write(
153  size_t childWrittenBytes = 0) const;
154 
157 private:
158  explicit VirgilKDF(int kdfType, int mdType);
159 
163  void checkState() const;
164 
165 private:
166  VirgilKDFImpl* impl_;
167 };
168 
169 }}}
170 
171 #endif /* VIRGIL_CRYPTO_KDF_H */
static VirgilKDF kdf1()
Configures with KDF1 (ISO-18033-2) algorithm.
This class provides methods for reading ASN.1 data structure.
Definition: VirgilAsn1Reader.h:53
std::string name() const
Returns name of the key derivation function.
Provides key derivation function algorithms.
Definition: VirgilKDF.h:57
This class provides interface that allow to save and restore object state in the ASN.1 structure.
Definition: VirgilAsn1Compatible.h:59
static VirgilKDF kdf2()
Configures with KDF1 (ISO-18033-2) algorithm.
virtual void asn1Read(virgil::crypto::foundation::asn1::VirgilAsn1Reader &asn1Reader)
Read object state from the reader.
This class provides methods for writing ASN.1 data structure.
Definition: VirgilAsn1Writer.h:54
Definition: VirgilAsn1Compatible.h:46
VirgilKDF()
Create object with undefined algorithm.
virtual ~VirgilKDF()
Polymorphic destructor.
virtual size_t asn1Write(virgil::crypto::foundation::asn1::VirgilAsn1Writer &asn1Writer, size_t childWrittenBytes=0) const
Write object state to the writer.
virgil::crypto::VirgilByteArray derive(const virgil::crypto::VirgilByteArray &in, size_t outSize)
Derive key from the given key material.