Skip to content

Instantly share code, notes, and snippets.

@acidlychee
Created August 26, 2016 17:43
Show Gist options
  • Select an option

  • Save acidlychee/bea92da9f1eacf98b6595c20cc1e153f to your computer and use it in GitHub Desktop.

Select an option

Save acidlychee/bea92da9f1eacf98b6595c20cc1e153f to your computer and use it in GitHub Desktop.
public void convertFileToBase64() {
String path = this.getClass().getClassLoader().getResource("10012312135.pfx").getPath();
try {
byte[] b = Files.toByteArray(new File(path));
System.out.println(Base64.encodeBase64String(b));
} catch (IOException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment