mirror of
https://github.com/QuasarApp/qca.git
synced 2025-04-29 13:04:31 +00:00
spkac stuff
svn path=/trunk/kdesupport/qca/; revision=379548
This commit is contained in:
parent
c166d35345
commit
282d1bf00a
3
TODO
3
TODO
@ -32,7 +32,7 @@
|
|||||||
cipher - needs to handling padding
|
cipher - needs to handling padding
|
||||||
mac
|
mac
|
||||||
pkey
|
pkey
|
||||||
cert/crl/store (don't forget to call detach())
|
cert/crl/store/csr/ca/etc (don't forget to call detach())
|
||||||
tls
|
tls
|
||||||
sasl
|
sasl
|
||||||
openpgp
|
openpgp
|
||||||
@ -56,7 +56,6 @@
|
|||||||
|
|
||||||
* consider new APIs:
|
* consider new APIs:
|
||||||
cert/pkey: fingerprints (is there a standard for this?)
|
cert/pkey: fingerprints (is there a standard for this?)
|
||||||
rsa: toSPKAC (kiko)
|
|
||||||
pkey: ability to choose cipher for toDER/PEM passphrase?
|
pkey: ability to choose cipher for toDER/PEM passphrase?
|
||||||
personalbundle: cert chain vs cert + trusted certs?
|
personalbundle: cert chain vs cert + trusted certs?
|
||||||
|
|
||||||
|
@ -32,10 +32,20 @@ namespace QCA
|
|||||||
class PublicKey;
|
class PublicKey;
|
||||||
class PrivateKey;
|
class PrivateKey;
|
||||||
|
|
||||||
|
enum CertificateRequestFormat
|
||||||
|
{
|
||||||
|
CSR_PKCS10, // standard PKCS#10 format
|
||||||
|
CSR_SPKAC // Netscape format
|
||||||
|
};
|
||||||
|
|
||||||
|
// note: in SPKAC mode, all options are ignored except for challenge
|
||||||
class QCA_EXPORT CertificateOptions
|
class QCA_EXPORT CertificateOptions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CertificateOptions();
|
CertificateOptions(CertificateRequestFormat = CSR_PKCS10);
|
||||||
|
|
||||||
|
CertificateRequestFormat format() const;
|
||||||
|
void setFormat(CertificateRequestFormat f);
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
@ -127,18 +137,23 @@ namespace QCA
|
|||||||
|
|
||||||
bool isNull() const;
|
bool isNull() const;
|
||||||
|
|
||||||
|
CertificateRequestFormat format() const;
|
||||||
PublicKey subjectPublicKey() const;
|
PublicKey subjectPublicKey() const;
|
||||||
bool isCA() const;
|
bool isCA() const; // PKCS#10 only
|
||||||
int pathLimit() const;
|
int pathLimit() const; // PKCS#10 only
|
||||||
QString challenge() const;
|
QString challenge() const;
|
||||||
|
|
||||||
SignAlgo signatureAlgorithm() const;
|
SignAlgo signatureAlgorithm() const;
|
||||||
|
|
||||||
// import / export
|
// import / export - PKCS#10 only
|
||||||
QSecureArray toDER() const;
|
QSecureArray toDER() const;
|
||||||
QString toPEM() const;
|
QString toPEM() const;
|
||||||
static CertificateRequest fromDER(const QSecureArray &a, const QString &provider = QString());
|
static CertificateRequest fromDER(const QSecureArray &a, const QString &provider = QString());
|
||||||
static CertificateRequest fromPEM(const QString &s, const QString &provider = QString());
|
static CertificateRequest fromPEM(const QString &s, const QString &provider = QString());
|
||||||
|
|
||||||
|
// import / export - SPKAC only
|
||||||
|
QString toString() const;
|
||||||
|
static CertificateRequest fromString(const QString &s, const QString &provider = QString());
|
||||||
};
|
};
|
||||||
|
|
||||||
class QCA_EXPORT CRLEntry
|
class QCA_EXPORT CRLEntry
|
||||||
|
@ -33,8 +33,19 @@ Provider::Context *getContext(const QString &type, const QString &provider);
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// CertificateOptions
|
// CertificateOptions
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
CertificateOptions::CertificateOptions()
|
CertificateOptions::CertificateOptions(CertificateRequestFormat f)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
CertificateRequestFormat CertificateOptions::format() const
|
||||||
|
{
|
||||||
|
return CSR_PKCS10;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CertificateOptions::setFormat(CertificateRequestFormat f)
|
||||||
|
{
|
||||||
|
Q_UNUSED(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CertificateOptions::isValid() const
|
bool CertificateOptions::isValid() const
|
||||||
@ -403,6 +414,11 @@ bool CertificateRequest::isNull() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CertificateRequestFormat CertificateRequest::format() const
|
||||||
|
{
|
||||||
|
return CSR_PKCS10;
|
||||||
|
}
|
||||||
|
|
||||||
PublicKey CertificateRequest::subjectPublicKey() const
|
PublicKey CertificateRequest::subjectPublicKey() const
|
||||||
{
|
{
|
||||||
return PublicKey();
|
return PublicKey();
|
||||||
@ -452,6 +468,18 @@ CertificateRequest CertificateRequest::fromPEM(const QString &s, const QString &
|
|||||||
return CertificateRequest();
|
return CertificateRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CertificateRequest::toString() const
|
||||||
|
{
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
CertificateRequest CertificateRequest::fromString(const QString &s, const QString &provider)
|
||||||
|
{
|
||||||
|
Q_UNUSED(s);
|
||||||
|
Q_UNUSED(provider);
|
||||||
|
return CertificateRequest();
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// CRLEntry
|
// CRLEntry
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user