package octez-shell-libs
Octez shell libraries
Install
Dune Dependency
Authors
Maintainers
Sources
tezos-18.1.tar.gz
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a
doc/src/octez-shell-libs.signer-services/signer_messages.ml.html
Source file signer_messages.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
(*****************************************************************************) (* *) (* Open Source License *) (* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) (* *) (* Permission is hereby granted, free of charge, to any person obtaining a *) (* copy of this software and associated documentation files (the "Software"),*) (* to deal in the Software without restriction, including without limitation *) (* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) (* and/or sell copies of the Software, and to permit persons to whom the *) (* Software is furnished to do so, subject to the following conditions: *) (* *) (* The above copyright notice and this permission notice shall be included *) (* in all copies or substantial portions of the Software. *) (* *) (* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) (* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) (* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) (* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) (* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) (* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) (* DEALINGS IN THE SOFTWARE. *) (* *) (*****************************************************************************) module type Authenticated_request = sig type t = { pkh : Tezos_crypto.Signature.Public_key_hash.t; data : Bytes.t; signature : Tezos_crypto.Signature.t option; } val to_sign : pkh:Tezos_crypto.Signature.Public_key_hash.t -> data:Bytes.t -> Bytes.t val encoding : t Data_encoding.t end module type Tag = sig val tag : int end module Make_authenticated_request (T : Tag) : Authenticated_request = struct type t = { pkh : Tezos_crypto.Signature.Public_key_hash.t; data : Bytes.t; signature : Tezos_crypto.Signature.t option; } let x04 = Bytes.of_string "\x04" let to_sign ~pkh ~data = let tag = Bytes.make 1 '0' in TzEndian.set_int8 tag 0 T.tag ; Bytes.concat Bytes.empty [x04; tag; Tezos_crypto.Signature.Public_key_hash.to_bytes pkh; data] let encoding = let open Data_encoding in conv (fun {pkh; data; signature} -> (pkh, data, signature)) (fun (pkh, data, signature) -> {pkh; data; signature}) (obj3 (req "pkh" Tezos_crypto.Signature.Public_key_hash.encoding) (req "data" bytes) (opt "signature" Tezos_crypto.Signature.encoding)) end module Sign = struct module Request = Make_authenticated_request (struct let tag = 1 end) module Response = struct type t = Tezos_crypto.Signature.t let encoding = let open Data_encoding in def "signer_messages.sign.response" @@ obj1 (req "signature" Tezos_crypto.Signature.encoding) end end module Deterministic_nonce = struct module Request = Make_authenticated_request (struct let tag = 2 end) module Response = struct type t = Bytes.t let encoding = let open Data_encoding in def "signer_messages.deterministic_nonce.response" @@ obj1 (req "deterministic_nonce" bytes) end end module Deterministic_nonce_hash = struct module Request = Make_authenticated_request (struct let tag = 3 end) module Response = struct type t = Bytes.t let encoding = let open Data_encoding in def "signer_messages.deterministic_nonce_hash.response" @@ obj1 (req "deterministic_nonce_hash" bytes) end end module Supports_deterministic_nonces = struct module Request = struct type t = Tezos_crypto.Signature.Public_key_hash.t let encoding = let open Data_encoding in def "signer_messages.supports_deterministic_nonces.request" @@ obj1 (req "pkh" Tezos_crypto.Signature.Public_key_hash.encoding) end module Response = struct type t = bool let encoding = let open Data_encoding in def "signer_messages.supports_deterministic_nonces.response" @@ obj1 (req "bool" bool) end end module Public_key = struct module Request = struct type t = Tezos_crypto.Signature.Public_key_hash.t let encoding = let open Data_encoding in def "signer_messages.public_key.request" @@ obj1 (req "pkh" Tezos_crypto.Signature.Public_key_hash.encoding) end module Response = struct type t = Tezos_crypto.Signature.Public_key.t let encoding = let open Data_encoding in def "signer_messages.public_key.response" @@ obj1 (req "pubkey" Tezos_crypto.Signature.Public_key.encoding) end end module Authorized_keys = struct module Response = struct type t = | No_authentication | Authorized_keys of Tezos_crypto.Signature.Public_key_hash.t list let encoding = let open Data_encoding in union [ case (Tag 0) ~title:"No_authentication" (constant "no_authentication_required") (function No_authentication -> Some () | _ -> None) (fun () -> No_authentication); case (Tag 1) ~title:"Authorized_keys" (list Tezos_crypto.Signature.Public_key_hash.encoding) (function Authorized_keys l -> Some l | _ -> None) (fun l -> Authorized_keys l); ] end end module Request = struct type t = | Sign of Sign.Request.t | Public_key of Public_key.Request.t | Authorized_keys | Deterministic_nonce of Deterministic_nonce.Request.t | Deterministic_nonce_hash of Deterministic_nonce_hash.Request.t | Supports_deterministic_nonces of Supports_deterministic_nonces.Request.t let encoding = let open Data_encoding in def "signer_messages.request" @@ union [ case (Tag 0) ~title:"Sign" (merge_objs (obj1 (req "kind" (constant "sign"))) Sign.Request.encoding) (function Sign req -> Some ((), req) | _ -> None) (fun ((), req) -> Sign req); case (Tag 1) ~title:"Public_key" (merge_objs (obj1 (req "kind" (constant "public_key"))) Public_key.Request.encoding) (function Public_key req -> Some ((), req) | _ -> None) (fun ((), req) -> Public_key req); case (Tag 2) ~title:"Authorized_keys" (obj1 (req "kind" (constant "authorized_keys"))) (function Authorized_keys -> Some () | _ -> None) (fun () -> Authorized_keys); case (Tag 3) ~title:"Deterministic_nonce" (merge_objs (obj1 (req "kind" (constant "deterministic_nonce"))) Deterministic_nonce.Request.encoding) (function Deterministic_nonce req -> Some ((), req) | _ -> None) (fun ((), req) -> Deterministic_nonce req); case (Tag 4) ~title:"Deterministic_nonce_hash" (merge_objs (obj1 (req "kind" (constant "deterministic_nonce_hash"))) Deterministic_nonce_hash.Request.encoding) (function | Deterministic_nonce_hash req -> Some ((), req) | _ -> None) (fun ((), req) -> Deterministic_nonce_hash req); case (Tag 5) ~title:"Supports_deterministic_nonces" (merge_objs (obj1 (req "kind" (constant "supports_deterministic_nonces"))) Supports_deterministic_nonces.Request.encoding) (function | Supports_deterministic_nonces req -> Some ((), req) | _ -> None) (fun ((), req) -> Supports_deterministic_nonces req); ] end let () = let open Data_encoding.Registration in register Request.encoding ; register Sign.Response.encoding ; register Deterministic_nonce.Response.encoding ; register Deterministic_nonce_hash.Response.encoding ; register Supports_deterministic_nonces.Response.encoding ; register Public_key.Response.encoding
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>