211 lines
8.2 KiB
C#
211 lines
8.2 KiB
C#
//----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
|
|
//
|
|
// File: CIM_CredentialContext.cs
|
|
//
|
|
// Contents: This relationship defines a context (e.g., a System or Service) of a Credential. One example is a shared secret/ password which is defined within the context of an application (or Service). Generally, there is one scoping element for a Credential, however the multiplicities of the association allow a Credential to be scoped by more than one element. If this association is not instantiated for a Credential, that Credential is assumed to be scoped to the Namespace.
|
|
// This association may also be used to indicate that a Credential is valid in some other environment. For instance associating the Credential to a RemoteServiceAccessPoint would indicate that the Credential is used to access the remote service.
|
|
// This file was automatically generated from CIM_CredentialContext.mof
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Text;
|
|
using System.Globalization;
|
|
using System.Xml.Serialization;
|
|
using System.IO;
|
|
using Intel.Manageability.WSManagement;
|
|
using Intel.Manageability.Cim.Untyped;
|
|
|
|
|
|
namespace Intel.Manageability.Cim.Typed
|
|
{
|
|
/// <summary>
|
|
///This relationship defines a context (e.g., a System or Service) of a Credential. One example is a shared secret/ password which is defined within the context of an application (or Service). Generally, there is one scoping element for a Credential, however the multiplicities of the association allow a Credential to be scoped by more than one element. If this association is not instantiated for a Credential, that Credential is assumed to be scoped to the Namespace.
|
|
///This association may also be used to indicate that a Credential is valid in some other environment. For instance associating the Credential to a RemoteServiceAccessPoint would indicate that the Credential is used to access the remote service.
|
|
/// </summary>
|
|
[System.SerializableAttribute()]
|
|
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_CredentialContext")]
|
|
[System.Xml.Serialization.XmlRootAttribute("CIM_CredentialContext", Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_CredentialContext", IsNullable=false)]
|
|
public class CIM_CredentialContext : CimBase
|
|
{
|
|
/// <summary>
|
|
/// Default constructor.
|
|
/// </summary>
|
|
public CIM_CredentialContext() :base()
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Constructor that recieves an xml string for deserialization.
|
|
/// </summary>
|
|
/// <param name="xml">xml string to deserialize</param>
|
|
public CIM_CredentialContext(string xml): base((IWSManClient)null)
|
|
{
|
|
this.Deserialize(xml);
|
|
}
|
|
/// <summary>
|
|
/// Constructor which recieves a Ws-Management client object.
|
|
/// </summary>
|
|
/// <param name="client">Ws-Management client</param>
|
|
public CIM_CredentialContext(IWSManClient client): base(client)
|
|
{
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Key, Required, A Credential whose context is defined.
|
|
/// </summary>
|
|
[CimField(true, false)]
|
|
public virtual CimReference ElementInContext
|
|
{
|
|
get
|
|
{
|
|
string innerXML = this.GetField("ElementInContext")[0];
|
|
CimReference epr = new CimReference("ElementInContext", XmlNamespace, innerXML);
|
|
return epr;
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("ElementInContext",value.Serialize(false));
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Key, Required, The ManagedElement that provides context or scope for the Credential.
|
|
/// </summary>
|
|
[CimField(true, false)]
|
|
public virtual CimReference ElementProvidingContext
|
|
{
|
|
get
|
|
{
|
|
string innerXML = this.GetField("ElementProvidingContext")[0];
|
|
CimReference epr = new CimReference("ElementProvidingContext", XmlNamespace, innerXML);
|
|
return epr;
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("ElementProvidingContext",value.Serialize(false));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Remove Usage field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemoveUsage()
|
|
{
|
|
RemoveField("Usage");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field Usage exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool UsageExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("Usage");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, The usage of the certificate by the managed element that the certificate is for or is scoped to. Owned - Credential represents the CredentialContexts identity. This means that the managed element will present this credential to another party for authentication, authorization, or both. Trusted - The ManagedElement trusts the credential. This means that the credential is trusted for one or more of the security operations such as authentication, third-party authentication, and authorization. Trusted for Authentication - The ManagedElement trusts the identity represented by the credential only for authentication purposes. Trusted for Authorization - The ManagedElement trusts the identity represented by the credential only for authorization purposes. Trusted for Authentication/Authorization - The ManagedElement trusts the identity represented by the credential both for authentication and authorization purposes. Trusted for Third-Party Authentication/Authorization - The credential is being trusted for approving a third-party credential to the ManagedElement.
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual ushort Usage
|
|
{
|
|
get
|
|
{
|
|
return ushort.Parse(this["Usage"][0], CultureInfo.InvariantCulture);
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("Usage",value.ToString(CultureInfo.InvariantCulture));
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of CIM_CredentialContext class at an endpoint.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
/// <param name="cimKeys">Keys for selecting the instances</param>
|
|
/// <returns>Collection of CIM_CredentialContext objects</returns>
|
|
public static Collection<CIM_CredentialContext> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
|
|
{
|
|
List<CIM_CredentialContext> ret = CimBase.Enumerate<CIM_CredentialContext>(client, cimKeys);
|
|
return new Collection<CIM_CredentialContext>(ret);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of CIM_CredentialContext class at an endpoint.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
/// <returns>Collection of CIM_CredentialContext objects</returns>
|
|
public static Collection<CIM_CredentialContext> Enumerate(IWSManClient client)
|
|
{
|
|
List<CIM_CredentialContext> ret = CimBase.Enumerate<CIM_CredentialContext>(client);
|
|
return new Collection<CIM_CredentialContext>(ret);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Delete the instance of CIM_CredentialContext if it is singular.
|
|
/// Note: This method will succeed only if a single instance of the class exists.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
public static void Delete(IWSManClient client)
|
|
{
|
|
CimBase.Delete<CIM_CredentialContext>(client);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Represents the keys of the CIM_CredentialContext class.
|
|
/// </summary>
|
|
|
|
public new class CimKeys : CimBase.CimKeys
|
|
{
|
|
/// <summary>
|
|
/// Key, Required, A Credential whose context is defined.
|
|
/// </summary>
|
|
|
|
public virtual CimReference ElementInContext
|
|
{
|
|
get
|
|
{
|
|
string innerXML = GetKey("ElementInContext");
|
|
CimReference epr = new CimReference("ElementInContext", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_CredentialContext", innerXML);
|
|
return epr;
|
|
}
|
|
set
|
|
{
|
|
SetOrAddKey("ElementInContext", value);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Key, Required, The ManagedElement that provides context or scope for the Credential.
|
|
/// </summary>
|
|
|
|
public virtual CimReference ElementProvidingContext
|
|
{
|
|
get
|
|
{
|
|
string innerXML = GetKey("ElementProvidingContext");
|
|
CimReference epr = new CimReference("ElementProvidingContext", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_CredentialContext", innerXML);
|
|
return epr;
|
|
}
|
|
set
|
|
{
|
|
SetOrAddKey("ElementProvidingContext", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|