security: Continue porting security elements to the updated framework
Change-Id: I682156142a8714b2756ca429903a19d2b9064e13
diff --git a/include/ndn-cpp/security/identity/identity-manager.hpp b/include/ndn-cpp/security/identity/identity-manager.hpp
index 702ad1f..5ed7771 100644
--- a/include/ndn-cpp/security/identity/identity-manager.hpp
+++ b/include/ndn-cpp/security/identity/identity-manager.hpp
@@ -78,6 +78,7 @@
setDefaultKeyForIdentity(const Name& keyName, const Name& identityName = Name())
{
info().setDefaultKeyNameForIdentity(keyName, identityName);
+ defaultCertificate_.reset();
}
/**
@@ -218,7 +219,10 @@
{
return info().getDefaultCertificateNameForIdentity(getDefaultIdentity());
}
-
+
+ void
+ sign(Data &data);
+
/**
* Sign the byte array data based on the certificate name.
* @param buffer The byte array to be signed.
@@ -240,6 +244,9 @@
void
signByCertificate(Data& data, const Name& certificateName);
+ void
+ signByCertificate(Data& data, const IdentityCertificate& certificate);
+
/**
* Generate a self-signed certificate for a public key.
* @param keyName The name of the public key.
@@ -253,11 +260,11 @@
*/
void
selfSign (IdentityCertificate& cert);
-
+
public:
static const ptr_lib::shared_ptr<IdentityStorage> DefaultIdentityStorage;
static const ptr_lib::shared_ptr<PrivateKeyStorage> DefaultPrivateKeyStorage;
-
+
private:
/**
* Generate a key pair for the specified identity.
@@ -276,6 +283,8 @@
private:
ptr_lib::shared_ptr<IdentityStorage> identityStorage_;
ptr_lib::shared_ptr<PrivateKeyStorage> privateKeyStorage_;
+
+ ptr_lib::shared_ptr<IdentityCertificate> defaultCertificate_;
};
inline IdentityStorage&
@@ -312,8 +321,6 @@
throw Error("PrivateKeyStorage is not assigned to IdentityManager");
return *privateKeyStorage_;
}
-
-
}