From 35058cdfe0134c88f1aa8d23342d1d7b9d39e296 Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Tue, 7 Jan 2020 11:46:02 +0100 Subject: [HICN-2] Added P2P confidential communication on hICN P2P confidential communications exploit the TLS 1.3 protocol to let a consumer to establish a secure communication on an hICN name. Currently we don't support the consumer authentication (mutual authentication in TLS) and the 0-rtt session establishment. Change-Id: I2be073847c08a17f28c837d444081920c5e57a07 Signed-off-by: Alberto Compagno Signed-off-by: Olivier Roques Signed-off-by: Mauro Sardara --- libtransport/src/hicn/transport/utils/signer.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'libtransport/src/hicn/transport/utils/signer.h') diff --git a/libtransport/src/hicn/transport/utils/signer.h b/libtransport/src/hicn/transport/utils/signer.h index 6afb9544c..31b21462b 100644 --- a/libtransport/src/hicn/transport/utils/signer.h +++ b/libtransport/src/hicn/transport/utils/signer.h @@ -22,6 +22,7 @@ extern "C" { #include #include #include +#include } namespace utils { @@ -42,7 +43,17 @@ class Signer { * use to sign packet with this Signer. * @param suite CryptoSuite to use to verify the signature */ - Signer(PARCKeyStore *keyStore, PARCCryptoSuite suite); + Signer(PARCKeyStore *keyStore, CryptoSuite suite); + + /** + * Create a Signer + * + * @param passphrase A string from which the symmetric key will be derived + * @param suite CryptoSuite to use to verify the signature + */ + Signer(const std::string &passphrase, CryptoSuite suite); + + Signer(const PARCSigner *signer, CryptoSuite suite); Signer(const PARCSigner *signer); @@ -60,11 +71,19 @@ class Signer { */ void sign(Packet &packet); + size_t getSignatureLength(); + PARCKeyStore *getKeyStore(); private: - PARCSigner *signer_; - PARCKeyId *key_id_; + PARCBufferComposer *composer_ = nullptr; + PARCBuffer *key_buffer_ = nullptr; + PARCSymmetricKeyStore *symmetricKeyStore_ = nullptr; + PARCSigner *signer_ = nullptr; + PARCSignature *signature_ = nullptr; + PARCKeyId *key_id_ = nullptr; + CryptoSuite suite_; + size_t signature_length_; static uint8_t zeros[200]; }; -- cgit 1.2.3-korg