Skip to content

Instantly share code, notes, and snippets.

@leemartin
Last active June 26, 2022 13:55
Show Gist options
  • Save leemartin/b5b3bd4f7a8fbdad2f0d860ec5567019 to your computer and use it in GitHub Desktop.
Save leemartin/b5b3bd4f7a8fbdad2f0d860ec5567019 to your computer and use it in GitHub Desktop.
Encode Apple Private Key as Base64 String
// Require file system module
const fs = require("fs")
// Read private key from file
const privateKey = fs.readFileSync("AuthKey_0000000000.p8").toString()
// Encode private key into Base64 string
const buff = Buffer.from(privateKey).toString('base64')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment