change lookup name from kwallet_rw to casakwallet
This commit is contained in:
parent
85aa2f3a40
commit
c65e3b0beb
@ -1,3 +1,7 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Apr 24 04:40:20 MST 2006 - jnorman@novell.com
|
||||||
|
- change lookup name from kwallet_rw to casakwallet
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Apr 22 18:52:20 MST 2006 - cmashayekhi@novell.com
|
Sat Apr 22 18:52:20 MST 2006 - cmashayekhi@novell.com
|
||||||
- installcasa and uninstallcasa scripts were added to
|
- installcasa and uninstallcasa scripts were added to
|
||||||
|
@ -28,87 +28,87 @@ using System.Runtime.InteropServices;
|
|||||||
namespace Novell.CASA.DataEngines.KWallet
|
namespace Novell.CASA.DataEngines.KWallet
|
||||||
{
|
{
|
||||||
|
|
||||||
public class kwallet
|
public class kwallet
|
||||||
{
|
{
|
||||||
|
|
||||||
//private static int MAX_NAME_LENGTH = 512;
|
//private static int MAX_NAME_LENGTH = 512;
|
||||||
private const string CPP_LIB = "kwallets_rw";
|
private const string CPP_LIB = "casakwallet";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
[DllImport(CPP_LIB)]
|
[DllImport(CPP_LIB)]
|
||||||
public static extern void MyTest(
|
public static extern void MyTest(
|
||||||
EnumSecretList enumSecretList
|
EnumSecretList enumSecretList
|
||||||
);
|
);
|
||||||
|
|
||||||
*/
|
*/
|
||||||
[DllImport(CPP_LIB)]
|
[DllImport(CPP_LIB)]
|
||||||
public static extern void Aggregate(
|
public static extern void Aggregate(
|
||||||
EnumSecretList enumSecretList
|
EnumSecretList enumSecretList
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(CPP_LIB)]
|
[DllImport(CPP_LIB)]
|
||||||
public static extern void FreeList();
|
public static extern void FreeList();
|
||||||
|
|
||||||
[DllImport(CPP_LIB)]
|
[DllImport(CPP_LIB)]
|
||||||
public static extern int SetEntry(string walletName, string folderName, int entryType, string keyName, string value, int valueLen);
|
public static extern int SetEntry(string walletName, string folderName, int entryType, string keyName, string value, int valueLen);
|
||||||
|
|
||||||
[DllImport(CPP_LIB)]
|
[DllImport(CPP_LIB)]
|
||||||
public static extern int SetMapEntry(string walletName, string folderName, string keyName, String[,] value, int eleCount);
|
public static extern int SetMapEntry(string walletName, string folderName, string keyName, String[,] value, int eleCount);
|
||||||
[DllImport(CPP_LIB)]
|
[DllImport(CPP_LIB)]
|
||||||
public static extern int RemoveEntry(string walletName, string folderName, string keyName);
|
public static extern int RemoveEntry(string walletName, string folderName, string keyName);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
public static int Try(EnumSecretList enumSecretList)
|
public static int Try(EnumSecretList enumSecretList)
|
||||||
{
|
{
|
||||||
MyTest(enumSecretList);
|
MyTest(enumSecretList);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public static int AggregateKW(EnumSecretList enumSecretList)
|
public static int AggregateKW(EnumSecretList enumSecretList)
|
||||||
{
|
|
||||||
Aggregate(enumSecretList);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static int FreeResources()
|
|
||||||
{
|
|
||||||
FreeList();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
|
|
||||||
String[,] mapele = new String[nvc.Count,2 ];
|
|
||||||
|
|
||||||
for (int i=0; i< nvc.Count; i++)
|
|
||||||
{
|
{
|
||||||
mapele[i,0] = nvc.GetKey(i);
|
Aggregate(enumSecretList);
|
||||||
mapele[i,1] = nvc.Get(nvc.GetKey(i));
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static int FreeResources()
|
||||||
|
{
|
||||||
|
FreeList();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
|
||||||
|
String[,] mapele = new String[nvc.Count,2 ];
|
||||||
|
|
||||||
|
for (int i=0; i< nvc.Count; i++)
|
||||||
|
{
|
||||||
|
mapele[i,0] = nvc.GetKey(i);
|
||||||
|
mapele[i,1] = nvc.Get(nvc.GetKey(i));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(SetMapEntry(walletName, folderName, keyName, mapele, nvc.Count));
|
return(SetMapEntry(walletName, folderName, keyName, mapele, nvc.Count));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int DeleteSecret(string walletName, string folderName, string keyName)
|
public static int DeleteSecret(string walletName, string folderName, string keyName)
|
||||||
{
|
{
|
||||||
return(RemoveEntry(walletName, folderName, keyName));
|
return(RemoveEntry(walletName, folderName, keyName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -120,40 +120,40 @@ public class kwallet
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TBD: All this for future.
|
//TBD: All this for future.
|
||||||
/*
|
/*
|
||||||
[DllImport(CPP_LIB)]
|
[DllImport(CPP_LIB)]
|
||||||
public static extern int ReadSecret
|
public static extern int ReadSecret
|
||||||
(
|
(
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
String walletName,
|
String walletName,
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
String folderName,
|
String folderName,
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
String key,
|
String key,
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
Byte[] secretVal
|
Byte[] secretVal
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(CPP_LIB)]
|
[DllImport(CPP_LIB)]
|
||||||
public static extern int WriteSecret
|
public static extern int WriteSecret
|
||||||
(
|
(
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
String walletName,
|
String walletName,
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
String folderName,
|
String folderName,
|
||||||
int entryType,
|
int entryType,
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
String key,
|
String key,
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.LPStr)]
|
||||||
Byte[] secret
|
Byte[] secret
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[DllImport(CPP_LIB)]
|
[DllImport(CPP_LIB)]
|
||||||
public static extern void CloseAllWallets();
|
public static extern void CloseAllWallets();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -161,33 +161,33 @@ public class kwallet
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static int ReadWallet(String walletName, String folderName, String key, Byte[] secretVal)
|
public static int ReadWallet(String walletName, String folderName, String key, Byte[] secretVal)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Read a secret from wallet
|
// Read a secret from wallet
|
||||||
return (ReadSecret(walletName, folderName, key, secretVal));
|
return (ReadSecret(walletName, folderName, key, secretVal));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int WriteWallet(String walletName, String folderName,int entryType, String key, Byte[] secretVal)
|
public static int WriteWallet(String walletName, String folderName,int entryType, String key, Byte[] secretVal)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Write secret to wallet
|
// Write secret to wallet
|
||||||
return (WriteSecret( walletName, folderName, entryType, key, secretVal));
|
return (WriteSecret( walletName, folderName, entryType, key, secretVal));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void DisconnectApplication()
|
public static void DisconnectApplication()
|
||||||
{
|
{
|
||||||
|
|
||||||
CloseAllWallets();
|
CloseAllWallets();
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user