mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-23 06:42:26 +00:00
Give slightly better error messages from rsa key validation failure
This commit is contained in:
parent
23f2d8b019
commit
f6d9c33526
@ -176,7 +176,7 @@ def _validate_public_key(public_key: PublicKey) -> None:
|
|||||||
"""
|
"""
|
||||||
if not isinstance(public_key, rsa.RSAPublicKey):
|
if not isinstance(public_key, rsa.RSAPublicKey):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"public_key must be an RSAPublicKey"
|
f"public_key must be an RSAPublicKey not {type(public_key)}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -187,5 +187,5 @@ def _validate_private_key(private_key: PrivateKey) -> None:
|
|||||||
"""
|
"""
|
||||||
if not isinstance(private_key, rsa.RSAPrivateKey):
|
if not isinstance(private_key, rsa.RSAPrivateKey):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"private_key must be an RSAPrivateKey"
|
f"private_key must be an RSAPrivateKey not {type(private_key)}"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user