Name IdentityManager::generateRSAKeyPair(const Name& identityName, bool isKsk, int keySize) { Name keyName = generateKeyPair(identityName, isKsk, RsaKeyParams(keySize)); return keyName; }
Name IdentityManager::generateRSAKeyPairAsDefault(const Name& identityName, bool isKsk, int keySize) { Name keyName = generateKeyPair(identityName, isKsk, RsaKeyParams(keySize)); identityStorage_->setDefaultKeyNameForIdentity(keyName, identityName); return keyName; }
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()); }