diff --git a/ndn-cpp/security/identity/identity-manager.cpp b/ndn-cpp/security/identity/identity-manager.cpp
index a5adfc3..e6446cd 100644
--- a/ndn-cpp/security/identity/identity-manager.cpp
+++ b/ndn-cpp/security/identity/identity-manager.cpp
@@ -5,7 +5,9 @@
  * See COPYING for copyright and distribution information.
  */
 
+#include "../../util/logging.hpp"
 #include "../../sha256-with-rsa-signature.hpp"
+#include "../security-exception.hpp"
 #include "identity-manager.hpp"
 
 using namespace std;
@@ -13,6 +15,68 @@
 
 namespace ndn {
 
+Name
+IdentityManager::createIdentity(const Name& identityName) 
+{
+  if (!identityStorage_->doesIdentityExist(identityName)) {
+  	_LOG_DEBUG("Create Identity");
+	  identityStorage_->addIdentity(identityName);
+	
+	  _LOG_DEBUG("Create Default RSA key pair");
+	  Name keyName = generateRSAKeyPairAsDefault(identityName, true);
+
+  	_LOG_DEBUG("Create self-signed certificate");
+	  shared_ptr<Certificate> selfCert = selfSign(keyName); 
+	
+	  _LOG_DEBUG("Add self-signed certificate as default");
+	  addCertificateAsDefault(*selfCert);
+
+    return keyName;
+  }
+  else
+    throw SecurityException("Identity has already been created!");
+}
+
+Name
+IdentityManager::generateRSAKeyPair(const Name& identityName, bool isKsk, int keySize)
+{
+  Name keyName = generateKeyPair(identityName, isKsk, KEY_TYPE_RSA, keySize);
+  _LOG_DEBUG("OK2");
+  return keyName;
+}
+
+Name
+IdentityManager::generateRSAKeyPairAsDefault(const Name& identityName, bool isKsk, int keySize)
+{
+  Name keyName = generateKeyPair(identityName, isKsk, KEY_TYPE_RSA, keySize);
+  
+  identityStorage_->setDefaultKeyNameForIdentity(keyName, identityName);
+  
+  return keyName;  
+}
+
+void
+IdentityManager::setDefaultCertificateForKey(const Name& certificateName)
+{
+  Name keyName = identityStorage_->getKeyNameForCertificate(certificateName);
+    
+  if (!identityStorage_->doesKeyExist(keyName))
+    throw SecurityException("No corresponding Key record for certificaite!");
+
+  identityStorage_->setDefaultCertificateNameForKey (keyName, certificateName);
+}
+
+void
+IdentityManager::addCertificateAsIdentityDefault(const Certificate& certificate)
+{
+  identityStorage_->addCertificate(certificate);
+
+  Name keyName = identityStorage_->getKeyNameForCertificate(certificate.getName());
+    
+  setDefaultKeyForIdentity(keyName);
+  setDefaultCertificateForKey(certificate.getName());
+}
+
 void 
 IdentityManager::signByCertificate(Data &data, const Name &certificateName, WireFormat& wireFormat)
 {
@@ -43,4 +107,28 @@
   data.wireEncode(wireFormat);  
 }
 
+Name
+IdentityManager::generateKeyPair (const Name& identityName, bool isKsk, KeyType keyType, int keySize)
+{
+  _LOG_DEBUG("Get new key ID");    
+  Name keyName = identityStorage_->getNewKeyName(identityName, isKsk);
+
+  _LOG_DEBUG("Generate key pair in private storage");
+  privateKeyStorage_->generateKeyPair(keyName.toUri(), keyType, keySize);
+
+  _LOG_DEBUG("Create a key record in public storage");
+  shared_ptr<PublicKey> publicKey = privateKeyStorage_->getPublicKey(keyName);
+  identityStorage_->addKey(keyName, keyType, publicKey->getKeyDer());
+  _LOG_DEBUG("OK");
+  return keyName;
+}
+
+shared_ptr<Certificate>
+IdentityManager::selfSign (const Name& keyName)
+{
+#if 1
+  throw std::runtime_error("MemoryIdentityStorage::getNewKeyName not implemented");
+#endif  
+}
+  
 }
