mirror of
https://github.com/pcvolkmer/cert-tools.git
synced 2025-04-19 17:06:49 +00:00
refactor: change method name
This commit is contained in:
parent
5127cf168d
commit
b1fe6c0be5
@ -140,7 +140,7 @@ impl Certificate {
|
|||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_plain(&self) -> Result<String, ()> {
|
pub fn to_pem(&self) -> Result<String, ()> {
|
||||||
match self.cert.to_pem() {
|
match self.cert.to_pem() {
|
||||||
Ok(pem) => String::from_utf8(pem).map_err(|_| ()),
|
Ok(pem) => String::from_utf8(pem).map_err(|_| ()),
|
||||||
Err(_) => Err(()),
|
Err(_) => Err(()),
|
||||||
|
@ -131,7 +131,7 @@ fn main() -> Result<(), ()> {
|
|||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
for cert in chain.certs() {
|
for cert in chain.certs() {
|
||||||
match cert.to_plain() {
|
match cert.to_pem() {
|
||||||
Ok(plain) => print!("{}", plain),
|
Ok(plain) => print!("{}", plain),
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user