public Bootstrap(Model.BootstrapServer item) { Url = item.Url; if (item.ServerCertificate != null) { ServerCertificate = new Certificate(item.ServerCertificate); } Model.PSKIdentity pskIdentity = item.GetPSKIdentity(); if (pskIdentity != null) { ServerIdentity = new PSKIdentity(pskIdentity); } }
public IActionResult RemovePSKIdentity(string identity) { IActionResult result; Model.PSKIdentity pskIdentity = BusinessLogicFactory.Identities.GetPSKIdentity(identity); if (pskIdentity == null) { result = new NotFoundResult(); } else { BusinessLogicFactory.Identities.SavePSKIdentity(pskIdentity, Model.TObjectState.Delete); result = new NoContentResult(); } return(result); }
public IActionResult AddPSKIdentity() { IActionResult result = null; string rootUrl = Request.GetRootUrl(); Model.PSKIdentity item = new Model.PSKIdentity(); item.OrganisationID = User.GetOrganisationID(); BusinessLogicFactory.Identities.SavePSKIdentity(item, Model.TObjectState.Add); ServiceModels.PSKIdentity response = new ServiceModels.PSKIdentity(item); response.Secret = item.Secret; response.AddSelfLink(string.Concat(rootUrl, "/identities/psk/", response.Identity), false, true); result = Request.GetObjectResult(response, System.Net.HttpStatusCode.Created); return result; }
public IActionResult AddPSKIdentity() { IActionResult result = null; string rootUrl = Request.GetRootUrl(); Model.PSKIdentity item = new Model.PSKIdentity(); item.OrganisationID = User.GetOrganisationID(); BusinessLogicFactory.Identities.SavePSKIdentity(item, Model.TObjectState.Add); ServiceModels.PSKIdentity response = new ServiceModels.PSKIdentity(item); response.Secret = item.Secret; response.AddSelfLink(string.Concat(rootUrl, "/identities/psk/", response.Identity), false, true); result = Request.GetObjectResult(response, System.Net.HttpStatusCode.Created); return(result); }
public IActionResult GetPSKIdentity(string identity) { IActionResult result; Model.PSKIdentity pskIdentity = BusinessLogicFactory.Identities.GetPSKIdentity(identity); if (pskIdentity == null) { result = new NotFoundResult(); } else { ServiceModels.PSKIdentity response = new ServiceModels.PSKIdentity(pskIdentity); string rootUrl = Request.GetRootUrl(); response.AddSelfLink(string.Concat(rootUrl, "/identities/psk/", response.Identity), false, true); result = Request.GetObjectResult(response); } return(result); }
public PSKIdentity(Model.PSKIdentity item) { Identity = item.Identity; }