mirror of
https://github.com/chris2511/xca.git
synced 2026-09-14 11:06:19 +05:00
- if PublicKey or Cert CKA_LABEL fails, try CKA_SUBJECT - don't use CKA_VALUE attribute on PUBLIC_KEY, because not everyone supports it. While being at it, add code for DSA and EC Cards. - load PKCS#11 engine only after database open. - avoid reloading the DLL on windows, because it is not supported. Windows users need to restart XCA after changing the PKCS#11 path - fix getSlotList() and return a QList<unsigned long>
54 lines
865 B
C++
54 lines
865 B
C++
/* vi: set sw=4 ts=4:
|
|
*
|
|
* Copyright (C) 2001 - 2007 Christian Hohnstaedt.
|
|
*
|
|
* All rights reserved.
|
|
*/
|
|
|
|
#include "pki_x509super.h"
|
|
|
|
pki_x509super::pki_x509super(const QString name)
|
|
: pki_base(name)
|
|
{
|
|
privkey = NULL;
|
|
}
|
|
|
|
pki_x509super::~pki_x509super()
|
|
{
|
|
if (privkey)
|
|
privkey->decUcount();
|
|
privkey = NULL;
|
|
}
|
|
|
|
pki_key *pki_x509super::getRefKey() const
|
|
{
|
|
return privkey;
|
|
}
|
|
|
|
void pki_x509super::setRefKey(pki_key *ref)
|
|
{
|
|
if (ref == NULL || ref->isPubKey() || privkey != NULL )
|
|
return;
|
|
pki_key *mk = getPubKey();
|
|
if (ref->compare(mk)) {
|
|
// this is our key
|
|
privkey = ref;
|
|
ref->incUcount();
|
|
}
|
|
delete mk;
|
|
}
|
|
|
|
void pki_x509super::delRefKey(pki_key *ref)
|
|
{
|
|
if (ref != privkey || ref == NULL)
|
|
return;
|
|
ref->decUcount();
|
|
privkey = NULL;
|
|
}
|
|
|
|
void pki_x509super::autoIntName()
|
|
{
|
|
x509name subject = getSubject();
|
|
setIntName(subject.getMostPopular());
|
|
}
|