Project

General

Profile

Actions

Feature #4342

open

KeyChain helpers

Added by Alex Afanasyev about 7 years ago. Updated over 4 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Security
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

I think we should (re-)introduce several helpers to simplify several common KeyChain operations, either directly inside KeyChain or as a stand-alone helpers. For example, the following has been introduced in NDNS:

class CertHelper
{
public:
  static security::Identity
  getIdentity(const KeyChain& keyChain, const Name& identityName);

  static bool
  doesIdentityExist(const KeyChain& keyChain, const Name& identityName);

  static Name
  getIdentityNameFromCert(const Name& certName);

  static security::v2::Certificate
  getCertificate(const KeyChain& keyChain,
                 const Name& identity,
                 const Name& certName);

  static security::v2::Certificate
  getCertificate(const KeyChain& keyChain,
                 const Name& certName);

  static const Name&
  getDefaultKeyNameOfIdentity(const KeyChain& keyChain, const Name& identityName);

  static const Name&
  getDefaultCertificateNameOfIdentity(const KeyChain& keyChain, const Name& identityName);

  static security::v2::Certificate
  createCertificate(KeyChain& keyChain,
                    const security::Key& key,
                    const security::Key& signingKey,
                    const std::string& issuer,
                    const time::seconds& certValidity = time::days(10));
};
Actions

Also available in: Atom PDF