docs: public static byte[] encryptPrivateKeyWithPassword(final PrivateKey privateKey,
  		final String password) throws NoSuchAlgorithmException, InvalidKeySpecException,
  		NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException,
  		IllegalBlockSizeException, BadPaddingException, InvalidParameterSpecException, IOException
  	{
  		final byte[] privateKeyEncoded = privateKey.getEncoded();
  
  		final SecureRandom random = new SecureRandom();
  		final byte[] salt = new byte[8];
  		random.nextBytes(salt);
  
  		final AlgorithmParameterSpec algorithmParameterSpec = AlgorithmParameterSpecFactory
  			.newPBEParameterSpec(salt, 20);
  
  		final SecretKey secretKey = SecretKeyFactoryExtensions.newSecretKey(password.toCharArray(),
  			CompoundAlgorithm.PBE_WITH_SHA1_AND_DES_EDE.getAlgorithm());
  
  		final Cipher pbeCipher = Cipher
  			.getInstance(CompoundAlgorithm.PBE_WITH_SHA1_AND_DES_EDE.getAlgorithm());
  
  		pbeCipher.init(Cipher.ENCRYPT_MODE, secretKey, algorithmParameterSpec);
  
  		final byte[] ciphertext = pbeCipher.doFinal(privateKeyEncoded);
  
  		final AlgorithmParameters algparms = AlgorithmParameters
  			.getInstance(CompoundAlgorithm.PBE_WITH_SHA1_AND_DES_EDE.getAlgorithm());
  		algparms.init(algorithmParameterSpec);
  		final EncryptedPrivateKeyInfo encinfo = new EncryptedPrivateKeyInfo(algparms, ciphertext);
  
  		return encinfo.getEncoded();
  	}