(
cert_client: &CertRequestClient,
key: &KeyPair,
config: CertConfigV2,
)
| 61 | use serde_json::Value; |
| 62 | |
| 63 | async fn sign_cert_request( |
| 64 | cert_client: &CertRequestClient, |
| 65 | key: &KeyPair, |
| 66 | config: CertConfigV2, |
| 67 | ) -> Result<Vec<String>> { |
| 68 | let pubkey = key.public_key_der(); |
| 69 | let report_data = QuoteContentType::RaTlsCert.to_report_data(&pubkey); |
| 70 | let attestation = Attestation::quote(&report_data) |
| 71 | .context("Failed to get quote for cert pubkey")? |
| 72 | .into_versioned(); |
| 73 | let csr = CertSigningRequestV2 { |
| 74 | confirm: "please sign cert:".to_string(), |
| 75 | pubkey, |
| 76 | config, |
| 77 | attestation, |
| 78 | }; |
| 79 | let signature = csr.signed_by(key).context("Failed to sign the CSR")?; |
| 80 | cert_client |
| 81 | .sign_csr(&csr, &signature) |
| 82 | .await |
| 83 | .context("Failed to sign the CSR") |
| 84 | } |
| 85 | |
| 86 | mod config_id_verifier; |
| 87 |
no test coverage detected