All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Public Attributes | List of all members
IdentityManagementFixture Class Reference

Copyright (C) 2017-2018 Regents of the University of California. More...

#include <identity-management-fixture.hpp>

Inheritance diagram for IdentityManagementFixture:
ValidatorFixture HierarchicalValidatorFixture ValidationPolicyCommandInterestFixture

Public Member Functions

bool saveCertificateToFile (const ndn::Data &data, const std::string &filePath)
 
ndn::ptr_lib::shared_ptr
< ndn::PibIdentity
addIdentity (const ndn::Name &identityName, const ndn::KeyParams &params=ndn::KeyChain::getDefaultKeyParams())
 Add an identity for the identityName. More...
 
bool saveCertificate (ndn::PibIdentity identity, const std::string &filePath)
 Save the identity's certificate to a file. More...
 
ndn::ptr_lib::shared_ptr
< ndn::PibIdentity
addSubCertificate (const ndn::Name &subIdentityName, const ndn::ptr_lib::shared_ptr< ndn::PibIdentity > &issuer, const ndn::KeyParams &params=ndn::KeyChain::getDefaultKeyParams())
 Issue a certificate for subIdentityName signed by issuer. More...
 
ndn::ptr_lib::shared_ptr
< ndn::CertificateV2
addCertificate (ndn::ptr_lib::shared_ptr< ndn::PibKey > &key, const std::string &issuerId)
 Add a self-signed certificate made from the key and issuer ID. More...
 

Public Attributes

ndn::KeyChain keyChain_
 

Detailed Description

Copyright (C) 2017-2018 Regents of the University of California.

Author
: Jeff Thompson jefft.nosp@m.0@re.nosp@m.map.u.nosp@m.cla..nosp@m.edu From ndn-cxx unit tests: https://github.com/named-data/ndn-cxx/blob/master/tests/unit-tests/identity-management-fixture.hpp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version, with the additional exemption that compiling, linking, and/or using OpenSSL is allowed.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/. A copy of the GNU Lesser General Public License is in the file COPYING.

Member Function Documentation

ptr_lib::shared_ptr< CertificateV2 > IdentityManagementFixture::addCertificate ( ndn::ptr_lib::shared_ptr< ndn::PibKey > &  key,
const std::string &  issuerId 
)

Add a self-signed certificate made from the key and issuer ID.

Parameters
keyThe key for the certificate.
issuerIdThe issuer ID name component for the certificate name.
Returns
The new certificate.
ptr_lib::shared_ptr< PibIdentity > IdentityManagementFixture::addIdentity ( const ndn::Name identityName,
const ndn::KeyParams params = ndn::KeyChain::getDefaultKeyParams() 
)

Add an identity for the identityName.

Parameters
identityNameThe name of the identity.
params(optional) The key parameters if a key needs to be generated for the identity. If omitted, use getDefaultKeyParams().
Returns
The created PibIdentity instance.
ptr_lib::shared_ptr< PibIdentity > IdentityManagementFixture::addSubCertificate ( const ndn::Name subIdentityName,
const ndn::ptr_lib::shared_ptr< ndn::PibIdentity > &  issuer,
const ndn::KeyParams params = ndn::KeyChain::getDefaultKeyParams() 
)

Issue a certificate for subIdentityName signed by issuer.

If the identity does not exist, it is created. A new key is generated as the default key for the identity. A default certificate for the key is signed by the issuer using its default certificate.

Parameters
subIdentityNameThe name to issue the certificate for.
issuerThe identity of the signer.
params(optional) The key parameters if a key needs to be generated for the identity. If omitted, use getDefaultKeyParams().
Returns
The sub identity.
bool IdentityManagementFixture::saveCertificate ( ndn::PibIdentity  identity,
const std::string &  filePath 
)

Save the identity's certificate to a file.

Parameters
identityThe PibIdentity.
filePathThe file path, which should be writable.
Returns
True if successful.

The documentation for this class was generated from the following files: