312 lines
8.2 KiB
C#
312 lines
8.2 KiB
C#
//----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
|
|
//
|
|
// File: AMT_PublicKeyCertificate.cs
|
|
//
|
|
// Contents: This class represents a X.509 Certificate in the Intel(R) AMT CertStore.
|
|
// This file was automatically generated from AMT_PublicKeyCertificate.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 class represents a X.509 Certificate in the Intel(R) AMT CertStore.
|
|
/// </summary>
|
|
[System.SerializableAttribute()]
|
|
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate")]
|
|
[System.Xml.Serialization.XmlRootAttribute("AMT_PublicKeyCertificate", Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate", IsNullable=false)]
|
|
public class AMT_PublicKeyCertificate : CIM_Credential
|
|
{
|
|
/// <summary>
|
|
/// Default constructor.
|
|
/// </summary>
|
|
public AMT_PublicKeyCertificate() :base()
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Constructor that recieves an xml string for deserialization.
|
|
/// </summary>
|
|
/// <param name="xml">xml string to deserialize</param>
|
|
public AMT_PublicKeyCertificate(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 AMT_PublicKeyCertificate(IWSManClient client): base(client)
|
|
{
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Key, Required, Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies an instance of this class.
|
|
/// </summary>
|
|
[CimField(true, true)]
|
|
public override string InstanceID
|
|
{
|
|
get
|
|
{
|
|
return this.GetField("InstanceID")[0];
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("InstanceID",value);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Remove Issuer field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemoveIssuer()
|
|
{
|
|
RemoveField("Issuer");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field Issuer exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool IssuerExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("Issuer");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, The Issuer field of this certificate.
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual string Issuer
|
|
{
|
|
get
|
|
{
|
|
return this.GetField("Issuer")[0];
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("Issuer",value);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Remove ReadOnlyCertificate field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemoveReadOnlyCertificate()
|
|
{
|
|
RemoveField("ReadOnlyCertificate");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field ReadOnlyCertificate exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool ReadOnlyCertificateExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("ReadOnlyCertificate");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, This identifies that this is a read only certificate.meaning it's AMT auto generated certificate and will be.used as AMT server certficate in case another server certificatewasn't defined
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual bool ReadOnlyCertificate
|
|
{
|
|
get
|
|
{
|
|
return bool.Parse(this["ReadOnlyCertificate"][0]);
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("ReadOnlyCertificate",value.ToString().ToLower(CultureInfo.InvariantCulture));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Remove Subject field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemoveSubject()
|
|
{
|
|
RemoveField("Subject");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field Subject exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool SubjectExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("Subject");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, The Subject field of this certificate.
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual string Subject
|
|
{
|
|
get
|
|
{
|
|
return this.GetField("Subject")[0];
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("Subject",value);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Remove TrustedRootCertficate field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemoveTrustedRootCertficate()
|
|
{
|
|
RemoveField("TrustedRootCertficate");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field TrustedRootCertficate exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool TrustedRootCertficateExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("TrustedRootCertficate");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, For root certificate [that were added by AMT_PublicKeyManagementService.AddTrustedRootCertificate()]this property will be true.
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual bool TrustedRootCertficate
|
|
{
|
|
get
|
|
{
|
|
return bool.Parse(this["TrustedRootCertficate"][0]);
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("TrustedRootCertficate",value.ToString().ToLower(CultureInfo.InvariantCulture));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Remove X509Certificate field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemoveX509Certificate()
|
|
{
|
|
RemoveField("X509Certificate");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field X509Certificate exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool X509CertificateExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("X509Certificate");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, The X.509 Certificate blob.
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual byte[] X509Certificate
|
|
{
|
|
get
|
|
{
|
|
return Convert.FromBase64String(this.GetField("X509Certificate")[0]); }
|
|
set
|
|
{
|
|
this.SetOrAddField("X509Certificate",Convert.ToBase64String(value));
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of AMT_PublicKeyCertificate class at an endpoint.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
/// <param name="cimKeys">Keys for selecting the instances</param>
|
|
/// <returns>Collection of AMT_PublicKeyCertificate objects</returns>
|
|
public static new Collection<AMT_PublicKeyCertificate> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
|
|
{
|
|
List<AMT_PublicKeyCertificate> ret = CimBase.Enumerate<AMT_PublicKeyCertificate>(client, cimKeys);
|
|
return new Collection<AMT_PublicKeyCertificate>(ret);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of AMT_PublicKeyCertificate class at an endpoint.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
/// <returns>Collection of AMT_PublicKeyCertificate objects</returns>
|
|
public static new Collection<AMT_PublicKeyCertificate> Enumerate(IWSManClient client)
|
|
{
|
|
List<AMT_PublicKeyCertificate> ret = CimBase.Enumerate<AMT_PublicKeyCertificate>(client);
|
|
return new Collection<AMT_PublicKeyCertificate>(ret);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Delete the instance of AMT_PublicKeyCertificate 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 new void Delete(IWSManClient client)
|
|
{
|
|
CimBase.Delete<AMT_PublicKeyCertificate>(client);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Represents the keys of the AMT_PublicKeyCertificate class.
|
|
/// </summary>
|
|
|
|
public new class CimKeys : CIM_Credential.CimKeys
|
|
{
|
|
/// <summary>
|
|
/// Key, Required, Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies an instance of this class.
|
|
/// </summary>
|
|
|
|
public virtual string InstanceID
|
|
{
|
|
get
|
|
{
|
|
return GetKey("InstanceID");
|
|
}
|
|
set
|
|
{
|
|
SetOrAddKey("InstanceID", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|