Moving micasa 1.5 trunk to Novell forge.
This commit is contained in:
42
c_micasad/lib/common/LinkedKeyInfo.cs
Normal file
42
c_micasad/lib/common/LinkedKeyInfo.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
|
||||
namespace Novell.CASA.MiCasa.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for LinkInfo.
|
||||
/// </summary>
|
||||
///
|
||||
[Serializable]
|
||||
public class LinkedKeyInfo
|
||||
{
|
||||
private string m_sDestStoreID = null;
|
||||
private string m_sDestKeychainID = null;
|
||||
private string m_sDestSecretID = null;
|
||||
private string m_sDestKeyID = null;
|
||||
|
||||
public LinkedKeyInfo(string sDestSecretID, string sDestKey)
|
||||
{
|
||||
if (sDestSecretID.StartsWith("SS_CredSet"))
|
||||
m_sDestSecretID = sDestSecretID;
|
||||
else
|
||||
m_sDestSecretID = "SS_CredSet:" + sDestSecretID + '\0';
|
||||
|
||||
m_sDestKeyID = sDestKey;
|
||||
}
|
||||
|
||||
public string GetLinkID()
|
||||
{
|
||||
return m_sDestSecretID + ":" + m_sDestKeyID;
|
||||
}
|
||||
|
||||
public string GetLinkedSecretID()
|
||||
{
|
||||
return m_sDestSecretID;
|
||||
}
|
||||
|
||||
public string GetLinkedKeyID()
|
||||
{
|
||||
return m_sDestKeyID;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
c_micasad/lib/common/MiCASAStore.cs
Normal file
29
c_micasad/lib/common/MiCASAStore.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using Novell.CASA.MiCasa.Common;
|
||||
using Novell.CASA.MiCasa.Communication;
|
||||
|
||||
namespace Novell.CASA.MiCasa.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for MiCASAStore.
|
||||
/// </summary>
|
||||
public class MiCASAStore
|
||||
{
|
||||
public MiCASAStore()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
|
||||
public static bool IsLocked()
|
||||
{
|
||||
Object o = MiCasaRequestReply.Send(MiCasaRequestReply.VERB_GET_STORE_STATUS);
|
||||
|
||||
if ((o != null) && ((System.Int32)o == 2))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
c_micasad/lib/common/Ping.cs
Normal file
23
c_micasad/lib/common/Ping.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace Novell.CASA.MiCasa.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Ping.
|
||||
/// </summary>
|
||||
///
|
||||
[Serializable]
|
||||
public class Ping
|
||||
{
|
||||
public Ping()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
|
||||
public string clientmessage;
|
||||
public string servermessage;
|
||||
|
||||
}
|
||||
}
|
||||
99
c_micasad/lib/common/WrappedObject.cs
Normal file
99
c_micasad/lib/common/WrappedObject.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
|
||||
namespace Novell.CASA.MiCasa.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for MessageObject.
|
||||
/// </summary>
|
||||
///
|
||||
[Serializable]
|
||||
public class WrappedObject
|
||||
{
|
||||
public static string DEFAULT_KEYCHAIN_ID = "SSCS_SESSION_KEY_CHAIN_ID\0";
|
||||
|
||||
private int m_verb = 0;
|
||||
private string m_KeychainID = null;
|
||||
private string m_SecretID = null;
|
||||
private string m_KeyID = null;
|
||||
|
||||
private object m_object;
|
||||
|
||||
private int m_rcode = 0;
|
||||
private string m_errorMsg;
|
||||
|
||||
public WrappedObject(int rcode, string errorMsg)
|
||||
{
|
||||
m_rcode = rcode;
|
||||
m_errorMsg = errorMsg;
|
||||
}
|
||||
|
||||
public WrappedObject(int verb, string sKeychainID, string sSecretID, string sKeyID, object theObject)
|
||||
{
|
||||
m_verb = verb;
|
||||
if (sKeychainID != null)
|
||||
m_KeychainID = sKeychainID + '\0';
|
||||
else
|
||||
m_KeychainID = DEFAULT_KEYCHAIN_ID;
|
||||
|
||||
if (sSecretID != null)
|
||||
{
|
||||
if (sSecretID.StartsWith("SS_CredSet"))
|
||||
m_SecretID = sSecretID + '\0';
|
||||
else
|
||||
m_SecretID = "SS_CredSet:" + sSecretID + '\0';
|
||||
}
|
||||
|
||||
if (sKeyID != null)
|
||||
m_KeyID = sKeyID; // + '\0';
|
||||
|
||||
// serialize the object
|
||||
m_object = theObject;
|
||||
}
|
||||
|
||||
public string GetKeyID()
|
||||
{
|
||||
return m_KeyID;
|
||||
}
|
||||
|
||||
public string GetSecretID()
|
||||
{
|
||||
return m_SecretID;
|
||||
}
|
||||
|
||||
public string GetKeychainID()
|
||||
{
|
||||
return m_KeychainID;
|
||||
}
|
||||
|
||||
public object GetObject()
|
||||
{
|
||||
return m_object;
|
||||
}
|
||||
|
||||
public void SetObject(object theobject)
|
||||
{
|
||||
m_object = theobject;
|
||||
}
|
||||
|
||||
public int GetAction()
|
||||
{
|
||||
return m_verb;
|
||||
}
|
||||
|
||||
public void SetError(int rcode, string message)
|
||||
{
|
||||
m_rcode = rcode;
|
||||
m_errorMsg = message;
|
||||
}
|
||||
|
||||
public int GetReturnCode()
|
||||
{
|
||||
return m_rcode;
|
||||
}
|
||||
|
||||
public string GetReturnMessage()
|
||||
{
|
||||
return m_errorMsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user