security: Preliminary work with security module changes
Change-Id: I36d86ac22fdc8aa71eed229236673993753489a2
diff --git a/include/ndn-cpp/security/identity/private-key-storage.hpp b/include/ndn-cpp/security/identity/private-key-storage.hpp
index 90556bd..c789d89 100644
--- a/include/ndn-cpp/security/identity/private-key-storage.hpp
+++ b/include/ndn-cpp/security/identity/private-key-storage.hpp
@@ -10,13 +10,13 @@
#define NDN_PRIVATE_KEY_STORAGE_HPP
#include <string>
-#include "../../util/blob.hpp"
-#include "../certificate/public-key.hpp"
#include "../security-common.hpp"
#include "../../name.hpp"
namespace ndn {
+class PublicKey;
+
class PrivateKeyStorage {
public:
/**
@@ -50,15 +50,9 @@
* @param digestAlgorithm the digest algorithm.
* @return The signature, or a null pointer if signing fails.
*/
- virtual Blob
+ virtual ConstBufferPtr
sign(const uint8_t *data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256) = 0;
- Blob
- sign(const Blob& data, const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256)
- {
- return sign(data.buf(), data.size(), keyName, digestAlgorithm);
- }
-
/**
* Decrypt data.
* @param keyName The name of the decrypting key.
@@ -67,15 +61,9 @@
* @param isSymmetric If true symmetric encryption is used, otherwise asymmetric encryption is used.
* @return The decrypted data.
*/
- virtual Blob
+ virtual ConstBufferPtr
decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric = false) = 0;
- Blob
- decrypt(const Name& keyName, const Blob& data, bool isSymmetric = false)
- {
- return decrypt(keyName, data.buf(), data.size(), isSymmetric);
- }
-
/**
* Encrypt data.
* @param keyName The name of the encrypting key.
@@ -84,15 +72,9 @@
* @param isSymmetric If true symmetric encryption is used, otherwise asymmetric encryption is used.
* @return The encrypted data.
*/
- virtual Blob
+ virtual ConstBufferPtr
encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric = false) = 0;
- Blob
- encrypt(const Name& keyName, const Blob& data, bool isSymmetric = false)
- {
- return encrypt(keyName, data.buf(), data.size(), isSymmetric);
- }
-
/**
* @brief Generate a symmetric key.
* @param keyName The name of the key.