Skip to content

Instantly share code, notes, and snippets.

@leemartin
Last active June 26, 2022 13:55
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