I have a signed zone and am trying to use 'DnsKeyRecord' to add the rr to the answer reply. Unlike all the other record types, the 'data' portion or 'publickey' is processed it appears and not the same as the data I supplied.
I do the following where "AwEAAcWJtYk0cL1QsDuKAMpF/4zewot2sU1aDOhavJYVx0wzBptQFR4U 01OOoNE5C0kh+TnkmtOABR9uqDujnZac7QugKLLXcKXgBKZ+Ir8VGNKX BrWMofpQ6QW/m9oc+ZkhX8csH00eTPXCOtJa3YyHo08hzrZUDWTVA4dc 4bHFyEqZ" is the key
Dim oEncoder As New System.Text.ASCIIEncoding
Dim data As Byte() = oEncoder.GetBytes(record.data)
Dim rr As New DnsKeyRecord(hostname1, RecordClass.INet, record.ttl, record.flags, CByte(record.protocol), record.algorithm, data)
And I verify the byte array is the same as the key supplied, but when I get a response from the dns server, I get
3600 IN DNSKEY 256 3 5 QXdFQUFjV0p0WWswY0wxUXNEdUtBTXBGLzR6ZXdvdDJzVTFhRE9oYXZK WVZ4MHd6QnB0UUZSN
FUgMDFPT29ORTVDMGtoK1Rua210T0FCUjl1cUR1 am5aYWM3UXVnS0xMWGNLWGdCS1orSXI4VkdOS1ggQnJXTW9mcFE2UVcv bTlvYytaa2hYOGNzSDAwZVRQWENPdEphM
Which isn't what I supplied.
I looked at your code and I can see the data supplied is converted to base64 string. Converting the string supplied matches what was returned.
So, maybe I'm missing somthing obvious? Why the conversion?