Last active
June 26, 2022 13:55
-
-
Save leemartin/b5b3bd4f7a8fbdad2f0d860ec5567019 to your computer and use it in GitHub Desktop.
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