java.lang.Object
org.jenkinsci.plugins.kubernetes.credentials.Utils

public abstract class Utils extends Object
  • Field Details

    • FIPS140_ERROR_MESSAGE

      public static final String FIPS140_ERROR_MESSAGE
      Error message used to indicate that skipping TLS verification is not accepted in FIPS mode.
      See Also:
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • wrapWithMarker

      public static String wrapWithMarker(String begin, String end, String encodedBody)
    • wrapCertificate

      public static String wrapCertificate(String certData)
    • wrapPrivateKey

      public static String wrapPrivateKey(String keyData)
    • encodeBase64

      public static String encodeBase64(String s)
    • encodeCertificate

      public static String encodeCertificate(Certificate certificate) throws CertificateEncodingException
      Throws:
      CertificateEncodingException
    • encodeKey

      public static String encodeKey(Key key)
    • ensureFIPSCompliantURIRequest

      public static void ensureFIPSCompliantURIRequest(URI uri, boolean skipTLSVerify)
      Ensure that the URI request is FIPS compliant for the given HttpUriRequest object and skipTLSVerify option. Throw an exception if the request is invalid. A request is considered valid if the connection is either using TLS or a local pipe and if the TLS verification is not skipped. If FIPS mode is not enabled, this method does nothing.
      Parameters:
      uri - The request to validate
      skipTLSVerify - A flag indicating whether to skip TLS verification or not
      Throws:
      IllegalArgumentException - If the request is invalid
    • ensureFIPSCompliantRequest

      public static void ensureFIPSCompliantRequest(String stringRequest, boolean skipTLSVerify)
      Ensure that the request is FIPS compliant for the given URL and skipTLSVerify option. Throw an exception if the request is invalid. A request is considered valid if the connection is either using TLS or a local pipe and if the TLS verification is not skipped. If FIPS mode is not enabled, this method does nothing.
      Parameters:
      stringRequest - The request to validate
      skipTLSVerify - A flag indicating whether to skip TLS verification or not
      Throws:
      IllegalArgumentException - If the request is invalid