aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/protector.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/actions/protector.go b/actions/protector.go
index 3278e63..7d51f79 100644
--- a/actions/protector.go
+++ b/actions/protector.go
@@ -260,6 +260,16 @@ func (protector *Protector) Unlock(keyFn KeyFunc) (err error) {
return
}
+// RawKey returns the internal key of an unlocked protector.
+func (protector *Protector) InternalKey() *crypto.Key {
+ return protector.key
+}
+
+// UnlockFromRawKey unlocks the protector directly from the internal key.
+func (protector *Protector) UnlockFromInternalKey(key *crypto.Key) {
+ protector.key = key
+}
+
// Lock wipes a Protector's internal Key. It should always be called after using
// an unlocked Protector. This is often done with a defer statement. There is
// no effect if called multiple times.