-
Notifications
You must be signed in to change notification settings - Fork 0
/
HkdfParams.cljs
88 lines (71 loc) · 2.23 KB
/
HkdfParams.cljs
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
(ns web.crypto.HkdfParams
"See the examples for `SubtleCrypto.deriveKey()`."
(:refer-clojure :exclude [name hash]))
(defn name
"Property.
A DOMString. This should be set to HKDF."
[this]
(-> this (.-name)))
(defn set-name!
"Property.
A DOMString. This should be set to HKDF."
[this val]
(aset this "name" val))
(defn hash
"Property.
A DOMString representing the digest algorithm to use. This may
one of:
SHA-1
SHA-256
SHA-384
SHA-512"
[this]
(-> this (.-hash)))
(defn set-hash!
"Property.
A DOMString representing the digest algorithm to use. This may
one of:
SHA-1
SHA-256
SHA-384
SHA-512"
[this val]
(aset this "hash" val))
(defn salt
"Property.
A BufferSource. The HKDF specification states that adding salt
significantly to the strength of HKDF\". Ideally, the salt is
random or pseudo-random value with the same length as the output
the digest function. Unlike the input key material passed into
salt does not need to be kept secret."
[this]
(-> this (.-salt)))
(defn set-salt!
"Property.
A BufferSource. The HKDF specification states that adding salt
significantly to the strength of HKDF\". Ideally, the salt is
random or pseudo-random value with the same length as the output
the digest function. Unlike the input key material passed into
salt does not need to be kept secret."
[this val]
(aset this "salt" val))
(defn info
"Property.
A BufferSource representing application-specific contextual information.
is used to bind the derived key to an application or context,
enables you to derive different keys for different contexts while
the same input key material. It's important that this should
independent of the input key material itself. This property is
but may be an empty buffer."
[this]
(-> this (.-info)))
(defn set-info!
"Property.
A BufferSource representing application-specific contextual information.
is used to bind the derived key to an application or context,
enables you to derive different keys for different contexts while
the same input key material. It's important that this should
independent of the input key material itself. This property is
but may be an empty buffer."
[this val]
(aset this "info" val))