我正试图验证private_key是否正确,如这个问题中所描述的。
{
"type": "service_account",
"project_id": "[PROJECT-ID]",
"private_key_id": "[KEY-ID]",
"private_key": "-----BEGIN PRIVATE KEY-----\n[PRIVATE-KEY]\n-----END PRIVATE KEY-----\n",
"client_email": "[SERVICE-ACCOUNT-EMAIL]",
"client_id": "[CLIENT-ID]",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/[SERVICE-ACCOUNT-EMAIL]"
}在使用private_key时,我是否只是在
-----BEGIN PRIVATE KEY-----\n字符串和
\n-----END PRIVATE KEY-----\n换句话说,示例中显示的[PRIVATE-KEY]?
还是我得到了整个字符串,包括上面显示的两个"bookend“字符串?
此外,在[PRIVATE-KEY]字符串中,\n子字符串出现了几次。我是把它们移走还是把它们留在里面?
https://stackoverflow.com/questions/58568467
复制相似问题