Beispiel #1
0
            internal static void ziti_enroll_cb_impl(IntPtr ziti_config, int status, string msg, GCHandle enroll_context)
            {
                if (enroll_context.IsAllocated)
                {
                    Enrollment.AfterEnrollWrapper w = (Enrollment.AfterEnrollWrapper)enroll_context.Target;
                    w.wrapper.Dispose();

                    ZitiEnrollment.EnrollmentResult r = new ZitiEnrollment.EnrollmentResult(ziti_config)
                    {
                        Status  = (ZitiStatus)status,
                        Message = msg,
                        Context = w.Context,
                    };

                    if (r.Status.Ok())
                    {
                        ZitiIdentityFormatNative fromZiti = Marshal.PtrToStructure <ZitiIdentityFormatNative>(ziti_config);
                        r.ZitiIdentity = new ZitiIdentityFormat(fromZiti);
                    }

                    w.AfterEnroll(r);
                }
                else
                {
                    Console.WriteLine("unexpected situation");
                }
            }
 internal ZitiIdentityFormat(ZitiIdentityFormatNative native)
 {
     this.ControllerUrl = native.ControllerUrl;
     this.IdMaterial    = new IdMaterial()
     {
         CA          = native.IdMaterial.CA,
         Certificate = native.IdMaterial.Certificate,
         Key         = native.IdMaterial.Key,
     };
 }