+1 vote

I am testing a solution with your .Net Mail control.

I followed your steps to create a 1024 bit encrypted key however our DNS provider can only accept dns record values of up to 256 characters so I cannot create the txt record.

I have recreated the keys using 64 bit encryption so I can create the dns entry however I can’t read the private key anymore. The line of code that breaks is:

Dim rsa As RSACryptoServiceProvider = New PemReader() _
    .ReadPrivateKeyFromFile("C:\Users\Steve\Documents\DKIM.Private.key")

Which errors with "DER data malformed" and "Bad Data" exceptions.

by

1 Answer

0 votes
 
Best answer

.NET supports key sizes from 384 to 16384 bits.

64 bit is simply too small and not handled.

The next version of Mail.dll is going to have a better error message in such case.

by (301k points)
...