Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 public PSKIdentity(Model.PSKIdentity item)
 {
     Identity = item.Identity;
 }