Skip to content

System.Security.Cryptography.Xml.Utils.GetAnyPublicKey returns only RSA or null? #55194

@alexaka1

Description

@alexaka1

This is the line in question:

return (AsymmetricAlgorithm)certificate.GetRSAPublicKey();

But what about DSA or ECDsa keys? Shouldn't it check for them when GetRSAPublicKey() returns null?
How about return (AsymmetricAlgorithm) (certificate.GetRSAPublicKey() ?? certificate.GetDSAPublicKey() ?? certificate.GetECDsaPublicKey()); ?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions