コード例 #1
0
        private static void FileGSTR1WithDSC(string gstin, string fp, string pan)
        {
            GSTNAuthClient client  = GetAuth(gstin);
            GSTR1ApiClient client2 = new GSTR1ApiClient(client, gstin, fp);
            var            model2  = client2.GetSummary(fp).Data;

            var json2 = Convert.ToBase64String(Encoding.UTF8.GetBytes(client2.LastJson));
            var json3 = EncryptionUtils.sha256_hash(json2);

            var cert = DSCUtils.getCertificate();

            var json4   = Encoding.Unicode.GetString(DSCUtils.Sign(json3, cert));
            var result4 = client2.File(model2, json4, "DSC", pan);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Risersoft/GST
        private static void FileGSTR1WithDSC(string gstin, string gsp, string userid, string fp, string pan)
        {
            IGSTNAuthProvider client  = GetAuth(gstin, gsp, userid);
            GSTR1ApiClient    client2 = new GSTR1ApiClient(client, gstin, userid, fp);
            var model2 = client2.GetSummary().Data;

            var base64PayLoad = Convert.ToBase64String(Encoding.UTF8.GetBytes(client2.dicParams["ResponsePayload"]));
            var PayLoadHash   = Encoding.UTF8.GetBytes(EncryptionUtils.convertByteArrayToString(EncryptionUtils.sha256_hash(base64PayLoad)));

            var cert = DSCUtils.getCertificate();

            var json4   = Convert.ToBase64String(DSCUtils.SignCms(PayLoadHash, cert));
            var result4 = client2.File(model2, json4, "DSC", pan);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: AmitGST/Balaji_GST
        private static void FileGSTR1WithDSC(string gstin, string userid, string fp, string pan)
        {
            GSTNAuthClient client  = GetAuth(gstin, userid);
            GSTR1ApiClient client2 = new GSTR1ApiClient(client, gstin, fp);
            var            model2  = client2.GetSummary(fp).Data;

            model2.summ_typ = "L";
            var base64PayLoad = Convert.ToBase64String(Encoding.UTF8.GetBytes(client2.LastJson));
            var PayLoadHash   = EncryptionUtils.sha256_hash(base64PayLoad);

            var cert = DSCUtils.getCertificate();

            var json4 = Convert.ToBase64String(DSCUtils.SignCms(PayLoadHash, cert));

            var result4 = client2.File(model2, json4, "DSC", pan, fp);
        }
コード例 #4
0
        private static void FileGSTR1WithESign(string gstin, string fp, string aadhaarnum, string transactionId, string Otp)
        {
            GSTNAuthClient client  = GetAuth(gstin);
            GSTR1ApiClient client2 = new GSTR1ApiClient(client, gstin, fp);
            var            model2  = client2.GetSummary(fp).Data;

            //https://groups.google.com/forum/#!searchin/gst-suvidha-provider-gsp-discussion-group/authorized|sort:relevance/gst-suvidha-provider-gsp-discussion-group/9-_Mk7LatDs/eQ6_1kHTBAAJ
            //https://groups.google.com/forum/#!searchin/gst-suvidha-provider-gsp-discussion-group/authorized|sort:relevance/gst-suvidha-provider-gsp-discussion-group/acd-F7XPYz4/7z83KM4IBgAJ

            var json2 = Convert.ToBase64String(Encoding.UTF8.GetBytes(client2.LastJson));
            var json3 = EncryptionUtils.sha256_hash(json2);

            AuthMetaDetails MetaDetails = new AuthMetaDetails();

            MetaDetails.fdc = "NA";
            MetaDetails.udc = "NA";//Unique device code.
            MetaDetails.pip = "NA";
            MetaDetails.lot = "P";
            MetaDetails.lov = "560103";
            MetaDetails.idc = "NA";

            var json4   = eSignObj.SignText(aadhaarnum, Otp, transactionId, json3, MetaDetails);
            var result4 = client2.File(model2, json4.SignedText, "Esign", aadhaarnum);
        }