20 #include <hicn/transport/auth/signer.h>
24 #include <openssl/pkcs12.h>
25 #include <openssl/rand.h>
26 #include <openssl/x509.h>
27 #include <openssl/x509v3.h>
39 Identity(
const std::string &keystore_path,
const std::string &keystore_pwd,
40 CryptoSuite suite,
unsigned int signature_len,
41 unsigned int validity_days,
const std::string &subject_name);
44 Identity(std::string &keystore_path, std::string &keystore_pwd,
45 CryptoHashType hash_type);
52 std::shared_ptr<AsymmetricSigner> getSigner()
const;
55 std::string getFilename()
const;
58 std::string getPassword()
const;
60 std::shared_ptr<X509> getCertificate()
const;
62 std::shared_ptr<EVP_PKEY> getPrivateKey()
const;
65 static Identity generateIdentity(
const std::string &subject_name =
"");
68 static void free_key(EVP_PKEY *T) { EVP_PKEY_free(T); }
71 std::string filename_;
72 std::shared_ptr<AsymmetricSigner> signer_;
73 std::shared_ptr<X509> cert_;