dns

An opinionated Domain Name System (DNS) library
Library dns
Module Dns . Dnskey
type algorithm =
| MD5
| SHA1
| SHA224
| SHA256
| SHA384
| SHA512
| Unknown of int(*

The type of currently supported DNS key algorithms.

*)
val int_to_algorithm : int -> algorithm

int_to_algorithm i decodes i to an algorithm.

  • raises Invalid_argument

    if i does not fit in one octet.

val algorithm_to_int : algorithm -> int

algorithm_to_int a encodes a to an integer.

val pp_algorithm : algorithm Fmt.t

pp_algorithm ppf a pretty-prints the algorithm.

type t = {
flags : int;
algorithm : algorithm;
key : Cstruct.t;
}

The type of a DNSKEY record.

val pp : t Fmt.t

pp ppf t pretty-prints the DNSKEY.

val compare : t -> t -> int

comapre a b compares the DNSKEY a with b.

val of_string : string -> ( t, [> `Msg of string ] ) result

of_string str attempts to parse str to a dnskey. The colon character (:) is used as separator, supported formats are: algo:keydata and flags:algo:keydata, where keydata is a base64 string.

val name_key_of_string : string -> ( [ `raw ] Domain_name.t * t, [> `Msg of string ] ) result

name_key_of_string str attempts to parse str to a domain name and a dnskey. The colon character (:) is used as separator.

val pp_name_key : ([ `raw ] Domain_name.t * t) Fmt.t

pp_name_key (name, key) pretty-prints the dnskey and name pair.