(&self, key: &KeyPair, config: CertConfigV2)
| 69 | } |
| 70 | |
| 71 | async fn issue_cert(&self, key: &KeyPair, config: CertConfigV2) -> Result<Vec<String>> { |
| 72 | let pubkey = key.public_key_der(); |
| 73 | let attestation = self |
| 74 | .platform |
| 75 | .certificate_attestation(&pubkey) |
| 76 | .context("Failed to get certificate attestation")?; |
| 77 | let csr = CertSigningRequestV2 { |
| 78 | confirm: "please sign cert:".to_string(), |
| 79 | pubkey, |
| 80 | config, |
| 81 | attestation, |
| 82 | }; |
| 83 | let signature = csr.signed_by(key).context("Failed to sign the CSR")?; |
| 84 | self.cert_client |
| 85 | .sign_csr(&csr, &signature) |
| 86 | .await |
| 87 | .context("Failed to sign the CSR") |
| 88 | } |
| 89 | |
| 90 | async fn request_demo_cert(&self) -> Result<String> { |
| 91 | let key = KeyPair::generate().context("Failed to generate demo key")?; |
no test coverage detected