示例#1
0
    public string[] DokumaniImzalayanTCKimlikNolariDon(string DosyaYolu)
    {
        string[] returnValue = new string[20];
        byte[] bytedata = File.ReadAllBytes(DosyaYolu);
        if (bytedata != null)
        {
            try
            {
                using (ServiceCMSValidate.ServiceCMSValidate client = new ServiceCMSValidate.ServiceCMSValidate())
                {
                    ServiceCMSValidate.CmsValidationRequestType request =
                        new ServiceCMSValidate.CmsValidationRequestType();
                    request.SignedData = bytedata;
                    ServiceCMSValidate.CmsValidationResponseType response = client.ValidateSignedData(request);
                    if (response.ResponseInfo.ResultCode == ServiceCMSValidate.GeneralTypesResultCodeType.Successful)
                    {
                        ServiceCMSValidate.GeneralTypesSignerInfo[] signers = response.SignerInfo;
                        if (signers != null)
                        {
                            for (int i = 0; i < signers.Length; i++)
                            {
                                returnValue[i] = signers[i].CertificateTCKNo;
                                //if (i == 0) returnValue = "- " + signers[i].CertificateOwner + " " + signers[i].SigningTime;
                                //else returnValue += signers[i].CertificateOwner + " " + signers[i].SigningTime;
                                //if (signers.Length > 1)
                                //{
                                //    if (i != signers.Length - 1)
                                //        returnValue += " <br/>- ";
                                //}
                            }
                        }
                    }
                }

            }
            catch
            {
                returnValue[0] = "Imza Bilgisi Yok";
            }
        }
        return returnValue;
    }
示例#2
0
    //public  ServiceCMSValidate.GeneralTypesSignerInfo[] SignersInfo(string DosyaYolu)
    public string SignersInfo(string DosyaYolu)
    {
        string returnValue = String.Empty;
        try
        {

            byte[] bytedata = File.ReadAllBytes(DosyaYolu);
            if (bytedata != null)
            {

                using (ServiceCMSValidate.ServiceCMSValidate client = new ServiceCMSValidate.ServiceCMSValidate())
                {
                    ServiceCMSValidate.CmsValidationRequestType request =
                        new ServiceCMSValidate.CmsValidationRequestType();
                    request.SignedData = bytedata;
                    ServiceCMSValidate.CmsValidationResponseType response = client.ValidateSignedData(request);
                    if (response.ResponseInfo.ResultCode == ServiceCMSValidate.GeneralTypesResultCodeType.Successful)
                    {
                        ServiceCMSValidate.GeneralTypesSignerInfo[] signers = response.SignerInfo;
                        if (signers != null)
                        {
                            for (int i = 0; i < signers.Length; i++)
                            {
                                if (i == 0)
                                    returnValue = "- " + signers[i].CertificateOwner + " " + signers[i].SigningTime;
                                else returnValue += signers[i].CertificateOwner + " " + signers[i].SigningTime;
                                if (signers.Length > 1)
                                {
                                    if (i != signers.Length - 1)
                                        returnValue += " <br/>- ";
                                }
                            }
                        }
                    }
                }

            }
        }
        catch
        {
            returnValue = "Imza Bilgisi Yok";
        }

        return returnValue;
    }