Esempio n. 1
0
        public void setKey(keyInfo key)
        {
            byte[] y = null;
            if (key.pub.childs[1].childs[0].childs[0].payload[0] == 0)
            {
                y = key.pub.childs[1].childs[0].childs[0].payload.Skip(1).ToArray();
            }
            else
            {
                y = key.pub.childs[1].childs[0].childs[0].payload;
            }

            n = Convert.ToBase64String(y).TrimEnd('=').Replace('+', '-').Replace('/', '_');
            if (key.pub.childs[1].childs[0].childs[1].payload[0] == 0)
            {
                y = key.pub.childs[1].childs[0].childs[1].payload.Skip(1).ToArray();
            }
            else
            {
                y = key.pub.childs[1].childs[0].childs[1].payload;
            }
            e            = Convert.ToBase64String(y).TrimEnd('=').Replace('+', '-').Replace('/', '_');
            json_jwk_raw = String.Format("{{\"e\":\"{0}\",\"kty\":\"RSA\",\"n\":\"{1}\"}}", e, n);
            thumbprint   = Convert.ToBase64String(SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(json_jwk_raw))).TrimEnd('=').Replace('+', '-').Replace('/', '_');
            json_jwk     = "{\"alg\":\"RS256\",\"jwk\":" + json_jwk_raw + "}";
            e            = null;
            n            = null;
            me           = this;
            _key         = key;
        }
Esempio n. 2
0
 public void Dispose()
 {
     _csr         = null;
     json_jwk_raw = null;
     json_jwk     = null;
     thumbprint   = null;
     me           = null;
 }
Esempio n. 3
0
 static public void Clear()
 {
     if (session != null)
     {
         session.Dispose();
         session = null;
     }
     if (le != null)
     {
         le.Dispose();
         le = null;
     }
     session  = new storageInfo();
     le       = new LE();
     state    = formState.NONE;
     modified = formModState.UNMODIFIED;
 }