Pem.pemEncoded should cache the Pattern

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Affects Version/s: 26
    • Component/s: security-libs

      we are using the String.replaceAll() method that creates Pattern internally every time:

          /**
           * Construct a String-based encoding based off the type. leadingData
           * is not used with this method.
           * @return PEM in a string
           */
          public static String pemEncoded(PEM pem) {
              String p = pem.content().replaceAll("(.{64})", "$1\r\n");
              return pemEncoded(pem.type(), p);
          }

      We already have cached Patterns for other cases, we should do the same here.

            Assignee:
            Fernando Guallini
            Reporter:
            Fernando Guallini
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: