docs: public static String readPemFileAsBase64(final File file) throws IOException
  	{
  		final byte[] keyBytes = Files.readAllBytes(file.toPath());
  		final String privateKeyPem = new String(keyBytes);
  		String privateKeyAsBase64String = null;
  		if (privateKeyPem.indexOf(BEGIN_PRIVATE_KEY_PREFIX) != -1)
  		{
  			// PKCS#8 format
  			privateKeyAsBase64String = new String(keyBytes).replace(BEGIN_PRIVATE_KEY_PREFIX, "")
  				.replace(END_PRIVATE_KEY_SUFFIX, "").trim();
  		}
  		if (privateKeyPem.indexOf(BEGIN_RSA_PRIVATE_KEY_PREFIX) != -1)
  		{
  			// PKCS#1 format
  			privateKeyAsBase64String = new String(keyBytes)
  				.replace(BEGIN_RSA_PRIVATE_KEY_PREFIX, "").replace(END_RSA_PRIVATE_KEY_SUFFIX, "")
  				.trim();
  		}
  		return privateKeyAsBase64String;
  	}