123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- #ifndef _ISC_CRYPTO_H
- #define _ISC_CRYPTO_H
- #include <string>
- #include <dns/buffer.h>
- #include <exceptions/exceptions.h>
- #include <boost/noncopyable.hpp>
- #include <boost/scoped_ptr.hpp>
- #include <cryptolink/crypto_hmac.h>
- #include <memory>
- namespace isc {
- namespace cryptolink {
- class CryptoLinkError : public Exception {
- public:
- CryptoLinkError(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
- };
- class InitializationError : public CryptoLinkError {
- public:
- InitializationError(const char* file, size_t line, const char* what) :
- CryptoLinkError(file, line, what) {}
- };
- class UnsupportedAlgorithm : public CryptoLinkError {
- public:
- UnsupportedAlgorithm(const char* file, size_t line, const char* what) :
- CryptoLinkError(file, line, what) {}
- };
- class BadKey : public CryptoLinkError {
- public:
- BadKey(const char* file, size_t line, const char* what) :
- CryptoLinkError(file, line, what) {}
- };
- class LibraryError : public CryptoLinkError {
- public:
- LibraryError(const char* file, size_t line, const char* what) :
- CryptoLinkError(file, line, what) {}
- };
- class CryptoLinkImpl;
- class CryptoLink : private boost::noncopyable {
- public:
-
-
-
-
-
-
-
-
-
-
-
- static CryptoLink& getCryptoLink();
-
-
-
-
-
-
-
-
-
-
-
- static void initialize();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HMAC* createHMAC(const void* secret, size_t secret_len,
- const HMAC::HashAlgorithm hash_algorithm);
- std::auto_ptr<HMAC> createHMAC2(const void* secret, size_t secret_len,
- const HMAC::HashAlgorithm hash_algorithm);
- private:
-
-
- static CryptoLink& getCryptoLinkInternal();
-
-
- CryptoLink() : impl_(NULL) {}
- ~CryptoLink();
- CryptoLinkImpl* impl_;
- };
- }
- }
- #endif
|