mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-09 20:01:23 +00:00
Assert/test types of privkey
and pubkey
vars
And appease type-checkers.
This commit is contained in:
parent
5a485545f6
commit
23af93cff7
@ -22,6 +22,8 @@ import allmydata.uri
|
||||
from allmydata.crypto.rsa import (
|
||||
create_signing_keypair,
|
||||
der_string_from_signing_key,
|
||||
PrivateKey,
|
||||
PublicKey,
|
||||
)
|
||||
from allmydata.mutable.common import derive_mutable_keys
|
||||
from allmydata.util import jsonbytes as json
|
||||
@ -634,7 +636,9 @@ yC/N5w3cCLa2LLKoLG8hagFDlXBGSmpT1zgKBk4YxNn6CLdMSzPR
|
||||
privkey = load_pem_private_key(
|
||||
privkey_pem.encode("ascii"), password=None
|
||||
)
|
||||
assert isinstance(privkey, PrivateKey)
|
||||
pubkey = privkey.public_key()
|
||||
assert isinstance(pubkey, PublicKey)
|
||||
|
||||
writekey, _, fingerprint = derive_mutable_keys((pubkey, privkey))
|
||||
|
||||
@ -856,7 +860,9 @@ inAwsxbbWoR08ai4exzbJrNrLpDRg5ih2wMtknN6D8m+EAvBC/Gj
|
||||
privkey = load_pem_private_key(
|
||||
privkey_pem.encode("ascii"), password=None
|
||||
)
|
||||
assert isinstance(privkey, PrivateKey)
|
||||
pubkey = privkey.public_key()
|
||||
assert isinstance(pubkey, PublicKey)
|
||||
|
||||
writekey, _, fingerprint = derive_mutable_keys((pubkey, privkey))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user