Class Utils
java.lang.Object
org.jenkinsci.plugins.kubernetes.credentials.Utils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringError message used to indicate that skipping TLS verification is not accepted in FIPS mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic StringencodeCertificate(Certificate certificate) static Stringstatic voidensureFIPSCompliantRequest(String stringRequest, boolean skipTLSVerify) Ensure that the request is FIPS compliant for the given URL and skipTLSVerify option.static voidensureFIPSCompliantURIRequest(URI uri, boolean skipTLSVerify) Ensure that the URI request is FIPS compliant for the given HttpUriRequest object and skipTLSVerify option.static StringwrapCertificate(String certData) static StringwrapPrivateKey(String keyData) static StringwrapWithMarker(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
-