浏览代码

PR #222 - Merge branch 'issue_189' of https://github.com/ThomasWaldmann/attic into merge

Thomas Waldmann 10 年之前
父节点
当前提交
084f6e1602
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      attic/key.py

+ 6 - 0
attic/key.py

@@ -190,6 +190,12 @@ class PassphraseKey(AESKeyBase):
             except IntegrityError:
                 passphrase = getpass(prompt)
 
+    def change_passphrase(self):
+        class ImmutablePassphraseError(Error):
+            """The passphrase for this encryption key type can't be changed."""
+
+        raise ImmutablePassphraseError
+
     def init(self, repository, passphrase):
         self.init_from_random_data(pbkdf2_sha256(passphrase.encode('utf-8'), repository.id, self.iterations, 100))
         self.init_ciphers()