From 52ccbd37a75aea3f39b4246d951bc222587e37d2 Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Tue, 9 Jan 2007 07:39:22 +0000 Subject: [PATCH] Clean up C# wrappers for NSL use. --- CASA/adlib/miCASAEngine.cs | 26 ++-- CASA/gui/ImportSecrets.cs | 18 +-- CASA/gui/MiCasa.cs | 26 ++-- CASA/gui/PersistentPolicyDialog.cs | 4 +- CASA/sharp/NSSCSWrapper/NativeCalls.cs | 162 ++++++++++----------- CASA/sharp/NSSCSWrapper/RemoteClient.cs | 12 +- CASA/sharp/NSSCSWrapper/RemoteServer.cs | 4 +- CASA/sharp/NSSCSWrapper/Secret.cs | 34 ++--- CASA/sharp/NSSCSWrapper/SecretStore.cs | 50 +++---- CASA/sharp/NSSCSWrapper/miCasaException.cs | 8 +- 10 files changed, 172 insertions(+), 172 deletions(-) diff --git a/CASA/adlib/miCASAEngine.cs b/CASA/adlib/miCASAEngine.cs index c5f67127..56ce26c6 100644 --- a/CASA/adlib/miCASAEngine.cs +++ b/CASA/adlib/miCASAEngine.cs @@ -48,7 +48,7 @@ namespace Novell.CASA.DataEngines { //TBD: What happens here at miCASA end ? - store = SecretStore.getInstance(); + store = SecretStore.GetInstance(); } public XmlNode Aggregate() @@ -69,7 +69,7 @@ namespace Novell.CASA.DataEngines doc.AppendChild(elem); - StringCollection sc = store.enumerateSecretIDs(); + StringCollection sc = store.EnumerateSecretIDs(); if (sc != null) { // Adding Keychain @@ -89,8 +89,8 @@ namespace Novell.CASA.DataEngines { - Secret secret = store.getSecret(se.Current); - NameValueCollection nvc = secret.getKeyValueCollection(); + Secret secret = store.GetSecret(se.Current); + NameValueCollection nvc = secret.GetKeyValueCollection(); mi_secret = doc.CreateElement(ConstStrings.CCF_SECRET); synchAttr = doc.CreateAttribute(ConstStrings.CCF_SYNCH); @@ -189,10 +189,10 @@ namespace Novell.CASA.DataEngines { XmlAttributeCollection atcol = secret.Attributes; - String secretid = atcol["ID"].InnerXml; - Secret secretVal = store.getSecret(secretid); + String secretid = atcol["ID"].InnerXml; + Secret secretVal = store.GetSecret(secretid); - NameValueCollection nvc = secretVal.getKeyValueCollection(); + NameValueCollection nvc = secretVal.GetKeyValueCollection(); ArrayList existingKeyList; if (nvc.Count == 0) @@ -229,18 +229,18 @@ namespace Novell.CASA.DataEngines string key = (string)etor.Current; if(KeyInNewList(newNVC,key) == false) { - secretVal.removeKey(key,0); + secretVal.RemoveKey(key,0); } } } for(int i = 0 ; i < newNVC.Count ; i++) { string key = newNVC.GetKey(i); - secretVal.setKeyValuePair(key,newNVC.Get(key)); + secretVal.SetKeyValuePair(key,newNVC.Get(key)); } // TBD: Return Value ?? - store.setSecret(0, secretVal, Secret.SS_CREDSET); + store.SetSecret(0, secretVal, Secret.SS_CREDSET); return ConstStrings.CASA_SUCCESS; @@ -266,8 +266,8 @@ namespace Novell.CASA.DataEngines XmlAttributeCollection atcol = secret.Attributes; String secretid = atcol["ID"].InnerXml; - Secret secretVal = store.getSecret(secretid); - NameValueCollection nvc = secretVal.getKeyValueCollection(); + Secret secretVal = store.GetSecret(secretid); + NameValueCollection nvc = secretVal.GetKeyValueCollection(); if (nvc.Count == 0) { @@ -358,7 +358,7 @@ namespace Novell.CASA.DataEngines String secretid = atcol["ID"].InnerXml; //TBD: Why no other overloaded API - store.removeSecret(secretid.Substring(secretid.IndexOf(":")+1), Secret.SS_CREDSET); + store.RemoveSecret(secretid.Substring(secretid.IndexOf(":")+1), Secret.SS_CREDSET); XmlNode root = secret.ParentNode; diff --git a/CASA/gui/ImportSecrets.cs b/CASA/gui/ImportSecrets.cs index 84e6177c..0dbfee88 100644 --- a/CASA/gui/ImportSecrets.cs +++ b/CASA/gui/ImportSecrets.cs @@ -98,9 +98,9 @@ namespace Novell.CASA.GUI // check for conflicts if (m_ss == null) - m_ss = SecretStore.getInstance(); + m_ss = SecretStore.GetInstance(); - m_scConflicts = m_ss.enumerateSecretIDs(SecretStore.SSCS_CONFLICT_KEYCHAIN); + m_scConflicts = m_ss.EnumerateSecretIDs(SecretStore.SSCS_CONFLICT_KEYCHAIN); if (m_scConflicts.Count > 0) { HandleConficts(m_ss, m_scConflicts); @@ -188,9 +188,9 @@ namespace Novell.CASA.GUI // check for conflicts if (m_ss == null) - m_ss = SecretStore.getInstance(); + m_ss = SecretStore.GetInstance(); - m_scConflicts = m_ss.enumerateSecretIDs(SecretStore.SSCS_CONFLICT_KEYCHAIN); + m_scConflicts = m_ss.EnumerateSecretIDs(SecretStore.SSCS_CONFLICT_KEYCHAIN); if (m_scConflicts.Count > 0) { HandleConficts(m_ss, m_scConflicts); @@ -226,7 +226,7 @@ namespace Novell.CASA.GUI while (sEnum.MoveNext()) { string sSecretID = sEnum.Current; - Secret currentSecret = store.getSecret(sSecretID); + Secret currentSecret = store.GetSecret(sSecretID); string sConflictSecretID; if (sSecretID.StartsWith("SS_CredSet")) @@ -237,11 +237,11 @@ namespace Novell.CASA.GUI { sConflictSecretID = sSecretID; } - Secret conflictSecret = store.getSecret(SecretStore.SSCS_CONFLICT_KEYCHAIN, 0, sConflictSecretID, Secret.SS_CREDSET, ""); + Secret conflictSecret = store.GetSecret(SecretStore.SSCS_CONFLICT_KEYCHAIN, 0, sConflictSecretID, Secret.SS_CREDSET, ""); // add this conflict to the treestore - NameValueCollection nvcConflict = conflictSecret.getKeyValueCollection(); - NameValueCollection nvcCurrent = currentSecret.getKeyValueCollection(); + NameValueCollection nvcConflict = conflictSecret.GetKeyValueCollection(); + NameValueCollection nvcCurrent = currentSecret.GetKeyValueCollection(); for (int i = 0; i < nvcConflict.Count; i++) { String sConflictKey = nvcConflict.GetKey(i); @@ -419,7 +419,7 @@ namespace Novell.CASA.GUI { sSecretID = sSecretID.Substring(11); } - m_ss.removeSecret(0, SecretStore.SSCS_CONFLICT_KEYCHAIN, null, sSecretID, Secret.SS_CREDSET); + m_ss.RemoveSecret(0, SecretStore.SSCS_CONFLICT_KEYCHAIN, null, sSecretID, Secret.SS_CREDSET); } } } diff --git a/CASA/gui/MiCasa.cs b/CASA/gui/MiCasa.cs index 9c45bd30..de830624 100644 --- a/CASA/gui/MiCasa.cs +++ b/CASA/gui/MiCasa.cs @@ -330,7 +330,7 @@ public class MiCasa : Store for( int i=0; i< keys.Length; i++ ) { - Secret secret = ss.getSecret(selected); + Secret secret = ss.GetSecret(selected); Hashtable ht = secret.GetLinkedKeys(keys[i]); @@ -1171,7 +1171,7 @@ public class MiCasa : Store // show secretIDs SecretStore ss = GetMiCasaStore(); - StringCollection sc = ss.enumerateSecretIDs(); + StringCollection sc = ss.EnumerateSecretIDs(); StringEnumerator se = sc.GetEnumerator(); se.Reset(); while (se.MoveNext()) @@ -1195,7 +1195,7 @@ public class MiCasa : Store tvLinkedKeys.AppendColumn("Key", new CellRendererText(), "text", 1); tvLinkedKeys.Model=tsLinkedKeys; - Secret secret = ss.getSecret(entrySecretID.Text); + Secret secret = ss.GetSecret(entrySecretID.Text); ShowLinkedKeys(secret, selected); // display info on this secret @@ -1242,8 +1242,8 @@ public class MiCasa : Store if(selected != null && selected.Length > 0) { SecretStore ss = GetMiCasaStore(); - Secret secret = ss.getSecret(selected); - NameValueCollection nvc = secret.getKeyValueCollection(); + Secret secret = ss.GetSecret(selected); + NameValueCollection nvc = secret.GetKeyValueCollection(); for (int i=0; i