You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,18 @@ let pepper = ... // optional
77
77
let masterkey =try masterkeyFile.unlock(passphrase: passphrase, pepper: pepper)
78
78
```
79
79
80
+
The unlock process can also be performed in two steps:
81
+
82
+
```swift
83
+
let masterkeyFile =...
84
+
let passphrase =...
85
+
let pepper =...// optional
86
+
let kek =try masterkeyFile.deriveKey(passphrase: passphrase, pepper: pepper)
87
+
let masterkey =try masterkeyFile.unlock(kek: kek)
88
+
```
89
+
90
+
This is useful if you'd like to derive the key in an extra step since the function is memory-intensive (using scrypt). The result can then be used elsewhere, e.g. in a memory-restricted process.
91
+
80
92
#### Lock
81
93
82
94
For persisting the masterkey, use this method to export its encrypted/wrapped masterkey and other metadata as JSON data.
0 commit comments