aboutsummaryrefslogtreecommitdiff
path: root/lib/user.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/user.ml')
-rw-r--r--lib/user.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/user.ml b/lib/user.ml
index 00cd33f..f0ac7cf 100644
--- a/lib/user.ml
+++ b/lib/user.ml
@@ -6,7 +6,7 @@ open Lwt
type public_key = {
id : string;
owner : string;
- public_key_prem : string; [@key "publicKeyPem"]
+ public_key_pem : string; [@key "publicKeyPem"]
}
[@@deriving yojson] [@@yojson.allow_extra_fields]
@@ -26,4 +26,8 @@ let get_user actor_url =
Ok body
with exn -> Lwt.return (Error exn)
+let get_public_pem user =
+ user.public_key.public_key_pem |> Cstruct.of_string
+ |> X509.Public_key.decode_pem
+
let name user = user.name