- Added support for ADD/MODIFY/DELETE functionalities for Keyring and

Kwallet stores in A-Dlib.
.....................................................................
This commit is contained in:
smanojna
2006-01-06 11:57:25 +00:00
parent b8aedf332e
commit f610a50037
12 changed files with 231 additions and 204 deletions

View File

@@ -26,7 +26,7 @@ using System.Runtime.CompilerServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.5.*")]
[assembly: AssemblyVersion("1.6.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the

View File

@@ -127,7 +127,7 @@ namespace Novell.CASA.DataEngines.GK
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
//Console.WriteLine(e.ToString());
info = null;
}
return info;
@@ -139,15 +139,15 @@ namespace Novell.CASA.DataEngines.GK
return;
try
{
Console.WriteLine("lockOnIdle = " + info.lockOnIdle);
Console.WriteLine("lockTimeout = " + info.lockTimeout);
Console.WriteLine("mTime = " + info.mTime);
Console.WriteLine("cTime = " + info.cTime);
Console.WriteLine("isLocked = " + info.isLocked);
//Console.WriteLine("lockOnIdle = " + info.lockOnIdle);
//Console.WriteLine("lockTimeout = " + info.lockTimeout);
//Console.WriteLine("mTime = " + info.mTime);
//Console.WriteLine("cTime = " + info.cTime);
//Console.WriteLine("isLocked = " + info.isLocked);
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
//Console.WriteLine(e.ToString());
}
}
@@ -181,7 +181,7 @@ namespace Novell.CASA.DataEngines.GK
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
//Console.WriteLine(e.ToString());
info = null;
}
return info;
@@ -193,15 +193,15 @@ namespace Novell.CASA.DataEngines.GK
return;
try
{
Console.WriteLine("CS : itemType = " + info.itemType);
Console.WriteLine("CS : displayName = " + info.displayName);
Console.WriteLine("CS : secret = " + info.secret);
Console.WriteLine("CS : mTime = " + info.mTime);
Console.WriteLine("CS : cTime = " + info.cTime);
//Console.WriteLine("CS : itemType = " + info.itemType);
//Console.WriteLine("CS : displayName = " + info.displayName);
//Console.WriteLine("CS : secret = " + info.secret);
//Console.WriteLine("CS : mTime = " + info.mTime);
//Console.WriteLine("CS : cTime = " + info.cTime);
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
//Console.WriteLine(e.ToString());
}
}
@@ -226,7 +226,7 @@ namespace Novell.CASA.DataEngines.GK
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
//Console.WriteLine(e.ToString());
retList = null;
}
return retList;
@@ -253,7 +253,7 @@ namespace Novell.CASA.DataEngines.GK
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
//Console.WriteLine(e.ToString());
retList = null;
}
return retList;
@@ -293,7 +293,7 @@ namespace Novell.CASA.DataEngines.GK
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
//Console.WriteLine(e.ToString());
retList = null;
}
return retList;
@@ -310,14 +310,14 @@ namespace Novell.CASA.DataEngines.GK
while(etor.MoveNext())
{
attr = (Attribute)(etor.Current);
Console.WriteLine("CS : AttrType = " + attr.type);
Console.WriteLine("CS : AttrKey = " + attr.key);
Console.WriteLine("CS : AttrValue = " + attr.value);
//Console.WriteLine("CS : AttrType = " + attr.type);
//Console.WriteLine("CS : AttrKey = " + attr.key);
//Console.WriteLine("CS : AttrValue = " + attr.value);
}
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
//Console.WriteLine(e.ToString());
}
}
@@ -351,7 +351,7 @@ namespace Novell.CASA.DataEngines.GK
public static int CreateSecret(String keyringName, string strItemType, string displayName, string password, NameValueCollection nvc)
{
Console.WriteLine("In CreateSecret ");
//Console.WriteLine("In CreateSecret ");
int itemType = 3; //No Type
IntPtr[] arrptr = new IntPtr[nvc.Count];
if(strItemType.CompareTo("Generic Secret") == 0 )
@@ -368,13 +368,13 @@ namespace Novell.CASA.DataEngines.GK
{
itemType = 2;
}
Console.WriteLine("In CreateSecret ItemType = "+itemType);
//Console.WriteLine("In CreateSecret ItemType = "+itemType);
for(int i=0; i < nvc.Count; i++)
{
string key = nvc.GetKey(i);
Console.WriteLine("In CreateSecret Key "+i + " = " + key);
//Console.WriteLine("In CreateSecret Key "+i + " = " + key);
string value = nvc.Get(key);
Console.WriteLine("In CreateSecret Value "+i + " = " + value);
//Console.WriteLine("In CreateSecret Value "+i + " = " + value);
Attribute attr = new Attribute();
attr.type=0;
attr.key=key;
@@ -383,7 +383,7 @@ namespace Novell.CASA.DataEngines.GK
Marshal.StructureToPtr(attr,ptr,false);
arrptr[i] = ptr;
}
Console.WriteLine("Calling Create item ");
//Console.WriteLine("Calling Create item ");
int ret = CreateItem(keyringName, itemType, displayName, password, arrptr, nvc.Count);
FreeIntPtrArray(arrptr);
return ret;

View File

@@ -51,14 +51,14 @@ CreateItemInKeyring(char *keyring, int32_t itemType, char *display_name, char *s
OperationCompleted cbData;
int i;
printf("ad.gk.c : CreateItemInKeyring : Keyring %s, itemType %d displayname %s, secret %s \n",keyring,itemType, display_name,secret);
//printf("ad.gk.c : CreateItemInKeyring : Keyring %s, itemType %d displayname %s, secret %s \n",keyring,itemType, display_name,secret);
cbData.OperationName = "Create Item";
loop = g_main_loop_new (NULL, FALSE);
attributes = gnome_keyring_attribute_list_new ();
for (i=0; i< attrcnt; i++)
{
printf("as.gk.c : CreateItemInKeyring : In key %s \n", attrs[i]->key);
//printf("as.gk.c : CreateItemInKeyring : In key %s \n", attrs[i]->key);
attribute.name = g_strdup (attrs[i]->key);
attribute.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING;
attribute.value.string = g_strdup (attrs[i]->value);
@@ -332,15 +332,15 @@ SetItemAttributes (char *keyring, guint32 itemid, Attribute **attrs, int length)
GnomeKeyringAttribute attribute;
OperationCompleted cbData;
int i;
printf("ad_gk.c : In SetItemAttributes\n");
printf("ad_gk.c : Keyring %s, itemid %d\n",keyring,itemid);
//printf("ad_gk.c : In SetItemAttributes\n");
//printf("ad_gk.c : Keyring %s, itemid %d\n",keyring,itemid);
cbData.OperationName = "Set Item Attributes";
loop = g_main_loop_new (NULL, FALSE);
attributes = gnome_keyring_attribute_list_new ();
for (i=0; i< length; i++)
{
printf("ad_gk.c : In key %s \n", attrs[i]->key);
//printf("ad_gk.c : In key %s \n", attrs[i]->key);
attribute.name = g_strdup (attrs[i]->key);
attribute.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING;
attribute.value.string = g_strdup (attrs[i]->value);