diff options
author | Mauro <you@example.com> | 2021-06-30 07:57:22 +0000 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2021-07-06 16:16:04 +0000 |
commit | 08233d44a6cfde878d7e10bca38ae935ed1c8fd5 (patch) | |
tree | 7ecc534d55bdc7e8dd15ecab084720910bcdf4d9 /libtransport/includes/hicn/transport/auth/identity.h | |
parent | 147ba39bed26887f5eba84757e2463ab8e370a9a (diff) |
[HICN-713] Transport Library Major Refactoring 2
Co-authored-by: Luca Muscariello <muscariello@ieee.org>
Co-authored-by: Michele Papalini <micpapal@cisco.com>
Co-authored-by: Olivier Roques <oroques+fdio@cisco.com>
Co-authored-by: Giulio Grassi <gigrassi@cisco.com>
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I5b2c667bad66feb45abdb5effe22ed0f6c85d1c2
Diffstat (limited to 'libtransport/includes/hicn/transport/auth/identity.h')
-rw-r--r-- | libtransport/includes/hicn/transport/auth/identity.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libtransport/includes/hicn/transport/auth/identity.h b/libtransport/includes/hicn/transport/auth/identity.h index 19157952e..be072f5d3 100644 --- a/libtransport/includes/hicn/transport/auth/identity.h +++ b/libtransport/includes/hicn/transport/auth/identity.h @@ -15,14 +15,17 @@ #pragma once +#include <errno.h> +#include <fcntl.h> #include <hicn/transport/auth/signer.h> +#include <unistd.h> extern "C" { -#include <parc/security/parc_Identity.h> -#include <parc/security/parc_IdentityFile.h> -#include <parc/security/parc_Pkcs12KeyStore.h> -#include <parc/security/parc_Security.h> -}; +#include <openssl/pkcs12.h> +#include <openssl/rand.h> +#include <openssl/x509.h> +#include <openssl/x509v3.h> +} namespace transport { namespace auth { @@ -54,12 +57,20 @@ class Identity { // Return the key store password. std::string getPassword() const; + std::shared_ptr<X509> getCertificate() const; + + std::shared_ptr<EVP_PKEY> getPrivateKey() const; + // Generate a new random identity. static Identity generateIdentity(const std::string &subject_name = ""); private: - PARCIdentity *identity_; + static void free_key(EVP_PKEY *T) { EVP_PKEY_free(T); } + + std::string pwd_; + std::string filename_; std::shared_ptr<AsymmetricSigner> signer_; + std::shared_ptr<X509> cert_; }; } // namespace auth |