//----------------------------------------------------------------------------
//
// 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
{
///
///This class represents a X.509 Certificate in the Intel(R) AMT CertStore.
///
[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
{
///
/// Default constructor.
///
public AMT_PublicKeyCertificate() :base()
{
}
///
/// Constructor that recieves an xml string for deserialization.
///
/// xml string to deserialize
public AMT_PublicKeyCertificate(string xml): base((IWSManClient)null)
{
this.Deserialize(xml);
}
///
/// Constructor which recieves a Ws-Management client object.
///
/// Ws-Management client
public AMT_PublicKeyCertificate(IWSManClient client): base(client)
{
}
///
/// Key, Required, Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies an instance of this class.
///
[CimField(true, true)]
public override string InstanceID
{
get
{
return this.GetField("InstanceID")[0];
}
set
{
this.SetOrAddField("InstanceID",value);
}
}
///
/// Remove Issuer field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemoveIssuer()
{
RemoveField("Issuer");
}
///
/// Is true if the field Issuer exists in the current object,
/// otherwise is false.
///
public virtual bool IssuerExist
{
get
{
return ContainsField("Issuer");
}
}
///
/// Optional, The Issuer field of this certificate.
///
[CimField(false, false)]
public virtual string Issuer
{
get
{
return this.GetField("Issuer")[0];
}
set
{
this.SetOrAddField("Issuer",value);
}
}
///
/// Remove ReadOnlyCertificate field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemoveReadOnlyCertificate()
{
RemoveField("ReadOnlyCertificate");
}
///
/// Is true if the field ReadOnlyCertificate exists in the current object,
/// otherwise is false.
///
public virtual bool ReadOnlyCertificateExist
{
get
{
return ContainsField("ReadOnlyCertificate");
}
}
///
/// 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
///
[CimField(false, false)]
public virtual bool ReadOnlyCertificate
{
get
{
return bool.Parse(this["ReadOnlyCertificate"][0]);
}
set
{
this.SetOrAddField("ReadOnlyCertificate",value.ToString().ToLower(CultureInfo.InvariantCulture));
}
}
///
/// Remove Subject field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemoveSubject()
{
RemoveField("Subject");
}
///
/// Is true if the field Subject exists in the current object,
/// otherwise is false.
///
public virtual bool SubjectExist
{
get
{
return ContainsField("Subject");
}
}
///
/// Optional, The Subject field of this certificate.
///
[CimField(false, false)]
public virtual string Subject
{
get
{
return this.GetField("Subject")[0];
}
set
{
this.SetOrAddField("Subject",value);
}
}
///
/// Remove TrustedRootCertficate field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemoveTrustedRootCertficate()
{
RemoveField("TrustedRootCertficate");
}
///
/// Is true if the field TrustedRootCertficate exists in the current object,
/// otherwise is false.
///
public virtual bool TrustedRootCertficateExist
{
get
{
return ContainsField("TrustedRootCertficate");
}
}
///
/// Optional, For root certificate [that were added by AMT_PublicKeyManagementService.AddTrustedRootCertificate()]this property will be true.
///
[CimField(false, false)]
public virtual bool TrustedRootCertficate
{
get
{
return bool.Parse(this["TrustedRootCertficate"][0]);
}
set
{
this.SetOrAddField("TrustedRootCertficate",value.ToString().ToLower(CultureInfo.InvariantCulture));
}
}
///
/// Remove X509Certificate field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemoveX509Certificate()
{
RemoveField("X509Certificate");
}
///
/// Is true if the field X509Certificate exists in the current object,
/// otherwise is false.
///
public virtual bool X509CertificateExist
{
get
{
return ContainsField("X509Certificate");
}
}
///
/// Optional, The X.509 Certificate blob.
///
[CimField(false, false)]
public virtual byte[] X509Certificate
{
get
{
return Convert.FromBase64String(this.GetField("X509Certificate")[0]); }
set
{
this.SetOrAddField("X509Certificate",Convert.ToBase64String(value));
}
}
///
/// Enumerate instances of AMT_PublicKeyCertificate class at an endpoint.
///
/// WS-Management client
/// Keys for selecting the instances
/// Collection of AMT_PublicKeyCertificate objects
public static new Collection Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
{
List ret = CimBase.Enumerate(client, cimKeys);
return new Collection(ret);
}
///
/// Enumerate instances of AMT_PublicKeyCertificate class at an endpoint.
///
/// WS-Management client
/// Collection of AMT_PublicKeyCertificate objects
public static new Collection Enumerate(IWSManClient client)
{
List ret = CimBase.Enumerate(client);
return new Collection(ret);
}
///
/// Delete the instance of AMT_PublicKeyCertificate if it is singular.
/// Note: This method will succeed only if a single instance of the class exists.
///
/// WS-Management client
public static new void Delete(IWSManClient client)
{
CimBase.Delete(client);
}
///
/// Represents the keys of the AMT_PublicKeyCertificate class.
///
public new class CimKeys : CIM_Credential.CimKeys
{
///
/// Key, Required, Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies an instance of this class.
///
public virtual string InstanceID
{
get
{
return GetKey("InstanceID");
}
set
{
SetOrAddKey("InstanceID", value);
}
}
}
}
}