summaryrefslogtreecommitdiffstats
path: root/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-10-24 10:27:26 +0200
committerTomaž Vajngerl <quikee@gmail.com>2018-10-29 22:15:56 +0100
commit2286137c40a2abb26d36beb906962baffd779312 (patch)
tree77bc27b78932a106aaedd1815d3526b393f6f43b /xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx
parenttdf#114700 Single marker files are needed for HiDPI display (diff)
downloadcore-2286137c40a2abb26d36beb906962baffd779312.tar.gz
core-2286137c40a2abb26d36beb906962baffd779312.zip
fix importing the certificate and private key
If importing the certificate and private key is done separately, they don't associate with each other, so with this you can add the private key to the certificate that it belongs to. If the private key is set in this way, then getPrivateKey() call doesn't look into the database but just returns the private key stored in the member variable. Additionally use CERT_DecodeCertFromPackage to import the DER certificate from the imput as CERT_DecodeDERCertificate doesn't import a complete certificate and doesn't add it into the certificate database. Change-Id: I29876030f167cc5fa6b887f9bfeb0b84622c751e Reviewed-on: https://gerrit.libreoffice.org/62271 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx')
-rw-r--r--xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx
index 6e2b8a472068..64c76972bf83 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx
@@ -40,7 +40,8 @@ class X509Certificate_NssImpl : public ::cppu::WeakImplHelper<
css::lang::XServiceInfo > , public xmlsecurity::Certificate
{
private:
- CERTCertificate* m_pCert ;
+ CERTCertificate* m_pCert;
+ SECKEYPrivateKey* m_pPrivateKey;
public:
X509Certificate_NssImpl() ;
@@ -93,8 +94,11 @@ class X509Certificate_NssImpl : public ::cppu::WeakImplHelper<
//Helper methods
void setCert( CERTCertificate* cert ) ;
const CERTCertificate* getNssCert() const ;
+
/// @throws css::uno::RuntimeException
void setRawCert( const css::uno::Sequence< sal_Int8 >& rawCert ) ;
+ void setCustomPrivateKey(SECKEYPrivateKey* pPrivateKey);
+ SECKEYPrivateKey* getPrivateKey();
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;