public static void ClientCertificateGetDetails(
            HeContext heContext,
            out string cookie,
            out int flags,
            out bool isPresent,
            out string issuer,
            out bool isValid,
            out string serialNumber,
            out string serverIssuer,
            out string serverSubject,
            out string subject,
            out DateTime validFrom,
            out DateTime validUntil)
        {
            cookie        = "";
            flags         = 0;
            isPresent     = false;
            issuer        = "";
            isValid       = false;
            serialNumber  = "";
            serverIssuer  = "";
            serverSubject = "";
            subject       = "";
            validFrom     = BuiltInFunction.NullDate();
            validUntil    = BuiltInFunction.NullDate();


            {
                System.Web.HttpClientCertificate cert = System.Web.HttpContext.Current.Request.ClientCertificate;
                cookie        = cert.Cookie;
                flags         = cert.Flags;
                isPresent     = cert.IsPresent;
                issuer        = cert.Issuer;
                isValid       = cert.IsValid;
                serialNumber  = cert.SerialNumber;
                serverIssuer  = cert.ServerIssuer;
                serverSubject = cert.ServerSubject;
                subject       = cert.Subject;
                validFrom     = cert.ValidFrom;
                validUntil    = cert.ValidUntil;
            }
        }
 public bool IsAuthenticated(HttpClientCertificate httpClientCertificate)
 {
     var certificate = new X509Certificate2(httpClientCertificate.Certificate);
     return !certificate.Archived && certificate.Verify();
 }
예제 #3
0
		public void SetClientCertificate(HttpClientCertificate val)
		{
			_clientCertificate = val;
		}
 public HttpClientCertificateProxy(HttpClientCertificate httpClientCertificate)
 {
     _httpClientCertificate = httpClientCertificate;
 }
예제 #5
0
		public void FixtureSetUp ()
		{
			HttpWorkerRequest hwr = new MonoTests.System.Web.MyHttpWorkerRequest ();
			hcc = new HttpContext (hwr).Request.ClientCertificate;
		}
예제 #6
0
 public static IHttpClientCertificate Cast(HttpClientCertificate clientCertificate)
 {
     return new HttpClientCertificateProxy(clientCertificate);
 }
예제 #7
0
 /// <summary>
 /// Sets the client security certificate.
 /// </summary>
 /// <param name="clientCertificate">The client security certificate.</param>
 public void SetClientCertificate(HttpClientCertificate clientCertificate)
 {
     this.clientCertificate = clientCertificate;
 }