some minor changes accorfing o what's really needed/supported; refs #28

master
Marc Wäckerlin 11 years ago
parent b2406a1750
commit fb78247bc3
  1. 6
      src/cardgui.cxx
  2. 20
      src/cardos.hxx
  3. 20
      src/suisseid.hxx

@ -10,7 +10,11 @@
#include <mrw/vector.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) {
QApplication app(argc, argv);

@ -1084,37 +1084,37 @@ namespace cardos {
//@{
/// Path to MF
std::string mf() {
return crypto::hexToBin("3f00");
static std::string mf() {
return "3f00";
}
/// Path to PKCS#15
std::string pkcs15() {
return crypto::hexToBin("5015");
static std::string pkcs15() {
return mf()+"5015";
}
/// Path to SigG (Signaturgesetz)
std::string sigG() {
return crypto::hexToBin("1fff");
static std::string sigG() {
return mf()+"1fff";
}
/// ID of transport PIN
unsigned char transportPin() {
static unsigned char transportPin() {
return 0x71;
}
/// ID of PKCS#15 user PIN
unsigned char pkcs15Pin() {
static unsigned char pkcs15Pin() {
return 0x01;
}
/// ID of SigG (Signaturgesetz) secure PIN
unsigned char sigGPin() {
static unsigned char sigGPin() {
return 0x01;
}
/// ID of PUK to unlock PKCS#15 user PIN
unsigned char puk() {
static unsigned char puk() {
return 0x02;
}

@ -173,9 +173,9 @@ namespace suisseid {
/** @note by now, only @c MISSING and @c VALID is supported */
enum CertStatus {
MISSING, ///< certificate is missing, needs initiatlization
EXPIRES_SOON, ///< certificate will soon expire, needs renewal
EXPIRED, ///< certificate is expired, needs new purchase
REVOKED, ///< certificate has been revoked and is invalid
// EXPIRES_SOON, ///< certificate will soon expire, needs renewal
// EXPIRED, ///< certificate is expired, needs new purchase
// REVOKED, ///< certificate has been revoked and is invalid
VALID ///< certificate is valid
};
@ -311,11 +311,15 @@ namespace suisseid {
}
virtual CertStatus certStatus() {
cryptoki::ObjectList certs
(session().find(cryptoki::Attribute(CKA_CLASS)
.from<CK_OBJECT_CLASS>(CKO_CERTIFICATE)));
if (certs.size()==0) return MISSING;
return VALID;
try {
Certificate auth(authenticationCertificate());
Certificate sig(digitalSignatureCertificate());
return VALID;
} catch (const no_auth& x) {
return MISSING;
} catch (const no_digsig& x) {
return MISSING;
}
}
virtual Certificate authenticationCertificate() try {

Loading…
Cancel
Save