22 #ifndef NDN_CXX_SECURITY_TRANSFORM_PRIVATE_KEY_HPP 23 #define NDN_CXX_SECURITY_TRANSFORM_PRIVATE_KEY_HPP 25 #include "../security-common.hpp" 26 #include "../../encoding/buffer.hpp" 41 class Error :
public std::runtime_error
46 :
std::runtime_error(what)
81 loadPkcs1(
const uint8_t* buf,
size_t size);
106 loadPkcs8(
const uint8_t* buf,
size_t size,
const char* pw,
size_t pwLen);
115 loadPkcs8(
const uint8_t* buf,
size_t size, PasswordCallback pwCallback =
nullptr);
122 loadPkcs8(std::istream& is,
const char* pw,
size_t pwLen);
131 loadPkcs8(std::istream& is, PasswordCallback pwCallback =
nullptr);
139 loadPkcs8Base64(
const uint8_t* buf,
size_t size,
const char* pw,
size_t pwLen);
148 loadPkcs8Base64(
const uint8_t* buf,
size_t size, PasswordCallback pwCallback =
nullptr);
165 loadPkcs8Base64(std::istream& is, PasswordCallback pwCallback =
nullptr);
183 savePkcs8(std::ostream& os,
const char* pw,
size_t pwLen)
const;
192 savePkcs8(std::ostream& os, PasswordCallback pwCallback =
nullptr)
const;
207 savePkcs8Base64(std::ostream& os, PasswordCallback pwCallback =
nullptr)
const;
221 decrypt(
const uint8_t* cipherText,
size_t cipherLen)
const;
239 toPkcs8(
const char* pw,
size_t pwLen)
const;
242 toPkcs8(PasswordCallback pwCallback =
nullptr)
const;
245 rsaDecrypt(
const uint8_t* cipherText,
size_t cipherLen)
const;
250 static unique_ptr<PrivateKey>
251 generateRsaKey(uint32_t keySize);
253 static unique_ptr<PrivateKey>
254 generateEcKey(uint32_t keySize);
258 const unique_ptr<Impl> m_impl;
269 unique_ptr<PrivateKey>
276 #endif // NDN_CXX_SECURITY_TRANSFORM_PRIVATE_KEY_HPP
Copyright (c) 2011-2015 Regents of the University of California.
Catch-all error for security policy errors that don't fit in other categories.
KeyType
The type of a cryptographic key.
Base class of key parameters.
shared_ptr< const Buffer > ConstBufferPtr