docs: public static void write(final PrivateKey privateKey, final @NonNull OutputStream outputStream,
  		final KeyFileFormat fileFormat, final KeyFormat keyFormat) throws IOException
  	{
  		final byte[] privateKeyBytes = privateKey.getEncoded();
  		switch (fileFormat)
  		{
  			case PEM :
  				if (keyFormat == null || keyFormat.equals(KeyFormat.PKCS_8))
  				{
  					String privateKeyAsBase64String = PrivateKeyExtensions.toPemFormat(privateKey);
  					outputStream
  						.write(privateKeyAsBase64String.getBytes(StandardCharsets.US_ASCII));
  					break;
  				}
  				else if (keyFormat.equals(KeyFormat.PKCS_1))
  				{
  					final byte[] privateKeyPKCS1Formatted = PrivateKeyExtensions
  						.toPKCS1Format(privateKey);
  					String pemFormat = PrivateKeyExtensions
  						.fromPKCS1ToPemFormat(privateKeyPKCS1Formatted);
  					outputStream.write(pemFormat.getBytes(StandardCharsets.US_ASCII));
  					break;
  				}
  			default : // DER is default
  				final PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes);
  				outputStream.write(keySpec.getEncoded());
  				break;
  		}
  		outputStream.close();
  	}