From cc68de74027d2b2a3e90a83b925e5dd34928e8e4 Mon Sep 17 00:00:00 2001 From: Mark Smith Date: Mon, 20 Feb 2017 11:58:36 +0000 Subject: [PATCH] Add comments for the key regex. --- src/main/java/com/nexmo/client/auth/JWTAuthMethod.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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;