Implement Debug for PrivKey

It returns a fixed string to prevent accidental data leakage.
This commit is contained in:
Steven Roose 2018-10-22 00:06:46 +01:00
parent f7b95c7533
commit 5f912bdeae
1 changed files with 6 additions and 0 deletions

View File

@ -153,6 +153,12 @@ impl fmt::Display for Privkey {
}
}
impl fmt::Debug for Privkey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "[private key data]")
}
}
impl FromStr for Privkey {
type Err = encode::Error;
fn from_str(s: &str) -> Result<Privkey, encode::Error> {