Skip to content

Commit

Permalink
tests: add simple CSR round-trip
Browse files Browse the repository at this point in the history
  • Loading branch information
cpu committed Mar 26, 2024
1 parent 4852539 commit 8974b7f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rcgen/tests/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,20 @@ mod test_parse_other_name_alt_name {
assert_eq!(subject_alt_names, expected_alt_names);
}
}

#[cfg(feature = "x509-parser")]
mod test_csr {
use rcgen::{CertificateParams, CertificateSigningRequestParams, KeyPair};

#[test]
fn test_csr_roundtrip() {
// We should be able to serialize a CSR, and then parse the CSR.
_ = CertificateSigningRequestParams::from_der(
CertificateParams::default()
.serialize_request(&KeyPair::generate().unwrap())
.unwrap()
.der(),
)
.unwrap();
}
}

0 comments on commit 8974b7f

Please sign in to comment.