diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2020-02-21 17:30:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2020-02-21 17:30:49 +0000 |
commit | e1135db42f05a94c6790c8650a3ac20396e0d78c (patch) | |
tree | 65b48490ced07f11597aedc2b752381b0d9e4b30 /libtransport/src/hicn/transport/utils/signer.h | |
parent | 1b9512282a5324b2bd2b28b8e5555e15676cb54c (diff) | |
parent | 35058cdfe0134c88f1aa8d23342d1d7b9d39e296 (diff) |
Merge "[HICN-2] Added P2P confidential communication on hICN"
Diffstat (limited to 'libtransport/src/hicn/transport/utils/signer.h')
-rw-r--r-- | libtransport/src/hicn/transport/utils/signer.h | 25 |
1 files changed, 22 insertions, 3 deletions
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 <parc/security/parc_CryptoSuite.h> #include <parc/security/parc_KeyStore.h> #include <parc/security/parc_Signer.h> +#include <parc/security/parc_SymmetricKeySigner.h> } 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]; }; |