Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CertificateSerialNumberMatch.cs
1using System.Threading.Tasks;
2using System.Xml;
5
7{
12 {
17 : base()
18 {
19 }
20
28 : base(Xml, Parent, Document)
29 {
30 }
31
35 public override string LocalName => nameof(CertificateSerialNumberMatch);
36
44 public override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document) => new CertificateSerialNumberMatch(Xml, Parent, Document);
45
51 public override async Task<WafResult?> Review(ProcessingState State)
52 {
53 HttpRequest Request = State.Request;
54
55 if (!(Request.RemoteCertificate is null) && (Request.RemoteCertificateValid || await this.GetTrust(State)))
56 return await this.Review(State, Request.RemoteCertificate.GetSerialNumberString());
57 else
58 return null;
59 }
60 }
61}
Represents an HTTP request.
Definition: HttpRequest.cs:22
X509Certificate RemoteCertificate
Remote client certificate, if any, associated with the request.
Definition: HttpRequest.cs:288
bool RemoteCertificateValid
If the Remote client certificate, if any, is valid.
Definition: HttpRequest.cs:293
Checks for a match against the Certificate Serial-Number of the request.
override async Task< WafResult?> Review(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
override string LocalName
XML Local Name for the XML element defining the action.
CertificateSerialNumberMatch(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Checks for a match against the Certificate Serial-Number of the request.
override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Creates a WAF action from its XML definition.
CertificateSerialNumberMatch()
Checks for a match against the Certificate Serial-Number of the request.
Abstract base class for certificate Web Application Firewall conditions.
Contains the current state of a review process.
HttpRequest Request
Current HTTP Request
Abstract base class for Web Application Firewall actions.
Definition: WafAction.cs:17
WebApplicationFirewall Document
Web Application Firewall document.
Definition: WafAction.cs:60
Web Application Firewall for HttpServer.