diff --git a/Crypto/include/Poco/Crypto/ECKeyImpl.h b/Crypto/include/Poco/Crypto/ECKeyImpl.h index 1adb50e31..380b3978e 100644 --- a/Crypto/include/Poco/Crypto/ECKeyImpl.h +++ b/Crypto/include/Poco/Crypto/ECKeyImpl.h @@ -88,13 +88,17 @@ public: std::string groupName() const; /// Returns the EC key group name. - void save(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = ""); + void save(const std::string& publicKeyFile, + const std::string& privateKeyFile = "", + const std::string& privateKeyPassphrase = "") const; /// Exports the public and private keys to the given files. /// /// If an empty filename is specified, the corresponding key /// is not exported. - void save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = ""); + void save(std::ostream* pPublicKeyStream, + std::ostream* pPrivateKeyStream = 0, + const std::string& privateKeyPassphrase = "") const; /// Exports the public and private key to the given streams. /// /// If a null pointer is passed for a stream, the corresponding @@ -130,7 +134,7 @@ inline std::string ECKeyImpl::groupName() const inline void ECKeyImpl::save(const std::string& publicKeyFile, const std::string& privateKeyFile, - const std::string& privateKeyPassphrase) + const std::string& privateKeyPassphrase) const { EVPPKey(_pEC).save(publicKeyFile, privateKeyFile, privateKeyPassphrase); } @@ -138,7 +142,7 @@ inline void ECKeyImpl::save(const std::string& publicKeyFile, inline void ECKeyImpl::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream, - const std::string& privateKeyPassphrase) + const std::string& privateKeyPassphrase) const { EVPPKey(_pEC).save(pPublicKeyStream, pPrivateKeyStream, privateKeyPassphrase); } diff --git a/Crypto/include/Poco/Crypto/EVPPKey.h b/Crypto/include/Poco/Crypto/EVPPKey.h index c82e178d3..c1d584231 100644 --- a/Crypto/include/Poco/Crypto/EVPPKey.h +++ b/Crypto/include/Poco/Crypto/EVPPKey.h @@ -95,13 +95,13 @@ public: ~EVPPKey(); /// Destroys the EVPPKey. - void save(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = ""); + void save(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = "") const; /// Exports the public and/or private keys to the given files. /// /// If an empty filename is specified, the corresponding key /// is not exported. - void save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = ""); + void save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = "") const; /// Exports the public and/or private key to the given streams. /// /// If a null pointer is passed for a stream, the corresponding diff --git a/Crypto/include/Poco/Crypto/KeyPair.h b/Crypto/include/Poco/Crypto/KeyPair.h index e8fed31c0..b9a705f8f 100644 --- a/Crypto/include/Poco/Crypto/KeyPair.h +++ b/Crypto/include/Poco/Crypto/KeyPair.h @@ -54,13 +54,17 @@ public: virtual int size() const; /// Returns the RSA modulus size. - virtual void save(const std::string& publicKeyPairFile, const std::string& privateKeyPairFile = "", const std::string& privateKeyPairPassphrase = ""); + virtual void save(const std::string& publicKeyPairFile, + const std::string& privateKeyPairFile = "", + const std::string& privateKeyPairPassphrase = "") const; /// Exports the public and private keys to the given files. /// /// If an empty filename is specified, the corresponding key /// is not exported. - virtual void save(std::ostream* pPublicKeyPairStream, std::ostream* pPrivateKeyPairStream = 0, const std::string& privateKeyPairPassphrase = ""); + virtual void save(std::ostream* pPublicKeyPairStream, + std::ostream* pPrivateKeyPairStream = 0, + const std::string& privateKeyPairPassphrase = "") const; /// Exports the public and private key to the given streams. /// /// If a null pointer is passed for a stream, the corresponding @@ -90,13 +94,17 @@ inline int KeyPair::size() const } -inline void KeyPair::save(const std::string& publicKeyFile, const std::string& privateKeyFile, const std::string& privateKeyPassphrase) +inline void KeyPair::save(const std::string& publicKeyFile, + const std::string& privateKeyFile, + const std::string& privateKeyPassphrase) const { _pImpl->save(publicKeyFile, privateKeyFile, privateKeyPassphrase); } -inline void KeyPair::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream, const std::string& privateKeyPassphrase) +inline void KeyPair::save(std::ostream* pPublicKeyStream, + std::ostream* pPrivateKeyStream, + const std::string& privateKeyPassphrase) const { _pImpl->save(pPublicKeyStream, pPrivateKeyStream, privateKeyPassphrase); } diff --git a/Crypto/include/Poco/Crypto/KeyPairImpl.h b/Crypto/include/Poco/Crypto/KeyPairImpl.h index b8d017e60..e6320df04 100644 --- a/Crypto/include/Poco/Crypto/KeyPairImpl.h +++ b/Crypto/include/Poco/Crypto/KeyPairImpl.h @@ -53,13 +53,17 @@ public: virtual int size() const = 0; /// Returns the key size. - virtual void save(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = "") = 0; + virtual void save(const std::string& publicKeyFile, + const std::string& privateKeyFile = "", + const std::string& privateKeyPassphrase = "") const = 0; /// Exports the public and private keys to the given files. /// /// If an empty filename is specified, the corresponding key /// is not exported. - virtual void save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = "") = 0; + virtual void save(std::ostream* pPublicKeyStream, + std::ostream* pPrivateKeyStream = 0, + const std::string& privateKeyPassphrase = "") const = 0; /// Exports the public and private key to the given streams. /// /// If a null pointer is passed for a stream, the corresponding diff --git a/Crypto/include/Poco/Crypto/RSAKey.h b/Crypto/include/Poco/Crypto/RSAKey.h index e40e0e167..ad9163ed4 100644 --- a/Crypto/include/Poco/Crypto/RSAKey.h +++ b/Crypto/include/Poco/Crypto/RSAKey.h @@ -68,7 +68,9 @@ public: /// Creates the RSAKey. Creates a new public/private keypair using the given parameters. /// Can be used to sign data and verify signatures. - RSAKey(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = ""); + RSAKey(const std::string& publicKeyFile, + const std::string& privateKeyFile = "", + const std::string& privateKeyPassphrase = ""); /// Creates the RSAKey, by reading public and private key from the given files and /// using the given passphrase for the private key. /// @@ -77,7 +79,9 @@ public: /// If a private key is specified, you don't need to specify a public key file. /// OpenSSL will auto-create the public key from the private key. - RSAKey(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = ""); + RSAKey(std::istream* pPublicKeyStream, + std::istream* pPrivateKeyStream = 0, + const std::string& privateKeyPassphrase = ""); /// Creates the RSAKey, by reading public and private key from the given streams and /// using the given passphrase for the private key. /// diff --git a/Crypto/include/Poco/Crypto/RSAKeyImpl.h b/Crypto/include/Poco/Crypto/RSAKeyImpl.h index ee1c29380..035881636 100644 --- a/Crypto/include/Poco/Crypto/RSAKeyImpl.h +++ b/Crypto/include/Poco/Crypto/RSAKeyImpl.h @@ -94,13 +94,17 @@ public: ByteVec decryptionExponent() const; /// Returns the RSA decryption exponent. - void save(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = ""); + void save(const std::string& publicKeyFile, + const std::string& privateKeyFile = "", + const std::string& privateKeyPassphrase = "") const; /// Exports the public and private keys to the given files. /// /// If an empty filename is specified, the corresponding key /// is not exported. - void save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = ""); + void save(std::ostream* pPublicKeyStream, + std::ostream* pPrivateKeyStream = 0, + const std::string& privateKeyPassphrase = "") const; /// Exports the public and private key to the given streams. /// /// If a null pointer is passed for a stream, the corresponding diff --git a/Crypto/src/EVPPKey.cpp b/Crypto/src/EVPPKey.cpp index 1600e44e3..81d2f6768 100644 --- a/Crypto/src/EVPPKey.cpp +++ b/Crypto/src/EVPPKey.cpp @@ -107,7 +107,7 @@ EVPPKey::~EVPPKey() } -void EVPPKey::save(const std::string& publicKeyFile, const std::string& privateKeyFile, const std::string& privateKeyPassphrase) +void EVPPKey::save(const std::string& publicKeyFile, const std::string& privateKeyFile, const std::string& privateKeyPassphrase) const { if (!publicKeyFile.empty()) { @@ -166,7 +166,7 @@ void EVPPKey::save(const std::string& publicKeyFile, const std::string& privateK } -void EVPPKey::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream, const std::string& privateKeyPassphrase) +void EVPPKey::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream, const std::string& privateKeyPassphrase) const { if (pPublicKeyStream) { diff --git a/Crypto/src/RSAKeyImpl.cpp b/Crypto/src/RSAKeyImpl.cpp index 777f1dce1..15e65ecce 100644 --- a/Crypto/src/RSAKeyImpl.cpp +++ b/Crypto/src/RSAKeyImpl.cpp @@ -271,7 +271,7 @@ RSAKeyImpl::ByteVec RSAKeyImpl::decryptionExponent() const void RSAKeyImpl::save(const std::string& publicKeyFile, const std::string& privateKeyFile, - const std::string& privateKeyPassphrase) + const std::string& privateKeyPassphrase) const { if (!publicKeyFile.empty()) { @@ -325,7 +325,7 @@ void RSAKeyImpl::save(const std::string& publicKeyFile, void RSAKeyImpl::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream, - const std::string& privateKeyPassphrase) + const std::string& privateKeyPassphrase) const { if (pPublicKeyStream) { diff --git a/openssl b/openssl index 91c24b802..26b1673ca 160000 --- a/openssl +++ b/openssl @@ -1 +1 @@ -Subproject commit 91c24b8028baf6cc91e77e154d6a90a850bcb558 +Subproject commit 26b1673caad94a702b6d694f48f917a283b30777