//---------------------------------------------------------------------------- // // Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved. // // File: AMT_PublicKeyManagementService.cs // // Contents: This service contains the information necessary to represent and manage the functionality provided by the Intel(R) AMT CertStore. // This file was automatically generated from AMT_PublicKeyManagementService.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 service contains the information necessary to represent and manage the functionality provided by the Intel(R) AMT CertStore. /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService")] [System.Xml.Serialization.XmlRootAttribute("AMT_PublicKeyManagementService", Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] public class AMT_PublicKeyManagementService : CIM_CredentialManagementService { /// /// Default constructor. /// public AMT_PublicKeyManagementService() :base() { } /// /// Constructor that recieves an xml string for deserialization. /// /// xml string to deserialize public AMT_PublicKeyManagementService(string xml): base((IWSManClient)null) { this.Deserialize(xml); } /// /// Constructor which recieves a Ws-Management client object. /// /// Ws-Management client public AMT_PublicKeyManagementService(IWSManClient client): base(client) { } /// ///This call adds a Certificate revocation list to be used by the Intel(R) AMT device. /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class AddCRL_INPUT : CimParams { public AddCRL_INPUT(string ns) : base(ns) { } /// /// Optional, The issuer URL of the revoked certificates. /// [CimField(false,false)] public virtual string Url { set { this.SetOrAddField("Url",value); } } /// /// Optional, Notice: the values of this array are actually base64 encoded values. A list of serial numbers removed by the CA which is specified in the Url variable. /// [CimField(false,false)] public virtual string[] SerialNumbers { set { this.SetOrAddField("SerialNumbers",value); } } } /// ///This call adds a Certificate revocation list to be used by the Intel(R) AMT device. /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class AddCRL_OUTPUT : CimParams { public AddCRL_OUTPUT() : base("") { } /// /// Optional, Reference to the new AMT_CRL instance. /// [CimField(false,false)] public virtual CimReference CRL { get { string innerXML = this.GetField("CRL")[0]; CimReference epr = new CimReference("CRL", "http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", innerXML); return epr; } } } /// ///This call adds a Certificate revocation list to be used by the Intel(R) AMT device. /// /// Optional, IN -The issuer URL of the revoked certificates. /// Optional, IN -Notice: the values of this array are actually base64 encoded values. A list of serial numbers removed by the CA which is specified in the Url variable. /// OUT - Reference to the new AMT_CRL instance. /// /// Legal values: /// PT_STATUS_SUCCESS : 0 /// PT_STATUS_INTERNAL_ERROR : 1 /// PT_STATUS_MAX_LIMIT_REACHED : 23 /// PT_STATUS_INVALID_PARAMETER : 36 /// PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED : 38 /// public virtual uint AddCRL(string inUrl,string[] inSerialNumbers,out CimReference outCRL) { AddCRL_INPUT input = new AddCRL_INPUT(this.XmlNamespace); if (inUrl != null) input.Url=inUrl; if (inSerialNumbers != null) input.SerialNumbers=inSerialNumbers; AddCRL_OUTPUT output = new AddCRL_OUTPUT(); uint returnValue = base.Invoke("AddCRL",input,out output); outCRL=null; if (returnValue == 0) { if (output.ContainsField("CRL")) outCRL = output.CRL; } return returnValue; } /// ///Remove the usage of CRL during the authentication process /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class ResetCRLList_INPUT : CimParams { public ResetCRLList_INPUT(string ns) : base(ns) { } } /// ///Remove the usage of CRL during the authentication process /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class ResetCRLList_OUTPUT : CimParams { public ResetCRLList_OUTPUT() : base("") { } } /// ///Remove the usage of CRL during the authentication process /// /// /// Legal values: /// PT_STATUS_SUCCESS : 0 /// PT_STATUS_INTERNAL_ERROR : 1 /// PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED : 38 /// public virtual uint ResetCRLList() { ResetCRLList_INPUT input = new ResetCRLList_INPUT(this.XmlNamespace); ResetCRLList_OUTPUT output = new ResetCRLList_OUTPUT(); uint returnValue = base.Invoke("ResetCRLList",input,out output); return returnValue; } /// ///This function adds new certificate to the Intel(R) AMT CertStore. A certificate cannot be removed if it is referenced (for example, used by TLS, 802.1X or EAC). /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class AddCertificate_INPUT : CimParams { public AddCertificate_INPUT(string ns) : base(ns) { } /// /// Required, /// [CimField(false,true)] public virtual byte[] CertificateBlob { set { this.SetOrAddField("CertificateBlob",Convert.ToBase64String(value)); } } } /// ///This function adds new certificate to the Intel(R) AMT CertStore. A certificate cannot be removed if it is referenced (for example, used by TLS, 802.1X or EAC). /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class AddCertificate_OUTPUT : CimParams { public AddCertificate_OUTPUT() : base("") { } /// /// Optional, Certificate encoded in X.509 format /// [CimField(false,false)] public virtual CimReference CreatedCertificate { get { string innerXML = this.GetField("CreatedCertificate")[0]; CimReference epr = new CimReference("CreatedCertificate", "http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", innerXML); return epr; } } } /// ///This function adds new certificate to the Intel(R) AMT CertStore. A certificate cannot be removed if it is referenced (for example, used by TLS, 802.1X or EAC). /// /// Required, IN - /// OUT - Certificate encoded in X.509 format /// /// Legal values: /// PT_STATUS_SUCCESS : 0 /// PT_STATUS_INTERNAL_ERROR : 1 /// PT_STATUS_MAX_LIMIT_REACHED : 23 /// PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED : 38 /// PT_STATUS_DUPLICATE : 2058 /// PT_STATUS_INVALID_CERT : 2063 /// public virtual uint AddCertificate(byte[] inCertificateBlob,out CimReference outCreatedCertificate) { AddCertificate_INPUT input = new AddCertificate_INPUT(this.XmlNamespace); if (inCertificateBlob != null) input.CertificateBlob=inCertificateBlob; AddCertificate_OUTPUT output = new AddCertificate_OUTPUT(); uint returnValue = base.Invoke("AddCertificate",input,out output); outCreatedCertificate=null; if (returnValue == 0) { if (output.ContainsField("CreatedCertificate")) outCreatedCertificate = output.CreatedCertificate; } return returnValue; } /// ///This function adds new root certificate to the Intel(R) AMT CertStore. A certificate cannot be removed if it is referenced (for example, used by TLS, 802.1X or EAC). /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class AddTrustedRootCertificate_INPUT : CimParams { public AddTrustedRootCertificate_INPUT(string ns) : base(ns) { } /// /// Required, /// [CimField(false,true)] public virtual byte[] CertificateBlob { set { this.SetOrAddField("CertificateBlob",Convert.ToBase64String(value)); } } } /// ///This function adds new root certificate to the Intel(R) AMT CertStore. A certificate cannot be removed if it is referenced (for example, used by TLS, 802.1X or EAC). /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class AddTrustedRootCertificate_OUTPUT : CimParams { public AddTrustedRootCertificate_OUTPUT() : base("") { } /// /// Optional, Certificate encoded in X.509 format /// [CimField(false,false)] public virtual CimReference CreatedCertificate { get { string innerXML = this.GetField("CreatedCertificate")[0]; CimReference epr = new CimReference("CreatedCertificate", "http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", innerXML); return epr; } } } /// ///This function adds new root certificate to the Intel(R) AMT CertStore. A certificate cannot be removed if it is referenced (for example, used by TLS, 802.1X or EAC). /// /// Required, IN - /// OUT - Certificate encoded in X.509 format /// /// Legal values: /// PT_STATUS_SUCCESS : 0 /// PT_STATUS_INTERNAL_ERROR : 1 /// PT_STATUS_NOT_PERMITTED : 16 /// PT_STATUS_MAX_LIMIT_REACHED : 23 /// PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED : 38 /// PT_STATUS_DUPLICATE : 2058 /// PT_STATUS_INVALID_CERT : 2063 /// public virtual uint AddTrustedRootCertificate(byte[] inCertificateBlob,out CimReference outCreatedCertificate) { AddTrustedRootCertificate_INPUT input = new AddTrustedRootCertificate_INPUT(this.XmlNamespace); if (inCertificateBlob != null) input.CertificateBlob=inCertificateBlob; AddTrustedRootCertificate_OUTPUT output = new AddTrustedRootCertificate_OUTPUT(); uint returnValue = base.Invoke("AddTrustedRootCertificate",input,out output); outCreatedCertificate=null; if (returnValue == 0) { if (output.ContainsField("CreatedCertificate")) outCreatedCertificate = output.CreatedCertificate; } return returnValue; } /// ///This function adds new certificate key to the Intel(R) AMT CertStore. A key cannot be removed if its corresponding certificate is referenced (for example, used by TLS, 802.1X or EAC). /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class AddKey_INPUT : CimParams { public AddKey_INPUT(string ns) : base(ns) { } /// /// Required, RSA Key encoded as DES PKCS#1 /// [CimField(false,true)] public virtual byte[] KeyBlob { set { this.SetOrAddField("KeyBlob",Convert.ToBase64String(value)); } } } /// ///This function adds new certificate key to the Intel(R) AMT CertStore. A key cannot be removed if its corresponding certificate is referenced (for example, used by TLS, 802.1X or EAC). /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class AddKey_OUTPUT : CimParams { public AddKey_OUTPUT() : base("") { } /// /// Optional, /// [CimField(false,false)] public virtual CimReference CreatedKey { get { string innerXML = this.GetField("CreatedKey")[0]; CimReference epr = new CimReference("CreatedKey", "http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", innerXML); return epr; } } } /// ///This function adds new certificate key to the Intel(R) AMT CertStore. A key cannot be removed if its corresponding certificate is referenced (for example, used by TLS, 802.1X or EAC). /// /// Required, IN -RSA Key encoded as DES PKCS#1 /// OUT - /// /// Legal values: /// PT_STATUS_SUCCESS : 0 /// PT_STATUS_INTERNAL_ERROR : 1 /// PT_STATUS_MAX_LIMIT_REACHED : 23 /// PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED : 38 /// PT_STATUS_DUPLICATE : 2058 /// PT_STATUS_INVALID_KEY : 2062 /// public virtual uint AddKey(byte[] inKeyBlob,out CimReference outCreatedKey) { AddKey_INPUT input = new AddKey_INPUT(this.XmlNamespace); if (inKeyBlob != null) input.KeyBlob=inKeyBlob; AddKey_OUTPUT output = new AddKey_OUTPUT(); uint returnValue = base.Invoke("AddKey",input,out output); outCreatedKey=null; if (returnValue == 0) { if (output.ContainsField("CreatedKey")) outCreatedKey = output.CreatedKey; } return returnValue; } /// ///This API is used to create a PKCS#10 certificate signing request based on a key from the key store. /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class GeneratePKCS10RequestEx_INPUT : CimParams { public GeneratePKCS10RequestEx_INPUT(string ns) : base(ns) { } /// /// Required, An EPR to a key pair. /// [CimField(false,false)] public virtual CimReference KeyPair { set { this.SetOrAddField("KeyPair",value.Serialize(false)); } } /// /// Required, The signing algorithm that the FW should use for signing the certificate request /// [CimField(false,true)] public virtual uint SigningAlgorithm { set { this.SetOrAddField("SigningAlgorithm",value.ToString(CultureInfo.InvariantCulture)); } } /// /// Required, A binary representation of the null-signed PKCS#10 request.the request must include a valid PKCS10RequestInfo, that will be signed by AMT FW. The Public Key specified in the request must match the public key of the referenced KeyPair parameter. /// [CimField(false,true)] public virtual byte[] NullSignedCertificateRequest { set { this.SetOrAddField("NullSignedCertificateRequest",Convert.ToBase64String(value)); } } } /// ///This API is used to create a PKCS#10 certificate signing request based on a key from the key store. /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class GeneratePKCS10RequestEx_OUTPUT : CimParams { public GeneratePKCS10RequestEx_OUTPUT() : base("") { } /// /// Optional, A binary representation of the PKCS#10 request, signed by FW. /// [CimField(false,false)] public virtual byte[] SignedCertificateRequest { get { return Convert.FromBase64String(this.GetField("SignedCertificateRequest")[0]); } } } /// ///This API is used to create a PKCS#10 certificate signing request based on a key from the key store. /// /// Required, IN -An EPR to a key pair. /// Required, IN -The signing algorithm that the FW should use for signing the certificate request /// Required, IN -A binary representation of the null-signed PKCS#10 request.the request must include a valid PKCS10RequestInfo, that will be signed by AMT FW. The Public Key specified in the request must match the public key of the referenced KeyPair parameter. /// OUT - A binary representation of the PKCS#10 request, signed by FW. /// /// Legal values: /// PT_STATUS_SUCCESS : 0 /// PT_STATUS_INTERNAL_ERROR : 1 /// PT_STATUS_INVALID_PARAMETER : 36 /// PT_STATUS_UNSUPPORTED : 2066 /// public virtual uint GeneratePKCS10RequestEx(CimReference inKeyPair,uint? inSigningAlgorithm,byte[] inNullSignedCertificateRequest,out byte[] outSignedCertificateRequest) { GeneratePKCS10RequestEx_INPUT input = new GeneratePKCS10RequestEx_INPUT(this.XmlNamespace); if (inKeyPair != null) input.KeyPair=inKeyPair; if (inSigningAlgorithm.HasValue) input.SigningAlgorithm=inSigningAlgorithm.Value; if (inNullSignedCertificateRequest != null) input.NullSignedCertificateRequest=inNullSignedCertificateRequest; GeneratePKCS10RequestEx_OUTPUT output = new GeneratePKCS10RequestEx_OUTPUT(); uint returnValue = base.Invoke("GeneratePKCS10RequestEx",input,out output); outSignedCertificateRequest=null; if (returnValue == 0) { if (output.ContainsField("SignedCertificateRequest")) outSignedCertificateRequest = output.SignedCertificateRequest; } return returnValue; } /// ///This API is used to generate a key in the FW /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class GenerateKeyPair_INPUT : CimParams { public GenerateKeyPair_INPUT(string ns) : base(ns) { } /// /// Required, The algorithm of the generated key. /// [CimField(false,true)] public virtual uint KeyAlgorithm { set { this.SetOrAddField("KeyAlgorithm",value.ToString(CultureInfo.InvariantCulture)); } } /// /// Required, The length of the generatd key in bits. /// [CimField(false,true)] public virtual uint KeyLength { set { this.SetOrAddField("KeyLength",value.ToString(CultureInfo.InvariantCulture)); } } } /// ///This API is used to generate a key in the FW /// [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", IsNullable=false)] private class GenerateKeyPair_OUTPUT : CimParams { public GenerateKeyPair_OUTPUT() : base("") { } /// /// Optional, An EPR to a key pair. /// [CimField(false,false)] public virtual CimReference KeyPair { get { string innerXML = this.GetField("KeyPair")[0]; CimReference epr = new CimReference("KeyPair", "http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService", innerXML); return epr; } } } /// ///This API is used to generate a key in the FW /// /// Required, IN -The algorithm of the generated key. /// Required, IN -The length of the generatd key in bits. /// OUT - An EPR to a key pair. /// /// Legal values: /// PT_STATUS_SUCCESS : 0 /// PT_STATUS_INTERNAL_ERROR : 1 /// PT_STATUS_MAX_LIMIT_REACHED : 23 /// PT_STATUS_INVALID_PARAMETER : 36 /// PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED : 38 /// PT_STATUS_UNSUPPORTED : 2066 /// PT_STATUS_OPERATION_IN_PROGRESS : 2082 /// public virtual uint GenerateKeyPair(uint? inKeyAlgorithm,uint? inKeyLength,out CimReference outKeyPair) { GenerateKeyPair_INPUT input = new GenerateKeyPair_INPUT(this.XmlNamespace); if (inKeyAlgorithm.HasValue) input.KeyAlgorithm=inKeyAlgorithm.Value; if (inKeyLength.HasValue) input.KeyLength=inKeyLength.Value; GenerateKeyPair_OUTPUT output = new GenerateKeyPair_OUTPUT(); uint returnValue = base.Invoke("GenerateKeyPair",input,out output); outKeyPair=null; if (returnValue == 0) { if (output.ContainsField("KeyPair")) outKeyPair = output.KeyPair; } return returnValue; } /// /// Enumerate instances of AMT_PublicKeyManagementService class at an endpoint. /// /// WS-Management client /// Keys for selecting the instances /// Collection of AMT_PublicKeyManagementService 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_PublicKeyManagementService class at an endpoint. /// /// WS-Management client /// Collection of AMT_PublicKeyManagementService objects public static new Collection Enumerate(IWSManClient client) { List ret = CimBase.Enumerate(client); return new Collection(ret); } /// /// Delete the instance of AMT_PublicKeyManagementService 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_PublicKeyManagementService class. /// public new class CimKeys : CIM_CredentialManagementService.CimKeys { } } }