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;
77 loadPkcs1(
const uint8_t* buf,
size_t size);
102 loadPkcs8(
const uint8_t* buf,
size_t size,
const char* pw,
size_t pwLen);
111 loadPkcs8(
const uint8_t* buf,
size_t size, PasswordCallback pwCallback =
nullptr);
118 loadPkcs8(std::istream& is,
const char* pw,
size_t pwLen);
127 loadPkcs8(std::istream& is, PasswordCallback pwCallback =
nullptr);
135 loadPkcs8Base64(
const uint8_t* buf,
size_t size,
const char* pw,
size_t pwLen);
144 loadPkcs8Base64(
const uint8_t* buf,
size_t size, PasswordCallback pwCallback =
nullptr);
161 loadPkcs8Base64(std::istream& is, PasswordCallback pwCallback =
nullptr);
179 savePkcs8(std::ostream& os,
const char* pw,
size_t pwLen)
const;
188 savePkcs8(std::ostream& os, PasswordCallback pwCallback =
nullptr)
const;
203 savePkcs8Base64(std::ostream& os, PasswordCallback pwCallback =
nullptr)
const;
217 decrypt(
const uint8_t* cipherText,
size_t cipherLen)
const;
235 toPkcs8(
const char* pw,
size_t pwLen)
const;
238 toPkcs8(PasswordCallback pwCallback =
nullptr)
const;
241 rsaDecrypt(
const uint8_t* cipherText,
size_t cipherLen)
const;
246 static unique_ptr<PrivateKey>
247 generateRsaKey(uint32_t keySize);
249 static unique_ptr<PrivateKey>
250 generateEcKey(uint32_t keySize);
254 const unique_ptr<Impl> m_impl;
265 unique_ptr<PrivateKey>
272 #endif // NDN_CXX_SECURITY_TRANSFORM_PRIVATE_KEY_HPP
KeyType
The type of a cryptographic key.
Base class of key parameters.
shared_ptr< const Buffer > ConstBufferPtr