dnscrypt

package module
v0.0.0-...-d917937 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2017 License: GPL-3.0 Imports: 14 Imported by: 1

README

dnscrypt

Very basic DNSCrypt library for go.

See DNSCryptClient for a simple demo or godoc for documentation. The code also has lots of comments...

DISCLAIMER:

I wrote this to understand the protocol before implementing it in a language I am much less familiar with. It is not feature complete, but should work with most DNSCrypt resolvers. I tried not to make stupid mistakes and I think it behaves reasonably secure but please be careful!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExchangeEncrypted

func ExchangeEncrypted(serverAddress string, msg dns.Msg, bincertFields SignedBincertFields) (dns.Msg, error)

ExchangeEncrypted exchanges encrypted dns query and returns the response message. It needs the specifics of a DNSC server as obtained by calling GetValidCert()

Types

type SignedBincertFields

type SignedBincertFields struct {
	ServerPublicKey [32]byte
	MagicQuery      [8]byte
	Serial          [4]byte
	TSBegin         uint32
	TSEnd           uint32
}

SignedBincertFields Represents the detailed structure of a DNSC certificate

func GetValidCert

func GetValidCert(serverAddress string, providerName string, providerKey []byte) (SignedBincertFields, error)

GetValidCert retrieves th DNSC certificate for a server it validates the certificate and returns the certificates details iff it is valid. Otherwise an error is returned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL