168 lines
5.0 KiB
C#
168 lines
5.0 KiB
C#
//----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
|
|
//
|
|
// File: AMT_PublicPrivateKeyPair.cs
|
|
//
|
|
// Contents: This class represents a public-private key in the Intel(R) AMT CertStore.
|
|
// This file was automatically generated from AMT_PublicPrivateKeyPair.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 public-private key in the Intel(R) AMT CertStore.
|
|
/// </summary>
|
|
[System.SerializableAttribute()]
|
|
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicPrivateKeyPair")]
|
|
[System.Xml.Serialization.XmlRootAttribute("AMT_PublicPrivateKeyPair", Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicPrivateKeyPair", IsNullable=false)]
|
|
public class AMT_PublicPrivateKeyPair : CIM_Credential
|
|
{
|
|
/// <summary>
|
|
/// Default constructor.
|
|
/// </summary>
|
|
public AMT_PublicPrivateKeyPair() :base()
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Constructor that recieves an xml string for deserialization.
|
|
/// </summary>
|
|
/// <param name="xml">xml string to deserialize</param>
|
|
public AMT_PublicPrivateKeyPair(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_PublicPrivateKeyPair(IWSManClient client): base(client)
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Remove DERKey field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemoveDERKey()
|
|
{
|
|
RemoveField("DERKey");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field DERKey exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool DERKeyExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("DERKey");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, RSA Key encoded as DES PKCS#1. The Exponent (E) is 65537 (0x010001).When this structure is used as an output parameter (GET or PULL method),only the public section of the key is exported.
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual byte[] DERKey
|
|
{
|
|
get
|
|
{
|
|
return Convert.FromBase64String(this.GetField("DERKey")[0]); }
|
|
set
|
|
{
|
|
this.SetOrAddField("DERKey",Convert.ToBase64String(value));
|
|
}
|
|
}
|
|
|
|
|
|
/// <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>
|
|
/// Enumerate instances of AMT_PublicPrivateKeyPair 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_PublicPrivateKeyPair objects</returns>
|
|
public static new Collection<AMT_PublicPrivateKeyPair> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
|
|
{
|
|
List<AMT_PublicPrivateKeyPair> ret = CimBase.Enumerate<AMT_PublicPrivateKeyPair>(client, cimKeys);
|
|
return new Collection<AMT_PublicPrivateKeyPair>(ret);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of AMT_PublicPrivateKeyPair class at an endpoint.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
/// <returns>Collection of AMT_PublicPrivateKeyPair objects</returns>
|
|
public static new Collection<AMT_PublicPrivateKeyPair> Enumerate(IWSManClient client)
|
|
{
|
|
List<AMT_PublicPrivateKeyPair> ret = CimBase.Enumerate<AMT_PublicPrivateKeyPair>(client);
|
|
return new Collection<AMT_PublicPrivateKeyPair>(ret);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Delete the instance of AMT_PublicPrivateKeyPair 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_PublicPrivateKeyPair>(client);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Represents the keys of the AMT_PublicPrivateKeyPair 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);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|