Documentation

Mistake on this page? Email us
Public Member Functions | Static Public Member Functions | Properties | List of all members
MbedCloudSDK.Certificates.Api.CertificatesApi Class Reference

Certificates Api More...

Inheritance diagram for MbedCloudSDK.Certificates.Api.CertificatesApi:
MbedCloudSDK.Common.Api

Public Member Functions

 CertificatesApi (Config config)
 Initializes a new instance of the CertificatesApi class. Initalize certificates api More...
 
Certificate AddCertificate (Certificate certificate, string certificateData=null, string signature=null)
 Create a new Certificate. More...
 
Certificate AddDeveloperCertificate (Certificate certificate)
 Add Developer Certificate More...
 
void DeleteCertificate (string certificateId)
 Delete certificate. More...
 
Certificate GetCertificate (string certificateId)
 Get certificate by Id. More...
 
PaginatedResponse< QueryOptions, CertificateListCertificates (QueryOptions options=null)
 Lists certificates. More...
 
Certificate UpdateCertificate (string certificateId, Certificate updatedCertificate)
 Update Certificate. More...
 

Static Public Member Functions

static ApiMetadata GetLastApiMetadata ()
 Get meta data for the last Pelion Device Management API call More...
 

Properties

connector_ca.Model.CredentialsResponseData BootstrapServerCredentials [get]
 Gets Bootstrap server uri More...
 
connector_ca.Model.CredentialsResponseData Lmw2mServerCredentials [get]
 Gets lmw2m server Uri More...
 
- Properties inherited from MbedCloudSDK.Common.Api
static string UserAgent [get, set]
 Gets or sets the user agent. More...
 
Config Config [get]
 Gets config More...
 

Additional Inherited Members

- Protected Member Functions inherited from MbedCloudSDK.Common.Api
 Api (Config config)
 Initializes a new instance of the Api class. More...
 
- Static Protected Attributes inherited from MbedCloudSDK.Common.Api
static readonly ILog Log = LogManager.GetLogger(typeof(Api))
 The log More...
 

Detailed Description

Certificates Api

This API is intialized with a Config object.

var config = new config(apiKey);
var connectApi = new CertificatesApi(config);

Constructor & Destructor Documentation

MbedCloudSDK.Certificates.Api.CertificatesApi.CertificatesApi ( Config  config)
inline

Initializes a new instance of the CertificatesApi class. Initalize certificates api

Parameters
configConfig

Member Function Documentation

Certificate MbedCloudSDK.Certificates.Api.CertificatesApi.AddCertificate ( Certificate  certificate,
string  certificateData = null,
string  signature = null 
)
inline

Create a new Certificate.

Parameters
certificateCertificate to be created.
certificateDataX509.v3 trusted certificate in PEM or base64 encoded DER format. Null for developer certificate.
signatureBase64 encoded signature of the account ID signed by the certificate to be uploaded. Signature must be hashed with SHA256. Null for developer certificate.
Returns
Certificate

This sample shows how to call the CertificatesApi.AddCertificate(Certificate, string, string) method.

try {
var certificate = new Certificate(certificateType: CertificateType.Bootstrap)
{
Name = "certificate",
Description = "This is my certificate",
};
var newCertificate = api.AddCertificate(certificate, "-----BEGIN CERTIFICATE-----\nMIICFzCCAbygAwIBAgIQX ... EPSDKEF\n-----END CERTIFICATE-----", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
return newCertificate;
}
catch (CloudApiException) {
throw;
}
Exceptions
CloudApiExceptionCloudApiException
Certificate MbedCloudSDK.Certificates.Api.CertificatesApi.AddDeveloperCertificate ( Certificate  certificate)
inline

Add Developer Certificate

This sample shows how to call the CertificatesApi.AddDeveloperCertificate(Certificate) method.

try {
var certificate = new Certificate
{
Name = "certificate",
Description = "This is my certificate",
};
var newCertificate = api.AddDeveloperCertificate(certificate);
return newCertificate;
}
catch (CloudApiException) {
throw;
}
Parameters
certificateCertificate
Returns
Certificate
Exceptions
CloudApiExceptionCloudApiException
void MbedCloudSDK.Certificates.Api.CertificatesApi.DeleteCertificate ( string  certificateId)
inline

Delete certificate.

Parameters
certificateIdId

This sample shows how to call the CertificatesApi.DeleteCertificate(string) method.

try
{
certificatesApi.DeleteCertificate("015c64f76a7b02420a01230a0000000");
}
catch (CloudApiException) {
Throw;
}
Exceptions
CloudApiExceptionCloudApiException
Certificate MbedCloudSDK.Certificates.Api.CertificatesApi.GetCertificate ( string  certificateId)
inline

Get certificate by Id.

This example shows how to use the CertificatesApi.GetCertificate(string) method.

try
{
var certificate = certificatesApi.GetCertificate("015c64f76a7b02420a01230a0000000");
return certificate;
}
catch (CloudApiException)
{
throw;
}
Parameters
certificateIdId
Returns
Certificate
Exceptions
CloudApiExceptionCloudApiException
static ApiMetadata MbedCloudSDK.Certificates.Api.CertificatesApi.GetLastApiMetadata ( )
inlinestatic

Get meta data for the last Pelion Device Management API call

Returns
ApiMetadata
PaginatedResponse<QueryOptions, Certificate> MbedCloudSDK.Certificates.Api.CertificatesApi.ListCertificates ( QueryOptions  options = null)
inline

Lists certificates.

This example shows how to use the CertificatesApi.ListCertificates(QueryOptions) method.

try
{
var options = new QueryOptions
{
Limit = 5,
Order = "ASC",
};
options.Filter.Add("type", "bootstrap");
var certificates = certificatesApi.ListCertificates(options);
foreach (item in certificates)
{
Console.WriteLine(item);
}
return certificates;
}
catch (CloudApiException)
{
throw;
}

Currently returns partially populated certificates. To obtain the full certificate object:

try
{
var list = certificatesApi.ListCertificates().Data
.Select(cert => certificatesApi.GetCertificate(cert.Id))
.ToList();
}
catch (CloudApiException)
{
throw;
}
Returns
Paginated response with Certificate
Parameters
optionsQueryOptions
Exceptions
CloudApiExceptionCloudApiException
Certificate MbedCloudSDK.Certificates.Api.CertificatesApi.UpdateCertificate ( string  certificateId,
Certificate  updatedCertificate 
)
inline

Update Certificate.

This example shows how to use the CertificatesApi.UpdateCertificate(string, Certificate) method.

try
{
var updatedCertificate = new Certificate
{
Name = "updatedCertificate",
Description = "updated certificate description",
}
var certificate = certificatesApi.UpdateCertificate("015c64f76a7b02420a01230a00000000", updatedCertificate);
return certificate;
}
catch (CloudApiException)
{
throw;
}
Parameters
certificateIdId
updatedCertificateCertificate
Returns
Certificate
Exceptions
CloudApiExceptionCloudApiException

Property Documentation

connector_ca.Model.CredentialsResponseData MbedCloudSDK.Certificates.Api.CertificatesApi.BootstrapServerCredentials
get

Gets Bootstrap server uri

The bootstrap server credentials.

connector_ca.Model.CredentialsResponseData MbedCloudSDK.Certificates.Api.CertificatesApi.Lmw2mServerCredentials
get

Gets lmw2m server Uri


The documentation for this class was generated from the following file: