using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using CryptoCMP.CertsCRLS;
using CryptoCMP.CAInteraction;
using CryptoCMP.Utils;
namespace VerifyObject_n
{
    class Program
    {
        static void Main(string[] args)
        {
            CRLRequest crl_req = new CRLRequest();
            int err = 0;
            byte[] crl_req_byte = crl_req.FormCurrentCRLRequest("profile://OCSP_TEST");
            SendRequest send = new SendRequest();
            byte[] resp3 = send.SendMessage(1, "192.168.10.30", "62295", crl_req_byte, ref err);
            byte[] crl = crl_req.VerifyCRLResponce("profile://OCSP_TEST", resp3);            
            
            VerifyObject ver_obj = new VerifyObject();
            FileStream fff = new FileStream("c:\\1\\rev_cert.cer", FileMode.OpenOrCreate);
            byte[] cert_rev = new byte[fff.Length];
            fff.Read(cert_rev, 0, cert_rev.Length);
            fff.Close();


            int h = ver_obj.GetCertStatusByCRL("profile://OCSP_TEST", cert_rev, crl);
            bool k = ver_obj.VerifyCertSignature("profile://OCSP_TEST", cert_rev);
            bool g = ver_obj.VerifyCRLSignature("profile://OCSP_TEST", crl);
        }
    }
}
