File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/com/spotify/github/v3/clients Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -73,18 +73,18 @@ public static Optional<KeySpec> loadKeySpec(final byte[] privateKey) {
7373 * @param isPKCS1 whether this is PKCS1 format (needs conversion to PKCS8)
7474 * @return an Optional containing the KeySpec if successful
7575 */
76- private static Optional <KeySpec > extractKeySpec (String base64Content , boolean isPKCS1 ) {
76+ private static Optional <KeySpec > extractKeySpec (final String base64Content , final boolean isPKCS1 ) {
7777 try {
7878 // Remove all whitespace
79- base64Content = base64Content .replaceAll ("\\ s+" , "" );
79+ String sanitizedContent = base64Content .replaceAll ("\\ s+" , "" );
8080
8181 // Check if content is empty after whitespace removal
82- if (base64Content .isEmpty ()) {
82+ if (sanitizedContent .isEmpty ()) {
8383 return Optional .empty ();
8484 }
8585
8686 // Decode the base64 content
87- byte [] decodedKey = Base64 .getDecoder ().decode (base64Content );
87+ byte [] decodedKey = Base64 .getDecoder ().decode (sanitizedContent );
8888
8989 // Convert to PKCS8 if necessary
9090 byte [] pkcs8Key = isPKCS1 ? toPkcs8 (decodedKey ) : decodedKey ;
You can’t perform that action at this time.
0 commit comments