- Added support for ADD/MODIFY/DELETE functionalities for Keyring and
Kwallet stores in A-Dlib. .....................................................................
This commit is contained in:
@@ -155,6 +155,85 @@ namespace Novell.CASA.DataEngines
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
Modifying a Secret
|
||||
|
||||
SetSecret will modify the Value(s) of a Key(s) for an existing secret
|
||||
SetSecret will also add new secrets
|
||||
|
||||
public int SetSecret(XmlNode secret, int StoreID)
|
||||
|
||||
Parameters
|
||||
|
||||
secret : Secrets XMLNode
|
||||
1. If a Key node of a secret is missing then that key will be deleted
|
||||
2. For Gnome keyring, Key having Id "GkPassword" cannot be deleted as
|
||||
Gnome Api's do not allow it.
|
||||
3. All Time nodes for a Secret need not be passed as they cannot be set.
|
||||
4. Keyring attributes have a fixed datatype of Int and String.
|
||||
Currently we support only String types. To support int types CCF needs to be modified accordingly.
|
||||
5. SetSecret overloaded method, without the opnType parameter, is not supported for GnomeKeyring
|
||||
|
||||
opnType : Operation Type
|
||||
ConstStrings.OPERATION_ADD_SECRET
|
||||
ConstStrings.OPERATION_MODIFY_SECRET
|
||||
|
||||
StoreID : int value
|
||||
Novell.CASA.DataEngines.Common.ConstStrings.CASA_STORE_KWALLET = 3;
|
||||
Novell.CASA.DataEngines.Common.ConstStrings.CASA_STORE_GK = 4
|
||||
|
||||
Returns
|
||||
An Error code or 0 if operation is successfull.
|
||||
*********************************************************************************/
|
||||
|
||||
public int SetSecret(XmlNode secret, int opnType, int StoreID)
|
||||
{
|
||||
if (StoreID == ConstStrings.CASA_STORE_MICASA)
|
||||
return micasaengine.SetSecret(secret, opnType);
|
||||
if (StoreID == ConstStrings.CASA_STORE_KWALLET)
|
||||
return kwEngine.SetSecret(secret, opnType);
|
||||
if (StoreID == ConstStrings.CASA_STORE_GK)
|
||||
return gkEngine.SetSecret(secret, opnType);
|
||||
else
|
||||
{
|
||||
#if LINUX
|
||||
Logger.DbgLog("A-D Lib:Failed to Set Secret in to miCASA");
|
||||
#endif
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
Modifying a Secret
|
||||
|
||||
SetSecret will modify the Value(s) of a Key(s) for an existing secret
|
||||
SetSecret will also add new secrets
|
||||
|
||||
public int SetSecret(XmlNode secret, int StoreID)
|
||||
|
||||
Parameters
|
||||
|
||||
secret : Secrets XMLNode
|
||||
1. If a Key node of a secret is missing then that key will be deleted
|
||||
2. For Gnome keyring, Key having Id "GkPassword" cannot be deleted as
|
||||
Gnome Api's do not allow it.
|
||||
3. All Time nodes for a Secret need not be passed as they cannot be set.
|
||||
4. Keyring attributes have a fixed datatype of Int and String.
|
||||
Currently we support only String types. To support int types CCF needs to be modified accordingly.
|
||||
|
||||
StoreID : int value
|
||||
Novell.CASA.DataEngines.Common.ConstStrings.CASA_STORE_KWALLET = 3;
|
||||
Novell.CASA.DataEngines.Common.ConstStrings.CASA_STORE_GK = 4
|
||||
|
||||
Returns
|
||||
An Error code or 0 if operation is successfull.
|
||||
*********************************************************************************/
|
||||
|
||||
public int SetSecret(XmlNode secret, int StoreID)
|
||||
{
|
||||
if (StoreID == ConstStrings.CASA_STORE_MICASA)
|
||||
@@ -191,7 +270,27 @@ namespace Novell.CASA.DataEngines
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
Remove will delete a Secret.
|
||||
|
||||
public int Remove(XmlNode secret, int StoreID)
|
||||
|
||||
|
||||
Parameters
|
||||
|
||||
secret : Secrets XmlNode
|
||||
1. This node will be deleted from its parent.
|
||||
|
||||
|
||||
StoreID : int value
|
||||
Novell.CASA.DataEngines.Common.ConstStrings.CASA_STORE_KWALLET = 3;
|
||||
Novell.CASA.DataEngines.Common.ConstStrings.CASA_STORE_GK = 4
|
||||
|
||||
|
||||
Returns
|
||||
An Error code or 0 if operation is successfull.
|
||||
|
||||
*********************************************************************************/
|
||||
|
||||
public int Remove(XmlNode secret, int StoreID)
|
||||
{
|
||||
@@ -278,7 +377,7 @@ namespace Novell.CASA.DataEngines
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("KWallet some issue");
|
||||
//Console.WriteLine("KWallet some issue");
|
||||
return ConstStrings.CASA_STORE_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user