22 #ifndef NDN_CXX_SECURITY_TRANSFORM_PRIVATE_KEY_HPP 23 #define NDN_CXX_SECURITY_TRANSFORM_PRIVATE_KEY_HPP 41 class Error :
public std::runtime_error
44 using std::runtime_error::runtime_error;
99 loadPkcs1(
const uint8_t* buf,
size_t size);
124 loadPkcs8(
const uint8_t* buf,
size_t size,
const char* pw,
size_t pwLen);
133 loadPkcs8(
const uint8_t* buf,
size_t size, PasswordCallback pwCallback =
nullptr);
140 loadPkcs8(std::istream& is,
const char* pw,
size_t pwLen);
149 loadPkcs8(std::istream& is, PasswordCallback pwCallback =
nullptr);
157 loadPkcs8Base64(
const uint8_t* buf,
size_t size,
const char* pw,
size_t pwLen);
166 loadPkcs8Base64(
const uint8_t* buf,
size_t size, PasswordCallback pwCallback =
nullptr);
183 loadPkcs8Base64(std::istream& is, PasswordCallback pwCallback =
nullptr);
201 savePkcs8(std::ostream& os,
const char* pw,
size_t pwLen)
const;
210 savePkcs8(std::ostream& os, PasswordCallback pwCallback =
nullptr)
const;
225 savePkcs8Base64(std::ostream& os, PasswordCallback pwCallback =
nullptr)
const;
239 decrypt(
const uint8_t* cipherText,
size_t cipherLen)
const;
258 toPkcs8(
const char* pw,
size_t pwLen)
const;
261 toPkcs8(PasswordCallback pwCallback =
nullptr)
const;
264 rsaDecrypt(
const uint8_t* cipherText,
size_t cipherLen)
const;
269 static unique_ptr<PrivateKey>
270 generateRsaKey(uint32_t keySize);
272 static unique_ptr<PrivateKey>
273 generateEcKey(uint32_t keySize);
275 static unique_ptr<PrivateKey>
276 generateHmacKey(uint32_t keySize);
280 const unique_ptr<Impl> m_impl;
291 unique_ptr<PrivateKey>
298 #endif // NDN_CXX_SECURITY_TRANSFORM_PRIVATE_KEY_HPP
KeyType
The type of a cryptographic key.
Base class for key parameters.
shared_ptr< const Buffer > ConstBufferPtr