move passphrase/pin handling into keystore, update securemessage

svn path=/trunk/kdesupport/qca/; revision=402674
This commit is contained in:
Justin Karneges 2005-04-02 17:37:52 +00:00
parent 8c35532cc4
commit 4b93c84577
5 changed files with 40 additions and 58 deletions

11
TODO
View File

@ -1,6 +1,4 @@
* Additional unit tests
* Bundle root certificates to be used on platforms without a system store
(we need to choose a reliable source, maybe mozilla or debian? kde??)
* Update to latest Botan, and remake the botantools patch as appropriate
* API documentation
@ -22,13 +20,13 @@
give all classes non-default ctors/dtors/copy/op=, and dpointers?
* finish API:
make systemstore work via keystore
pkey: ability to get the bitsize of a key
cert: subject/issuer key ids?
cert: use info as a multi-map?
pgp: get key types and bits?
dlgroup, symmetric key -> make these into provider objects, for smartcards?
qcaprovider.h
dlgroup: make it a provider object? (for smartcards)
symmetrickey: make it a provider object? (for smartcards)
finish qcaprovider.h
* build system:
get qt 4 support into qconf
@ -38,6 +36,7 @@
create qt4 qmake .prf for auto-discovery by applications
* finish code for APIs:
make systemstore work via keystore
cert: rfc 2818 hostname validation
keystore
tls
@ -60,8 +59,6 @@
figure out why Valgrind reports so many memory leaks
* possibilities for the future:
xmldsig
xmlenc (sort of done already in cutestuff/xmlsec, but need to qca-ify)
Key wrapping - RFC3217 and RFC3394
dtls (secure UDP)
quoted-printable TextFilter

View File

@ -110,10 +110,14 @@ namespace QCA
QList<KeyStore> keyStores() const;
int count() const;
void submitPassphrase(const QString &id, const QSecureArray &passphrase);
QString diagnosticText() const;
signals:
void keyStoreAvailable(const QString &id);
void keyStoreUnavailable(const QString &id);
void keyStoreUpdated(const QString &id);
void keyStoreNeedPassphrase(const QString &id);
private:
KeyStoreManager();

View File

@ -50,10 +50,10 @@ namespace QCA
Type type() const;
// pgp
QString pgpPublicKey() const;
QString pgpSecretKey() const;
void setPGPPublicKey(const QString &id, const QString &name);
void setPGPSecretKey(const QString &id);
PGPKey pgpPublicKey() const;
PGPKey pgpSecretKey() const;
void setPGPPublicKey(const PGPKey &pub);
void setPGPSecretKey(const PGPKey &sec);
// x509
CertificateChain x509CertificateChain() const;
@ -63,8 +63,7 @@ namespace QCA
// generic
bool havePrivate() const;
QString id() const;
QString name() const;
QString name() const; // pgp = primary user id, x509 = common name
private:
class Private;
@ -173,6 +172,8 @@ namespace QCA
SecureMessageSignature signer() const;
SecureMessageSignatureList signers() const;
QString diagnosticText() const;
signals:
void readyRead();
void finished();
@ -200,16 +201,6 @@ namespace QCA
~OpenPGP();
void setAllowAgent(bool);
void submitPassphrase(const QSecureArray &passphrase);
SecureMessageKeyList secretKeys() const;
SecureMessageKeyList publicKeys() const;
QString diagnosticText() const;
signals:
void keysUpdated();
void needPassphrase();
};
class SMIME : public SecureMessageSystem, public Algorithm
@ -219,7 +210,7 @@ namespace QCA
SMIME(QObject *parent = 0, const QString &provider = QString());
~SMIME();
void setTrustedCertificates(const CertificateCollection &trusted); // todo: untrusted?
void setTrustedCertificates(const CertificateCollection &trusted);
void setPrivateKeys(const QList<PrivateKey> &keys);
};
}

View File

@ -214,4 +214,15 @@ int KeyStoreManager::count() const
return 0;
}
void KeyStoreManager::submitPassphrase(const QString &id, const QSecureArray &passphrase)
{
Q_UNUSED(id);
Q_UNUSED(passphrase);
}
QString KeyStoreManager::diagnosticText() const
{
return QString();
}
}

View File

@ -52,25 +52,24 @@ SecureMessageKey::Type SecureMessageKey::type() const
return None;
}
QString SecureMessageKey::pgpPublicKey() const
PGPKey SecureMessageKey::pgpPublicKey() const
{
return QString();
return PGPKey();
}
QString SecureMessageKey::pgpSecretKey() const
PGPKey SecureMessageKey::pgpSecretKey() const
{
return QString();
return PGPKey();
}
void SecureMessageKey::setPGPPublicKey(const QString &id, const QString &name)
void SecureMessageKey::setPGPPublicKey(const PGPKey &pub)
{
Q_UNUSED(id);
Q_UNUSED(name);
Q_UNUSED(pub);
}
void SecureMessageKey::setPGPSecretKey(const QString &id)
void SecureMessageKey::setPGPSecretKey(const PGPKey &sec)
{
Q_UNUSED(id);
Q_UNUSED(sec);
}
CertificateChain SecureMessageKey::x509CertificateChain() const
@ -98,11 +97,6 @@ bool SecureMessageKey::havePrivate() const
return false;
}
QString SecureMessageKey::id() const
{
return QString();
}
QString SecureMessageKey::name() const
{
return QString();
@ -280,6 +274,11 @@ SecureMessageSignatureList SecureMessage::signers() const
return SecureMessageSignatureList();
}
QString SecureMessage::diagnosticText() const
{
return QString();
}
//----------------------------------------------------------------------------
// SecureMessageSystem
//----------------------------------------------------------------------------
@ -308,26 +307,6 @@ void OpenPGP::setAllowAgent(bool)
{
}
void OpenPGP::submitPassphrase(const QSecureArray &passphrase)
{
Q_UNUSED(passphrase);
}
SecureMessageKeyList OpenPGP::secretKeys() const
{
return SecureMessageKeyList();
}
SecureMessageKeyList OpenPGP::publicKeys() const
{
return SecureMessageKeyList();
}
QString OpenPGP::diagnosticText() const
{
return QString();
}
//----------------------------------------------------------------------------
// SMIME
//----------------------------------------------------------------------------