You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following Java class encodes the certificate from `X-ARR-ClientCert` to an `X509Certificate` instance. `certificateIsValid()` validates that the certificate's thumbprint matches the one given in the constructor and that certificate has not expired.
216
+
217
+
218
+
```java
219
+
importjava.io.ByteArrayInputStream;
220
+
importjava.security.NoSuchAlgorithmException;
221
+
importjava.security.cert.*;
222
+
importjava.security.MessageDigest;
223
+
224
+
importsun.security.provider.X509Factory;
225
+
226
+
importjavax.xml.bind.DatatypeConverter;
227
+
importjava.util.Base64;
228
+
importjava.util.Date;
229
+
230
+
publicclassClientCertValidator {
231
+
232
+
privateString thumbprint;
233
+
privateX509Certificate certificate;
234
+
235
+
/**
236
+
* Constructor.
237
+
* @param certificate The certificate from the "X-ARR-ClientCert" HTTP header
238
+
* @param thumbprint The thumbprint to check against
239
+
* @throws CertificateException If the certificate factory cannot be created.
0 commit comments