Skip to content

Commit

Permalink
ezjs_crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtori committed Oct 21, 2020
1 parent d591e3c commit 0ce267c
Show file tree
Hide file tree
Showing 67 changed files with 2,495 additions and 2,210 deletions.
26 changes: 1 addition & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@

#############################################################################
#
# This file is managed by ocp-autoconf.
#
# Remove it from `manage_files` in 'ocp-autoconf.config' if you want to
# modify it manually.
#
#############################################################################

# ocp-build working directories
_obuild

# ocp-lint working directories
_olint

# backups of modified files
*~
*.annot

# content of file ocp-autoconf.d/gitignore
ocp-autoconf.d/config.ocp2inc

_esy
esy.lock

_build
*.merlin
autoconf
ocp-autoconf.d
test/*.js
examples/chrome-extension/*.js
configure
examples/*/*.js
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ doc:
example:
dune build --profile release examples
@cp -f _build/default/examples/indexedDB/indexedDB_example.bc.js examples/indexedDB/indexedDB-example.js
@cp -f _build/default/examples/crypto/crypto_example.bc.js examples/crypto/crypto-example.js
11 changes: 5 additions & 6 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
(synopsis "Binding for Disqus")
(depends ezjs-utils))

(package
(name ezjs-extension)
(synopsis "Binding for chrome and firefox extension API")
(depends ezjs_min)
(depopts (lwt (>= 5.3.0))))

(package
(name ezjs-jquery)
(synopsis "Binding for JQuery")
Expand All @@ -66,3 +60,8 @@
(name ezjs-google-auth)
(synopsis "Binding for Google Sign in")
(depends ezjs_min))

(package
(name ezjs_crypto)
(synopsis "WebCrypto binding")
(depends ezjs_min))
1,968 changes: 1,968 additions & 0 deletions examples/crypto/crypto-example.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions examples/crypto/crypto_example.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
open Ezjs_min.Js
open Ezjs_crypto

let () =
generate_key ~algo:(GAES (CTR, 256)) ~usages:[`DeriveKey] @@ function
| Error e -> js_log e
| Ok (CKey k) -> log_str "key"; js_log @@ to_crypto_key k
| Ok (CKeyPair p) -> log_str "keypair"; js_log @@ to_crypto_keypair p
6 changes: 6 additions & 0 deletions examples/crypto/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(executable
(name crypto_example)
(modules crypto_example)
(preprocess (pps js_of_ocaml-ppx))
(libraries ezjs_crypto)
(modes js))
9 changes: 9 additions & 0 deletions examples/crypto/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html>
<head>
<title>Crypto example</title>
<link rel="icon" href="data:,">
<script src="crypto-example.js" defer></script>
</head>
<body>
</body>
</html>
12 changes: 12 additions & 0 deletions examples/timeline/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"events": [
{
"start_date": {
"year":2010
},
"text": {
"text":"test"
}
}
]
}
5 changes: 1 addition & 4 deletions ezjs-extension.opam → ezjs-google-auth.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Binding for chrome and firefox extension API"
synopsis: "Binding for Google Sign in"
maintainer: ["Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com>"]
authors: [
"Cagdas Bozman <cagdas.bozman@ocamlpro.com>"
Expand All @@ -17,9 +17,6 @@ depends: [
"dune" {>= "2.5"}
"ezjs_min"
]
depopts: [
"lwt" {>= "5.3.0"}
]
build: [
["dune" "subst"] {pinned}
[
Expand Down
34 changes: 34 additions & 0 deletions ezjs_crypto.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "WebCrypto binding"
maintainer: ["Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com>"]
authors: [
"Cagdas Bozman <cagdas.bozman@ocamlpro.com>"
"Michael Laporte <michael.laporte@ocamlpro.com>"
"Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com>"
"Maxime Levillain <maxime.levillain@ocamlpro.com>"
"Steven de Oliveira <steven.de_oliveira@ocamlpro.com>"
]
license: "GPL-3.0-or-later"
homepage: "https://github.com/ocamlpro/ezjs"
doc: "https://ocamlpro.github.io/ezjs/doc"
bug-reports: "https://github.com/ocamlpro/ezjs/issues"
depends: [
"dune" {>= "2.5"}
"ezjs_min"
]
build: [
["dune" "subst"] {pinned}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/ocamlpro/ezjs.git"
4 changes: 4 additions & 0 deletions libs/crypto/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(public_name ezjs_crypto)
(preprocess (pps js_of_ocaml-ppx))
(libraries ezjs_min))
Loading

0 comments on commit 0ce267c

Please sign in to comment.