Repository: wso2/product-microgateway
Issue: Enforcer is not starting when key-store certs are created in a Windows environment

### Description

Enforcer is not starting when key-store certs are created in a Microsoft environment. Enforcer running in a Linux container and it does not match the cert generator environment and runtime environment.

The new line separator is `\\r\\n` when certs are generated in a Microsoft environment and Enforcer only accepts certs with the new line separator `\\n`.

### Steps to Reproduce

1. Create key-store certs in a Microsoft environment
2. Mount and configure key-store certs for Enforcer
3. Start the deployment

### Version

1.0.0

### Environment Details (with versions)

OS: Microsoft Windows

### Relevant Log Output

```shell
Error log in Enforcer

[2022-09-30 11:05:51,663][][] ERROR - {org.wso2.choreo.connect.enforcer.discovery.ConfigDiscoveryClient} - Error occurred during Config discovery [%errorDetails]
java.lang.IllegalArgumentException: Illegal base64 character 2d
at java.util.Base64$Decoder.decode0(Unknown Source) ~[?:?]
at java.util.Base64$Decoder.decode(Unknown Source) ~[?:?]
at java.util.Base64$Decoder.decode(Unknown Source) ~[?:?]
at org.wso2.choreo.connect.enforcer.util.JWTUtils.getPrivateKey(JWTUtils.java:161) ~[org.wso2.choreo.connect.enforcer-1.0.0.jar:1.0.0]
at org.wso2.choreo.connect.enforcer.config.ConfigHolder.populateJWTIssuerConfigurations(ConfigHolder.java:545) ~[org.wso2.choreo.connect.enforcer-1.0.0.jar:1.0.0]
at org.wso2.choreo.connect.enforcer.config.ConfigHolder.parseConfigs(ConfigHolder.java:160) ~[org.wso2.choreo.connect.enforcer-1.0.0.jar:1.0.0]
at org.wso2.choreo.connect.enforcer.config.ConfigHolder.load(ConfigHolder.java:125) ~[org.wso2.choreo.connect.enforcer-1.0.0.jar:1.0.0]
at org.wso2.choreo.connect.enforcer.discovery.ConfigDiscoveryClient.requestInitConfig(ConfigDiscoveryClient.java:122) [org.wso2.choreo.connect.enforcer-1.0.0.jar:1.0.0]
at org.wso2.choreo.connect.enforcer.discovery.ConfigDiscoveryClient.run(ConfigDiscoveryClient.java:138) [org.wso2.choreo.connect.enforcer-1.0.0.jar:1.0.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
```


### Related Issues

_No response_

### Suggested Labels

_No response_

Changed files:
enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/util/JWTUtils.java

diff --git a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/util/JWTUtils.java b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/util/JWTUtils.java
index 09f9232dc..c87f72528 100644
--- a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/util/JWTUtils.java
+++ b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/util/JWTUtils.java
@@ -161,11 +161,10 @@ public class JWTUtils {
             String strKeyPEM;
             Path keyPath = Paths.get(filePath);
             String key = Files.readString(keyPath, Charset.defaultCharset());
-            String lineSeparator = System.lineSeparator();
-            
+
             strKeyPEM = key
                     .replace(Constants.BEGINING_OF_PRIVATE_KEY, "")
-                    .replaceAll(lineSeparator, "")
+                    .replaceAll("\\n", "").replaceAll("\\r", "") // certs could be created in a Unix/Windows platform
                     .replace(Constants.END_OF_PRIVATE_KEY, "");
 
             byte[] encoded = Base64.getDecoder().decode(strKeyPEM);