diff --git a/src/main/java/com/nexmo/client/auth/JWTAuthMethod.java b/src/main/java/com/nexmo/client/auth/JWTAuthMethod.java index 94eea1037..bee919cfd 100644 --- a/src/main/java/com/nexmo/client/auth/JWTAuthMethod.java +++ b/src/main/java/com/nexmo/client/auth/JWTAuthMethod.java @@ -44,9 +44,12 @@ import java.util.regex.Pattern; public class JWTAuthMethod extends AbstractAuthMethod { - private static final Pattern pemPattern = Pattern.compile("-----BEGIN PRIVATE KEY-----" + - "(.*\\n)" + - "-----END PRIVATE KEY-----\\n?", Pattern.MULTILINE | Pattern.DOTALL); + private static final Pattern pemPattern = Pattern.compile( + "-----BEGIN PRIVATE KEY-----" + // File header + "(.*\\n)" + // Key data + "-----END PRIVATE KEY-----" + // File footer + "\\n?", // Optional trailing line break + Pattern.MULTILINE | Pattern.DOTALL); public final int SORT_KEY = 10; private String applicationId; private JWTSigner signer;