ARSoft.Tools.Net - C# DNS client/server, SPF and SenderID Library
DNSSEC
Get all signed SSH fingerprints for a domain name using a self validating stub resolver
Copy Code
IDnsSecResolver resolver = new SelfValidatingInternalDnsSecStubResolver();
DnsSecResult<SshFpRecord> result = resolver.ResolveSecure<SshFpRecord>("example.com", RecordType.SshFp);
if (result.ValidationResult == DnsSecValidationResult.Signed)
{
    Console.WriteLine("example.com has following signed SSH fingerprint records:");
    result.Records.ForEach(x => Console.WriteLine(x.ToString()));
}
else
{
    Console.WriteLine("example.com has no signed SSH fingerprint records");
}

 

DANE secured connection using a recursive DNSSEC resolver
Copy Code
IDnsSecResolver resolver = new DnsSecRecursiveDnsResolver();
using (TcpClient client = new TcpClient("example.com", 443))
{
    using (DaneStream stream = new DaneStream(client.GetStream(), resolver))
    {
        stream.AuthenticateAsClient("example.com", 443);

        if (stream.IsAuthenticatedByDane)
            Console.WriteLine("Stream is authenticated by DANE/TLSA");

        // work with the stream
    }
}

 

 


© 2010-2015 Alexander Reinert. All Rights Reserved.

Send Feedback


This documentation was created using Document! X