ndn::nac Namespace Reference

Namespaces

 tlv
 

Classes

class  AccessManager
 Access Manager. More...
 
class  Decryptor
 NAC Decryptor. More...
 
class  EncryptedContent
 Encrypted content. More...
 
class  Encryptor
 NAC Encryptor. More...
 
class  Error
 

Typedefs

using ErrorCallback = std::function< void(const ErrorCode &, const std::string &)>
 

Enumerations

enum class  ErrorCode {
  KekRetrievalFailure = 1 ,
  KekRetrievalTimeout = 2 ,
  KekInvalidName = 3 ,
  KdkRetrievalFailure = 11 ,
  KdkRetrievalTimeout = 12 ,
  KdkInvalidName = 13 ,
  KdkDecryptionFailure = 14 ,
  CkRetrievalFailure = 21 ,
  CkRetrievalTimeout = 22 ,
  CkInvalidName = 23 ,
  MissingRequiredKeyLocator = 101 ,
  TpmKeyNotFound = 102 ,
  EncryptionFailure = 103
}
 

Functions

Name convertKekNameToKdkPrefix (const Name &kekName, const ErrorCallback &onFailure)
 Convert KEK name to KDK prefix: More...
 
std::tuple< Name, Name, Name > extractKdkInfoFromCkName (const Name &ckDataName, const Name &ckName, const ErrorCallback &onFailure)
 Extract KDK information from name of CK data packet name. More...
 

Variables

constexpr size_t AES_IV_SIZE = 16
 
constexpr size_t AES_KEY_SIZE = 32
 
const name::Component CK {"CK"}
 
constexpr time::seconds DEFAULT_CK_FRESHNESS_PERIOD = 1_h
 
constexpr time::seconds DEFAULT_KDK_FRESHNESS_PERIOD = 1_h
 
constexpr time::seconds DEFAULT_KEK_FRESHNESS_PERIOD = 1_h
 
const name::Component ENCRYPTED_BY {"ENCRYPTED-BY"}
 
const name::Component KDK {"KDK"}
 
const name::Component KEK {"KEK"}
 
constexpr size_t N_RETRIES = 3
 
const name::Component NAC {"NAC"}
 
constexpr time::seconds RETRY_DELAY_AFTER_NACK = 1_s
 
constexpr time::seconds RETRY_DELAY_KEK_RETRIEVAL = 60_s
 

Typedef Documentation

◆ ErrorCallback

using ndn::nac::ErrorCallback = typedef std::function<void(const ErrorCode&, const std::string&)>

Definition at line 117 of file common.hpp.

Enumeration Type Documentation

◆ ErrorCode

enum ndn::nac::ErrorCode
strong
Enumerator
KekRetrievalFailure 
KekRetrievalTimeout 
KekInvalidName 
KdkRetrievalFailure 
KdkRetrievalTimeout 
KdkInvalidName 
KdkDecryptionFailure 
CkRetrievalFailure 
CkRetrievalTimeout 
CkInvalidName 
MissingRequiredKeyLocator 
TpmKeyNotFound 
EncryptionFailure 

Definition at line 98 of file common.hpp.

Function Documentation

◆ convertKekNameToKdkPrefix()

Name ndn::nac::convertKekNameToKdkPrefix ( const Name &  kekName,
const ErrorCallback onFailure 
)

Convert KEK name to KDK prefix:

<identity>/NAC/KEK/<key-id> =>> <identity>/NAC/KDK/<key-id>

Definition at line 25 of file common.cpp.

◆ extractKdkInfoFromCkName()

std::tuple< Name, Name, Name > ndn::nac::extractKdkInfoFromCkName ( const Name &  ckDataName,
const Name &  ckName,
const ErrorCallback onFailure 
)

Extract KDK information from name of CK data packet name.

Returns
tuple of (KDK prefix, KDK identity, and KDK key id). The last two identify KDK private/key pair in KeyChain

Definition at line 37 of file common.cpp.

Variable Documentation

◆ AES_IV_SIZE

constexpr size_t ndn::nac::AES_IV_SIZE = 16
inlineconstexpr

Definition at line 89 of file common.hpp.

◆ AES_KEY_SIZE

constexpr size_t ndn::nac::AES_KEY_SIZE = 32
inlineconstexpr

Definition at line 88 of file common.hpp.

◆ CK

const name::Component ndn::nac::CK {"CK"}
inline

Definition at line 86 of file common.hpp.

◆ DEFAULT_CK_FRESHNESS_PERIOD

constexpr time::seconds ndn::nac::DEFAULT_CK_FRESHNESS_PERIOD = 1_h
inlineconstexpr

Definition at line 93 of file common.hpp.

◆ DEFAULT_KDK_FRESHNESS_PERIOD

constexpr time::seconds ndn::nac::DEFAULT_KDK_FRESHNESS_PERIOD = 1_h
inlineconstexpr

Definition at line 92 of file common.hpp.

◆ DEFAULT_KEK_FRESHNESS_PERIOD

constexpr time::seconds ndn::nac::DEFAULT_KEK_FRESHNESS_PERIOD = 1_h
inlineconstexpr

Definition at line 91 of file common.hpp.

◆ ENCRYPTED_BY

const name::Component ndn::nac::ENCRYPTED_BY {"ENCRYPTED-BY"}
inline

Definition at line 82 of file common.hpp.

◆ KDK

const name::Component ndn::nac::KDK {"KDK"}
inline

Definition at line 85 of file common.hpp.

◆ KEK

const name::Component ndn::nac::KEK {"KEK"}
inline

Definition at line 84 of file common.hpp.

◆ N_RETRIES

constexpr size_t ndn::nac::N_RETRIES = 3
constexpr

Definition at line 34 of file decryptor.cpp.

◆ NAC

const name::Component ndn::nac::NAC {"NAC"}
inline

Definition at line 83 of file common.hpp.

◆ RETRY_DELAY_AFTER_NACK

constexpr time::seconds ndn::nac::RETRY_DELAY_AFTER_NACK = 1_s
inlineconstexpr

Definition at line 95 of file common.hpp.

◆ RETRY_DELAY_KEK_RETRIEVAL

constexpr time::seconds ndn::nac::RETRY_DELAY_KEK_RETRIEVAL = 60_s
inlineconstexpr

Definition at line 96 of file common.hpp.