Skip to content

Commit 4850c81

Browse files
committed
Provide guidance on how to DIY the pkcs12-to-pem
1 parent e41b8f1 commit 4850c81

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

msal/application.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,19 @@ def __init__(
206206
or an X509 certificate container in this form::
207207
208208
{
209-
"private_key": "...-----BEGIN PRIVATE KEY-----...",
209+
"private_key": "...-----BEGIN PRIVATE KEY-----... in PEM format",
210210
"thumbprint": "A1B2C3D4E5F6...",
211211
"public_certificate": "...-----BEGIN CERTIFICATE-----... (Optional. See below.)",
212212
"passphrase": "Passphrase if the private_key is encrypted (Optional. Added in version 1.6.0)",
213213
}
214214
215+
MSAL Python requires a "private_key" in PEM format.
216+
If your cert is in a PKCS12 (.pfx) format, you can also
217+
`convert it to PEM and get the thumbprint <https://github.com/Azure/azure-sdk-for-python/blob/07d10639d7e47f4852eaeb74aef5d569db499d6e/sdk/identity/azure-identity/azure/identity/_credentials/certificate.py#L101-L123>`_.
218+
219+
The thumbprint is available in your app's registration in Azure Portal.
220+
Alternatively, you can `calculate the thumbprint <https://github.com/Azure/azure-sdk-for-python/blob/07d10639d7e47f4852eaeb74aef5d569db499d6e/sdk/identity/azure-identity/azure/identity/_credentials/certificate.py#L94-L97>`_.
221+
215222
*Added in version 0.5.0*:
216223
public_certificate (optional) is public key certificate
217224
which will be sent through 'x5c' JWT header only for

0 commit comments

Comments
 (0)