let PfxBuilder support setting the Cert Algorithm of PFX#323
let PfxBuilder support setting the Cert Algorithm of PFX#323zhaixiaowai wants to merge 2 commits intofszlin:mainfrom
Conversation
The default Cert Algorithm of Org.BouncyCastle.Pkcs.Pkcs12StoreBuilder is PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc Android devices do not support RC2's pfx certificate by default, so the modified method here passes the Cert Algorithm into the custom Cert Algorithm of the exported PFX file. For example: pfxBuilder.Build(friendlyName, pfxPassword, PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc)
The default Cert Algorithm of Org.BouncyCastle.Pkcs.Pkcs12StoreBuilder is PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc Android devices do not support RC2's pfx certificate by default, so the modified method here passes the Cert Algorithm into the custom Cert Algorithm of the exported PFX file. For example: pfxBuilder.Build(friendlyName, pfxPassword, PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc)
|
This is for a PFX you are installing directly into Android or as part a deployed app? The PFX cert algorithm doesn't affect public consumers of the cert if you're just using the cert for a service (e.g. an API server). |
|
I have embedded Certes into Maui, and I need to issue a certificate on Android, then parse it into X509Certificate2. However, due to Android's lack of support for RC2, I am unable to initialize X509Certificate2 successfully. If pfxBuilder.Build() could support custom Cert Algorithm, then I could parse X509Certificate2 on Android without relying on other API services. like
|
Description
The default Cert Algorithm of Org.BouncyCastle.Pkcs.Pkcs12StoreBuilder is PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc
Android devices do not support RC2's pfx certificate by default, so the modified method here passes the Cert Algorithm into the custom Cert Algorithm of the exported PFX file.
For example: pfxBuilder.Build(friendlyName, pfxPassword, PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc)
Checklist
Thanks for contributing!