Skip to content

Support for Windows-My store certificates  #128

@sangonzal

Description

@sangonzal

When creating a IClientCredential from a certificate, MSAL checks that key length >= 2048.

The Java interface RSAPrivateKey has an API to get the modulus length. We use this API to verify length >= 2048

A problem arises when using certificates stored in Windows-My store. When pulled from the keyStore, the private keys are of type sun.security.mscapi.RSAPrivateKey or sun.security.mscapi.CPrivateKey (JDK12 and greater) and not java.security.interfaces.RSAPrivateKey. sun.security.mscapi.RSAPrivateKey or sun.security.mscapi.CPrivateKey does not expose a length() method, and all other sun.security.* APIs are proprietary, and therefore not all JDKs will include them going forward.

Need to investigate what the recommended way to enable support for certificates stored in "Windows-MY" keystores.

Metadata

Metadata

Assignees

Labels

BugSomething isn't working, needs an investigation and a fix

Type

No type

Projects

Status

Done (in PR or next release)

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions