Exemple #1
0
Name
IdentityManager::generateRSAKeyPair(const Name& identityName, bool isKsk, int keySize)
{
  Name keyName = generateKeyPair(identityName, isKsk, RsaKeyParams(keySize));

  return keyName;
}
Exemple #2
0
Name
IdentityManager::generateRSAKeyPairAsDefault(const Name& identityName, bool isKsk, int keySize)
{
  Name keyName = generateKeyPair(identityName, isKsk, RsaKeyParams(keySize));

  identityStorage_->setDefaultKeyNameForIdentity(keyName, identityName);

  return keyName;
}
Exemple #3
0
BOOST_FIXTURE_TEST_CASE(IdCert, IdCertFixture)
{
  Name identity("/TestIo/IdCert");
  identity.appendVersion();
  BOOST_REQUIRE(addIdentity(identity, RsaKeyParams()));
  Name certName = m_keyChain.getDefaultCertificateNameForIdentity(identity);
  shared_ptr<security::v1::IdentityCertificate> idCert;
  BOOST_REQUIRE_NO_THROW(idCert = m_keyChain.getCertificate(certName));

  io::save(*idCert, filename);
  shared_ptr<security::v1::IdentityCertificate> readCert = io::load<security::v1::IdentityCertificate>(filename);

  BOOST_REQUIRE(readCert != nullptr);
  BOOST_CHECK_EQUAL(idCert->getName(), readCert->getName());
}