- Added support for ADD/MODIFY/DELETE functionalities for Keyring and
Kwallet stores in A-Dlib. .....................................................................
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -61,18 +61,17 @@ public class kwallet
|
||||
}
|
||||
|
||||
|
||||
public static int SetSecret(string walletName, string folderName, int entryType, string keyName, string value, int valueLen )
|
||||
public static int SetSecret(string walletName, string folderName, int entryType, string keyName, string value, int valueLen )
|
||||
{
|
||||
return(SetEntry(walletName, folderName, entryType, keyName, value, valueLen ));
|
||||
}
|
||||
|
||||
|
||||
public static int SetSecret(string walletName, string folderName, string keyName, NameValueCollection nvc)
|
||||
{
|
||||
|
||||
//IntPtr[] mapele = new IntPtr[nvc.Count * 2];
|
||||
String[,] mapele = new String[nvc.Count,2 ];
|
||||
String str=" ";
|
||||
|
||||
int j=0;
|
||||
for (int i=0; i< nvc.Count; i++)
|
||||
{
|
||||
mapele[i,0] = nvc.GetKey(i);
|
||||
@@ -81,52 +80,9 @@ public class kwallet
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
for (int i=0; i< nvc.Count; i++)
|
||||
{
|
||||
str = String.Concat(str,nvc.GetKey(i));
|
||||
str = String.Concat(str, "\0");
|
||||
str = String.Concat(str,nvc.Get(nvc.GetKey(i)));
|
||||
str = String.Concat(str, "\0");
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
char[] strarr = str.ToCharArray();
|
||||
|
||||
/*for (int i=0; i< nvc.Count; i++)
|
||||
{
|
||||
|
||||
string strKey = nvc.GetKey(i);
|
||||
Console.WriteLine("Key is " + strKey);
|
||||
//IntPtr ptr1 = Marshal.AllocHGlobal(strKey.Length);
|
||||
//Marshal.StructureToPtr(strKey,ptr1,false);
|
||||
|
||||
IntPtr ptr1 = Marshal.StringToHGlobalAnsi(strKey);
|
||||
string strValue = nvc.Get(strKey);
|
||||
//IntPtr ptr2 = Marshal.AllocHGlobal(strValue.Length);
|
||||
//Marshal.StructureToPtr(strValue,ptr2,false);
|
||||
IntPtr ptr2 = Marshal.StringToHGlobalAnsi(strValue);
|
||||
Console.WriteLine("Value is " + strValue);
|
||||
//IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(kv));
|
||||
// Marshal.StructureToPtr(kv,ptr,false);
|
||||
mapele[j++] = ptr1;
|
||||
Console.WriteLine("Pointer is " +ptr1);
|
||||
mapele[j++] = ptr2;
|
||||
Console.WriteLine("Pointer is " +ptr2);
|
||||
}
|
||||
*/
|
||||
//IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(mapele));
|
||||
//Marshal.StructureToPtr(mapele,ptr,false);
|
||||
|
||||
/*string[] str = {"a","bb","ccc"};
|
||||
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(str));
|
||||
Marshal.StructureToPtr(str,ptr,false);
|
||||
*/
|
||||
/*Console.WriteLine("Setting Map Entry Keys name is " + keyName); */
|
||||
return(SetMapEntry(walletName, folderName, keyName, mapele, nvc.Count));
|
||||
}
|
||||
|
||||
public static int DeleteSecret(string walletName, string folderName, string keyName)
|
||||
{
|
||||
return(RemoveEntry(walletName, folderName, keyName));
|
||||
|
||||
@@ -47,7 +47,7 @@ using namespace KWallet;
|
||||
|
||||
// Read the secret from the entry
|
||||
QByteArray value;
|
||||
printf("kwallet: Read Key entered\n");
|
||||
//printf("kwallet: Read Key entered\n");
|
||||
|
||||
if (wallet->readEntry(key, value)==0)
|
||||
{
|
||||
@@ -103,13 +103,13 @@ using namespace KWallet;
|
||||
|
||||
} else
|
||||
{
|
||||
printf("Could not read the entry..inner IF\n");
|
||||
//printf("Could not read the entry..inner IF\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
} else
|
||||
{
|
||||
printf("Could not read the entry Inside wallet->readkey\n");
|
||||
//printf("Could not read the entry Inside wallet->readkey\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user