MCPcopy
hub / github.com/borgbackup/borg / load_keyblob

Method load_keyblob

src/borg/crypto/keymanager.py:56–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

54 raise UnencryptedRepo()
55
56 def load_keyblob(self):
57 if self.keyblob_storage == KeyBlobStorage.KEYFILE:
58 k = CHPOKeyfileKey(self.repository)
59 target = k.find_key()
60 with open(target) as fd:
61 self.keyblob = "".join(fd.readlines()[1:])
62
63 elif self.keyblob_storage == KeyBlobStorage.REPO:
64 key_data = self.repository.load_key().decode()
65 if not key_data:
66 # if we got an empty key, it means there is no key.
67 loc = self.repository._location.canonical_path()
68 raise RepoKeyNotFoundError(loc) from None
69 self.keyblob = key_data
70
71 def store_keyblob(self, args):
72 if self.keyblob_storage == KeyBlobStorage.KEYFILE:

Callers 1

do_key_exportMethod · 0.95

Calls 5

CHPOKeyfileKeyClass · 0.85
find_keyMethod · 0.80
load_keyMethod · 0.45
canonical_pathMethod · 0.45

Tested by

no test coverage detected