Skip to content

Commit a0cf801

Browse files
committed
Use new CertifiedIssuer API from rcgen
1 parent 53bd272 commit a0cf801

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ http-body-util = "0.1.2"
3333
hyper = { version = "1.3.1", features = ["client", "http1", "http2"], optional = true }
3434
hyper-rustls = { version = "0.27.7", default-features = false, features = ["http1", "http2", "native-tokio", "tls12", "rustls-platform-verifier"], optional = true }
3535
hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2", "tokio"], optional = true }
36-
rcgen = { version = "0.14", default-features = false, features = ["pem"], optional = true }
36+
rcgen = { version = "0.14.2", default-features = false, features = ["pem"], optional = true }
3737
ring = { version = "0.17", features = ["std"], optional = true }
3838
rustls = { version = "0.23", default-features = false, optional = true }
3939
rustls-pki-types = "1.1.0"

examples/certgen.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use std::fs;
66

7-
use rcgen::{BasicConstraints, DistinguishedName, DnType, IsCa, Issuer, KeyPair};
7+
use rcgen::{BasicConstraints, CertifiedIssuer, DistinguishedName, DnType, IsCa, KeyPair};
88

99
fn main() -> anyhow::Result<()> {
1010
let ca_key = KeyPair::generate()?;
@@ -14,9 +14,8 @@ fn main() -> anyhow::Result<()> {
1414
ca_params.distinguished_name = distinguished_name;
1515
ca_params.is_ca = IsCa::Ca(BasicConstraints::Unconstrained);
1616

17-
let ca_cert = ca_params.self_signed(&ca_key)?;
18-
fs::write("tests/testdata/ca.pem", ca_cert.pem())?;
19-
let issuer = Issuer::new(ca_params, ca_key);
17+
let issuer = CertifiedIssuer::self_signed(ca_params, ca_key)?;
18+
fs::write("tests/testdata/ca.pem", issuer.as_ref().pem())?;
2019

2120
let ee_key = KeyPair::generate()?;
2221
fs::write("tests/testdata/server.key", ee_key.serialize_pem())?;

0 commit comments

Comments
 (0)