Class Utils
java.lang.Object
org.jenkinsci.plugins.kubernetes.credentials.Utils
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Error message used to indicate that skipping TLS verification is not accepted in FIPS mode. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
encodeCertificate
(Certificate certificate) static String
static void
ensureFIPSCompliantRequest
(String stringRequest, boolean skipTLSVerify) Ensure that the request is FIPS compliant for the given URL and skipTLSVerify option.static void
ensureFIPSCompliantURIRequest
(URI uri, boolean skipTLSVerify) Ensure that the URI request is FIPS compliant for the given HttpUriRequest object and skipTLSVerify option.static String
wrapCertificate
(String certData) static String
wrapPrivateKey
(String keyData) static String
wrapWithMarker
(String begin, String end, String encodedBody)
-
Field Details
-
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
-
wrapCertificate
-
wrapPrivateKey
-
encodeBase64
-
encodeCertificate
- Throws:
CertificateEncodingException
-
encodeKey
-
ensureFIPSCompliantURIRequest
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 validateskipTLSVerify
- A flag indicating whether to skip TLS verification or not- Throws:
IllegalArgumentException
- If the request is invalid
-
ensureFIPSCompliantRequest
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 validateskipTLSVerify
- A flag indicating whether to skip TLS verification or not- Throws:
IllegalArgumentException
- If the request is invalid
-