security: string representation for SigningInfo
Change-Id: I92b227a0d0cb89654536043f703cea9e7b40fa64
refs: #3281
diff --git a/src/security/signing-info.hpp b/src/security/signing-info.hpp
index 661276f..aaa2770 100644
--- a/src/security/signing-info.hpp
+++ b/src/security/signing-info.hpp
@@ -75,6 +75,21 @@
const SignatureInfo& signatureInfo = EMPTY_SIGNATURE_INFO);
/**
+ * @brief Construct SigningInfo from its string representation
+ *
+ * @param signingStr The representative signing string for SigningInfo signing method
+ *
+ * Structure of the representative string is as follows:
+ * - default signing: "" (empty string)
+ * - signing with a default certificate of a default key for the identity: `id:/my-identity`
+ * - signing with a default certificate of the key: `key:/my-identity/ksk-1`
+ * - signing with the certificate: `cert:/my-identity/KEY/ksk-1/ID-CERT/%FD%01`
+ * - signing with sha256 digest: `id:/localhost/identity/digest-sha256`
+ */
+ explicit
+ SigningInfo(const std::string& signingStr);
+
+ /**
* @brief Set signer as an identity with name @p identity
* @post Change the signerType to SIGNER_TYPE_ID
*/
@@ -166,6 +181,9 @@
SignatureInfo m_info;
};
+std::ostream&
+operator<<(std::ostream& os, const SigningInfo& si);
+
} // namespace security
} // namespace ndn