mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-31 16:14:48 +02:00
fix style
This commit is contained in:
parent
a2322be390
commit
38c9328db6
@ -210,9 +210,6 @@ public:
|
|||||||
~Context();
|
~Context();
|
||||||
/// Destroys the Context.
|
/// Destroys the Context.
|
||||||
|
|
||||||
void addCertificateAuthority(const Poco::Crypto::X509Certificate& certificate);
|
|
||||||
/// Add one trusted certification authority to be used by the Context.
|
|
||||||
|
|
||||||
void useCertificate(const Poco::Crypto::X509Certificate& certificate);
|
void useCertificate(const Poco::Crypto::X509Certificate& certificate);
|
||||||
/// Sets the certificate to be used by the Context.
|
/// Sets the certificate to be used by the Context.
|
||||||
///
|
///
|
||||||
@ -226,6 +223,9 @@ public:
|
|||||||
void addChainCertificate(const Poco::Crypto::X509Certificate& certificate);
|
void addChainCertificate(const Poco::Crypto::X509Certificate& certificate);
|
||||||
/// Adds a certificate for certificate chain validation.
|
/// Adds a certificate for certificate chain validation.
|
||||||
|
|
||||||
|
void addCertificateAuthority(const Poco::Crypto::X509Certificate& certificate);
|
||||||
|
/// Add one trusted certification authority to be used by the Context.
|
||||||
|
|
||||||
void usePrivateKey(const Poco::Crypto::RSAKey& key);
|
void usePrivateKey(const Poco::Crypto::RSAKey& key);
|
||||||
/// Sets the private key to be used by the Context.
|
/// Sets the private key to be used by the Context.
|
||||||
///
|
///
|
||||||
|
@ -185,25 +185,6 @@ void Context::init(const Params& params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Context::addCertificateAuthority(const Crypto::X509Certificate &certificate)
|
|
||||||
{
|
|
||||||
if (X509_STORE* store = SSL_CTX_get_cert_store(_pSSLContext))
|
|
||||||
{
|
|
||||||
int errCode = X509_STORE_add_cert(store, const_cast<X509*>(certificate.certificate()));
|
|
||||||
if (errCode != 1)
|
|
||||||
{
|
|
||||||
std::string msg = Utility::getLastError();
|
|
||||||
throw SSLContextException("Cannot add certificate authority for Context", msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::string msg = Utility::getLastError();
|
|
||||||
throw SSLContextException("Cannot add certificate authority for Context", msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Context::useCertificate(const Poco::Crypto::X509Certificate& certificate)
|
void Context::useCertificate(const Poco::Crypto::X509Certificate& certificate)
|
||||||
{
|
{
|
||||||
int errCode = SSL_CTX_use_certificate(_pSSLContext, const_cast<X509*>(certificate.certificate()));
|
int errCode = SSL_CTX_use_certificate(_pSSLContext, const_cast<X509*>(certificate.certificate()));
|
||||||
@ -226,6 +207,25 @@ void Context::addChainCertificate(const Poco::Crypto::X509Certificate& certifica
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::addCertificateAuthority(const Crypto::X509Certificate &certificate)
|
||||||
|
{
|
||||||
|
if (X509_STORE* store = SSL_CTX_get_cert_store(_pSSLContext))
|
||||||
|
{
|
||||||
|
int errCode = X509_STORE_add_cert(store, const_cast<X509*>(certificate.certificate()));
|
||||||
|
if (errCode != 1)
|
||||||
|
{
|
||||||
|
std::string msg = Utility::getLastError();
|
||||||
|
throw SSLContextException("Cannot add certificate authority to Context", msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string msg = Utility::getLastError();
|
||||||
|
throw SSLContextException("Cannot add certificate authority to Context", msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Context::usePrivateKey(const Poco::Crypto::RSAKey& key)
|
void Context::usePrivateKey(const Poco::Crypto::RSAKey& key)
|
||||||
{
|
{
|
||||||
int errCode = SSL_CTX_use_RSAPrivateKey(_pSSLContext, key.impl()->getRSA());
|
int errCode = SSL_CTX_use_RSAPrivateKey(_pSSLContext, key.impl()->getRSA());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user