2016-09-20 48 views
0

我想將APNS證書的.p12文件發送到One Signal API,但我需要首先將.p12文件轉換爲base64字符串。我怎麼做? API文檔如下: https://documentation.onesignal.com/reference#create-an-app將p12 APNS證書轉換爲base64字符串

+0

我正在構建的腳本位於Node中。 – anestis

+0

我嘗試過的腳本,但沒有工作: new Buffer(fs.readFileSync(__ dirname +「/ios_push_certificate.p12」,'binary'))。toString('base64') – anestis

回答

0
new Buffer(fs.readFileSync(__dirname + "/ios_push_certificate.p12")).toString('base64') 

這是正確的腳本畢竟。

0

這取決於您正在使用的編程語言。

例如,這裏是如何做到這一點的紅寶石:

base64_encoded_p12 = Base64.encode64(File.read('/path/to/your/file.p12')) 
相關問題