I have the following code. I expected the console output to be 32 (bytes), but it's actually a lot longer. Why is that? Can I trim that down?
ECDsaCng keyPair = new ECDsaCng(256);
byte[] privateKey = keyPar.ExportECPrivateKey();
//This will be 165 bytes
Console.WriteLine(privateKey.Length);
This doesn't makes sense to me, since as I understand both the public and private keys should be exactly 32 bytes long. I found this other question which helped me a bit, but I don't understand why we need to stores keys in formats.
Can't I just get the private key as a 32 bytes long byte array? What do I need a format for?