integrativesoft/CrossProtectedData

AspNetWrapper throws NullArgumentExeption if optionalEntropy is null

hugotonelli opened this issue · 1 comments

CreatePurpose method in AspNetWrapper makes a call to Convert.ToBase64String passing optionalEntropy, which throws NullArgumentException if byte[] inArray is null. It does seem to work, however, with an empty byte array.
Methods in DpapiWrapper are not affected by this, as optionalEntropy can be null when using System.Security.Cryptography.ProtectData Protect or Unprotect methods.

Reference: Convert.ToBase64String in Microsoft Docs

P.S.: Thanks for the wrapper!

Thank you for submitting this issue, will take a look into it this coming week.