diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-17 16:52:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-17 16:52:45 +0100 |
| commit | 9026320cc48e9c200d33aae9e8f601f29542e186 (patch) | |
| tree | ab1f49dd88bf2b1006ca42fd7f753f46aca03fa6 /src/signer.cc | |
| parent | 3d77daab7639c06d1cdbeb852559fc4be5671819 (diff) | |
Get Signer to take a PEM string rather than a filename.
Diffstat (limited to 'src/signer.cc')
| -rw-r--r-- | src/signer.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/signer.cc b/src/signer.cc index 8f0114a2..a0d9912a 100644 --- a/src/signer.cc +++ b/src/signer.cc @@ -114,7 +114,10 @@ Signer::add_signature_value (xmlpp::Node* parent, string ns) const throw MiscError ("could not create signature context"); } - signature_context->signKey = xmlSecCryptoAppKeyLoad (_key.string().c_str(), xmlSecKeyDataFormatPem, 0, 0, 0); + signature_context->signKey = xmlSecCryptoAppKeyLoadMemory ( + reinterpret_cast<const unsigned char *> (_key.c_str()), _key.size(), xmlSecKeyDataFormatPem, 0, 0, 0 + ); + if (signature_context->signKey == 0) { throw FileError ("could not load private key file", _key, 0); } |
