Package hudson.plugins.ec2.util
Class FIPS140Utils
java.lang.Object
hudson.plugins.ec2.util.FIPS140Utils
FIPS related utility methods (check Private and Public keys, ...)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidensureKeyInFipsMode(Key key) Checks if the key is allowed when FIPS mode is requested.static voidensureNoPasswordLeak(boolean useHTTPS, boolean usePassword) Password leak prevention when FIPS mode is requested.static voidensureNoPasswordLeak(boolean useHTTPS, String password) Password leak prevention when FIPS mode is requested.static voidensureNoPasswordLeak(URL url, String password) Password leak prevention when FIPS mode is requested.static voidensureNoSelfSignedCertificate(boolean allowSelfSignedCertificate) Password leak prevention when FIPS mode is requested.static voidensurePasswordLength(String password) Password length check chen FIPS mode is requested.static voidensurePrivateKeyInFipsMode(String privateKeyString) Checks if the private key is allowed when FIPS mode is requested.static voidensurePublicKeyInFipsMode(String algorithm, byte[] key)
-
Constructor Details
-
FIPS140Utils
public FIPS140Utils()
-
-
Method Details
-
ensureKeyInFipsMode
Checks if the key is allowed when FIPS mode is requested. Allowed key with the following algorithms and sizes:- DSA with key size >= 2048
- RSA with key size >= 2048
- Elliptic curve (ED25519) with field size >= 224
IllegalArgumentException.- Parameters:
key- The key to check.
-
ensureNoPasswordLeak
Password leak prevention when FIPS mode is requested. If FIPS mode is not requested, this method does nothing. Otherwise, ensure that no password can be leaked- Parameters:
url- the requested URLpassword- the password used- Throws:
IllegalArgumentException- if there is a risk that the password will leak
-
ensureNoPasswordLeak
Password leak prevention when FIPS mode is requested. If FIPS mode is not requested, this method does nothing. Otherwise, ensure that no password can be leaked.- Parameters:
useHTTPS- is TLS used or notpassword- the password used- Throws:
IllegalArgumentException- if there is a risk that the password will leak
-
ensureNoPasswordLeak
public static void ensureNoPasswordLeak(boolean useHTTPS, boolean usePassword) Password leak prevention when FIPS mode is requested. If FIPS mode is not requested, this method does nothing. Otherwise, ensure that no password can be leaked.- Parameters:
useHTTPS- is TLS used or notusePassword- is a password used- Throws:
IllegalArgumentException- if there is a risk that the password will leak
-
ensurePasswordLength
Password length check chen FIPS mode is requested. If FIPS mode is not requested, this method does nothing. Otherwise, ensure that the password length is at least 14 char long.- Parameters:
password- the password to check- Throws:
IllegalArgumentException- if FIPS mode is requested and the password is too short
-
ensureNoSelfSignedCertificate
public static void ensureNoSelfSignedCertificate(boolean allowSelfSignedCertificate) Password leak prevention when FIPS mode is requested. If FIPS mode is not requested, this method does nothing. Otherwise, ensure that no password can be leaked.- Parameters:
allowSelfSignedCertificate- is self-signed certificate allowed- Throws:
IllegalArgumentException- if FIPS mode is requested and a self-signed certificate is allowed
-
ensurePrivateKeyInFipsMode
Checks if the private key is allowed when FIPS mode is requested. Allowed private key with the following algorithms and sizes:- DSA with key size >= 2048
- RSA with key size >= 2048
- Elliptic curve (ED25519) with field size >= 224
IllegalArgumentException.- Parameters:
privateKeyString- String containing the private key PEM.
-
ensurePublicKeyInFipsMode
-