Last active
June 26, 2022 13:55
Encode Apple Private Key as Base64 String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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