コード例 #1
0
        public virtual JObject GetPublicKey(HttpContext context)
        {
            RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider(1024);
            string publicKey  = rsaProvider.ToXmlString(false);
            string privateKey = rsaProvider.ToXmlString(true);

            string keystore      = YZTempStorageManager.CurrentStore.Save(privateKey);
            string publicKeyPKCS = YZSecurityHelper.RSAPublicKeyDotNet2PCKS(publicKey);

            JObject rv = new JObject();

            rv["success"]   = true;
            rv["publicKey"] = publicKeyPKCS;
            rv["keystore"]  = keystore;
            return(rv);
        }
コード例 #2
0
    public virtual void GetPublicKey()
    {
        RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider(1024);
        string publicKey  = rsaProvider.ToXmlString(false);
        string privateKey = rsaProvider.ToXmlString(true);

        string keystore      = YZTempStorageManager.CurrentStore.Save(privateKey);
        string publicKeyPKCS = YZSecurityHelper.RSAPublicKeyDotNet2PCKS(publicKey);

        JObject rv = new JObject();

        rv["success"]   = true;
        rv["publicKey"] = publicKeyPKCS;
        rv["keystore"]  = keystore;
        this.Response.Write(rv.ToString(Formatting.Indented, YZJsonHelper.Converters));
        this.Response.End();
    }