22 #ifndef NDN_SECURITY_KEY_PARAMS_HPP
23 #define NDN_SECURITY_KEY_PARAMS_HPP
25 #include "../common.hpp"
26 #include "../name-component.hpp"
39 class Error :
public std::runtime_error
44 :
std::runtime_error(what)
149 template<
typename KeyParamsInfo>
156 uint32_t size = KeyParamsInfo::getDefaultSize())
157 :
KeyParams(KeyParamsInfo::getType(), keyId)
171 :
KeyParams(KeyParamsInfo::getType(), keyIdType)
184 setKeySize(uint32_t size)
186 m_size = KeyParamsInfo::checkKeySize(size);
190 getDefaultKeySize()
const
192 return KeyParamsInfo::getDefaultSize();
228 template<
typename KeyParamsInfo>
235 uint32_t size = KeyParamsInfo::getDefaultSize())
236 :
KeyParams(KeyParamsInfo::getType(), keyId)
249 setKeySize(uint32_t size)
251 m_size = KeyParamsInfo::checkKeySize(size);
255 getDefaultKeySize()
const
257 return KeyParamsInfo::getDefaultSize();
268 #endif // NDN_SECURITY_KEY_PARAMS_HPP
Copyright (c) 2013-2016 Regents of the University of California.
SimpleSymmetricKeyParams is a template for symmetric keys with only one parameter: size...
SimplePublicKeyParams< RsaKeyParamsInfo > RsaKeyParams
RsaKeyParams carries parameters for RSA key.
SimpleSymmetricKeyParams(const name::Component &keyId, uint32_t size=KeyParamsInfo::getDefaultSize())
Create key parameter with user specified keyId.
AesKeyParamsInfo is used to initialize a SimpleSymmetricKeyParams template for AES key...
Error(const std::string &what)
KeyIdType
The type of KeyId component in a key name.
void setKeyId(const name::Component &keyId)
KeyType getKeyType() const
static uint32_t checkKeySize(uint32_t size)
check if size is qualified.
uint32_t getKeySize() const
static uint32_t getDefaultSize()
EcKeyParamInfo is used to initialize a SimplePublicKeyParams template for elliptic curve key...
static uint32_t checkKeySize(uint32_t size)
check if size is qualified.
uint32_t getKeySize() const
SimplePublicKeyParams(const name::Component &keyId, uint32_t size=KeyParamsInfo::getDefaultSize())
Create key parameter with user specified keyId.
static uint32_t getDefaultSize()
RsaKeyParamInfo is used to initialize a SimplePublicKeyParams template for RSA key.
static uint32_t getDefaultSize()
static uint32_t checkKeySize(uint32_t size)
check if size is qualified.
KeyParams(KeyType keyType, KeyIdType keyIdType)
Create a key generation parameter.
SimplePublicKeyParams< EcKeyParamsInfo > EcKeyParams
EcKeyParams carries parameters for EC key.
KeyIdType getKeyIdType() const
SimplePublicKeyParams(uint32_t size=KeyParamsInfo::getDefaultSize(), KeyIdType keyIdType=KeyIdType::RANDOM)
Create key parameter with auto-created keyId.
Component holds a read-only name component value.
SimpleSymmetricKeyParams< AesKeyParamsInfo > AesKeyParams
Use a 64-bit random number as the key id.
Base class of key parameters.
SimplePublicKeyParams is a template for public keys with only one parameter: size.
const name::Component & getKeyId() const