some minor changes accorfing o what's really needed/supported; refs #28
This commit is contained in:
@@ -10,7 +10,11 @@
|
|||||||
#include <mrw/vector.hxx>
|
#include <mrw/vector.hxx>
|
||||||
#include <mrw/args.hxx>
|
#include <mrw/args.hxx>
|
||||||
|
|
||||||
#include <QApplication>
|
#if QT_VERSION >= 0x050000
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
|
#else
|
||||||
|
#include <QtGui/QApplication>
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
@@ -1084,37 +1084,37 @@ namespace cardos {
|
|||||||
//@{
|
//@{
|
||||||
|
|
||||||
/// Path to MF
|
/// Path to MF
|
||||||
std::string mf() {
|
static std::string mf() {
|
||||||
return crypto::hexToBin("3f00");
|
return "3f00";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Path to PKCS#15
|
/// Path to PKCS#15
|
||||||
std::string pkcs15() {
|
static std::string pkcs15() {
|
||||||
return crypto::hexToBin("5015");
|
return mf()+"5015";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Path to SigG (Signaturgesetz)
|
/// Path to SigG (Signaturgesetz)
|
||||||
std::string sigG() {
|
static std::string sigG() {
|
||||||
return crypto::hexToBin("1fff");
|
return mf()+"1fff";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ID of transport PIN
|
/// ID of transport PIN
|
||||||
unsigned char transportPin() {
|
static unsigned char transportPin() {
|
||||||
return 0x71;
|
return 0x71;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ID of PKCS#15 user PIN
|
/// ID of PKCS#15 user PIN
|
||||||
unsigned char pkcs15Pin() {
|
static unsigned char pkcs15Pin() {
|
||||||
return 0x01;
|
return 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ID of SigG (Signaturgesetz) secure PIN
|
/// ID of SigG (Signaturgesetz) secure PIN
|
||||||
unsigned char sigGPin() {
|
static unsigned char sigGPin() {
|
||||||
return 0x01;
|
return 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ID of PUK to unlock PKCS#15 user PIN
|
/// ID of PUK to unlock PKCS#15 user PIN
|
||||||
unsigned char puk() {
|
static unsigned char puk() {
|
||||||
return 0x02;
|
return 0x02;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -173,9 +173,9 @@ namespace suisseid {
|
|||||||
/** @note by now, only @c MISSING and @c VALID is supported */
|
/** @note by now, only @c MISSING and @c VALID is supported */
|
||||||
enum CertStatus {
|
enum CertStatus {
|
||||||
MISSING, ///< certificate is missing, needs initiatlization
|
MISSING, ///< certificate is missing, needs initiatlization
|
||||||
EXPIRES_SOON, ///< certificate will soon expire, needs renewal
|
// EXPIRES_SOON, ///< certificate will soon expire, needs renewal
|
||||||
EXPIRED, ///< certificate is expired, needs new purchase
|
// EXPIRED, ///< certificate is expired, needs new purchase
|
||||||
REVOKED, ///< certificate has been revoked and is invalid
|
// REVOKED, ///< certificate has been revoked and is invalid
|
||||||
VALID ///< certificate is valid
|
VALID ///< certificate is valid
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -311,11 +311,15 @@ namespace suisseid {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual CertStatus certStatus() {
|
virtual CertStatus certStatus() {
|
||||||
cryptoki::ObjectList certs
|
try {
|
||||||
(session().find(cryptoki::Attribute(CKA_CLASS)
|
Certificate auth(authenticationCertificate());
|
||||||
.from<CK_OBJECT_CLASS>(CKO_CERTIFICATE)));
|
Certificate sig(digitalSignatureCertificate());
|
||||||
if (certs.size()==0) return MISSING;
|
return VALID;
|
||||||
return VALID;
|
} catch (const no_auth& x) {
|
||||||
|
return MISSING;
|
||||||
|
} catch (const no_digsig& x) {
|
||||||
|
return MISSING;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Certificate authenticationCertificate() try {
|
virtual Certificate authenticationCertificate() try {
|
||||||
|
Reference in New Issue
Block a user