Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1334
Modified Files:
rhCoolKey.cpp
Log Message:
Add method to get card's ATR.
Index: rhCoolKey.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/rhCoolKey.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- rhCoolKey.cpp 25 Oct 2006 03:58:16 -0000 1.4
+++ rhCoolKey.cpp 9 Feb 2007 21:36:47 -0000 1.5
@@ -1167,6 +1167,21 @@
return NS_OK;
}
+/* string GetCoolKeyATR (in unsigned long aKeyType, in string aKeyID); */
+ NS_IMETHODIMP rhCoolKey::GetCoolKeyATR(PRUint32 aKeyType, const char *aKeyID, char
**_retval)
+ {
+ *_retval = NULL;
+ AutoCoolKey key(aKeyType, aKeyID);
+ char atr[128];
+ HRESULT res = CoolKeyGetATR(&key, (char *)&atr,sizeof(atr));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to get the key's ATR: Key:
%s, ATR %s. \n",aKeyID, (char *) atr));
+ if(res == S_OK)
+ {
+ char *temp = (char *) nsMemory::Clone(atr,sizeof(char) * strlen((char *)atr) +
1);
+ *_retval = temp;
+ }
+ return NS_OK;
+ }
/* string GetCoolKeyIssuerInfo (in unsigned long aKeyType, in string aKeyID); */
NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuerInfo(PRUint32 aKeyType, const char *aKeyID, char
**_retval)
{
Show replies by date