4
0
mirror of https://github.com/QuasarApp/qca.git synced 2025-05-12 18:49:34 +00:00

convenience methods to set certs from keybundle

svn path=/trunk/kdesupport/qca/; revision=684113
This commit is contained in:
Justin Karneges 2007-07-06 07:16:11 +00:00
parent db1e37e29d
commit 4ad52e4ebb
4 changed files with 23 additions and 0 deletions

@ -348,6 +348,13 @@ public:
*/
void setCertificate(const CertificateChain &cert, const PrivateKey &key);
/**
\overload
Allows setting a certificate from a KeyBundle.
*/
void setCertificate(const KeyBundle &kb);
/**
Return the trusted certificates set for this object
*/

@ -136,6 +136,11 @@ public:
*/
void setX509PrivateKey(const PrivateKey &k);
/**
Set the public and private part of this X.509 key with KeyBundle.
*/
void setX509KeyBundle(const KeyBundle &kb);
/**
Test if this key contains a private key part
*/

@ -649,6 +649,11 @@ void TLS::setCertificate(const CertificateChain &cert, const PrivateKey &key)
d->c->setCertificate(cert, key);
}
void TLS::setCertificate(const KeyBundle &kb)
{
setCertificate(kb.certificateChain(), kb.privateKey());
}
CertificateCollection TLS::trustedCertificates() const
{
return d->trusted;

@ -139,6 +139,12 @@ void SecureMessageKey::setX509PrivateKey(const PrivateKey &k)
d->cert_sec = k;
}
void SecureMessageKey::setX509KeyBundle(const KeyBundle &kb)
{
setX509CertificateChain(kb.certificateChain());
setX509PrivateKey(kb.privateKey());
}
bool SecureMessageKey::havePrivate() const
{
if(d->type == SecureMessageKey::PGP && !d->pgp_sec.isNull())