azure-activedirectory-identitymodel-extensions-for-dotnet
azure-activedirectory-identitymodel-extensions-for-dotnet copied to clipboard
AuthenticatedEncryptionProvider is impossible to override
The call to GetAlgorithmParameters in the constructor throws an exception on any algorithm that isn't supported by default.
I can see how adding this feature would be useful. I've gone ahead and labeled this as an enhancement.
@gislikonrad would a simple virtual be enough?
Technically, yes, for my use case it would be. But is it enough?
Looking at an old PR for Saml2EncryptedAssertion (#1025), you can see what had to be done in the AuthenticatedEncryptionProvider to enable AesGcm encryption. Making AuthenticatedEncryptionProvider more abstract and having a class inherit it for AesCbc encryption specifically, for example AesCbcAuthenticatedEncryptionProvider, would be the more extendable way to do this. Then, in theory, an AesGcmAuthenticatedEncryptionProvider could be implemented.
Since the current AuthenticatedEncryptionProvider is impossible to override, then I'm thinking that this wouldn't break anything.