Permalink
Browse files

Adding a new library method to convert pem private keys to dnskey rec…

…ords
  • Loading branch information...
1 parent 9bd2f4c commit fcdefcab2e8a81163c281119ced5616376683512 @crotsos crotsos committed Mar 29, 2012
Showing with 9 additions and 0 deletions.
  1. +8 −0 lib/key.ml
  2. +1 −0 lib/key.mli
View
@@ -338,6 +338,14 @@ let dnskey_of_pem_pub_file file =
return (Some([ret]))
| None -> return (None)
+let dnskey_of_pem_priv_file file =
+ lwt tmp = load_key file PEM_PRIV in
+ match tmp with
+ | Some(key) ->
+ let ret = dns_pub_of_rsa key in
+ return (Some([ret]))
+ | None -> return (None)
+
let ssh_pub_key_of_domain ?server:(server="128.232.1.1")
?port:(port = 53) domain =
lwt tmp = get_dnssec_key ~server:server ~dns_port:port domain in
View
@@ -37,3 +37,4 @@ val ssh_fingerprint_of_domain: ?server:string -> ?port:int -> string ->
val ssh_pub_key_of_domain : ?server:string -> ?port:int ->string ->
string list option Lwt.t
val dnskey_of_pem_pub_file : string -> string list option Lwt.t
+val dnskey_of_pem_priv_file : string -> string list option Lwt.t

0 comments on commit fcdefca

Please sign in to comment.