Add full XCA curve and digest parity
This commit is contained in:
@@ -4,15 +4,19 @@ use sycamore::prelude::*;
|
||||
use wasm_bindgen_futures::spawn_local;
|
||||
|
||||
use crate::api;
|
||||
use crate::components::crypto::{apply_signature_hash, signature_hash_input};
|
||||
use crate::components::nav::{app_nav, spinner, whoami};
|
||||
use crate::components::ui::{copy_button, empty_state, page_header, toast_error};
|
||||
use crate::dom;
|
||||
use crate::model::{fmt_date, CertificateDetail, Me, Revocation, TemplateSummary};
|
||||
use crate::model::{
|
||||
fmt_date, CertificateDetail, Me, OptionsPage, Revocation, TemplateSummary,
|
||||
};
|
||||
|
||||
pub fn CertificateDetailPage(vault_id: String, cert_id: String) -> View {
|
||||
let id: &'static str = Box::leak(vault_id.clone().into_boxed_str());
|
||||
let cert_id_value: &'static str = Box::leak(cert_id.clone().into_boxed_str());
|
||||
let me = create_signal(None::<Me>);
|
||||
let options = create_signal(None::<OptionsPage>);
|
||||
let cert = create_signal(None::<CertificateDetail>);
|
||||
let error = create_signal(None::<String>);
|
||||
let loading = create_signal(true);
|
||||
@@ -85,6 +89,9 @@ pub fn CertificateDetailPage(vault_id: String, cert_id: String) -> View {
|
||||
if let Ok(user) = api::me().await {
|
||||
me.set(Some(user));
|
||||
}
|
||||
if let Ok(page) = api::options(id).await {
|
||||
options.set(Some(page));
|
||||
}
|
||||
loading.set(false);
|
||||
});
|
||||
load();
|
||||
@@ -188,13 +195,18 @@ pub fn CertificateDetailPage(vault_id: String, cert_id: String) -> View {
|
||||
});
|
||||
};
|
||||
|
||||
let ca_key_type = move || {
|
||||
cert.get_clone()
|
||||
.and_then(|certificate| certificate.key_type.clone())
|
||||
};
|
||||
|
||||
let generate_crl = move |_| {
|
||||
let payload = json!({
|
||||
let mut payload = json!({
|
||||
"days": crl_days.get_clone().parse::<i64>().unwrap_or(30),
|
||||
"signature_hash": crl_hash.get_clone(),
|
||||
"with_reason": true,
|
||||
"include_aki": true,
|
||||
});
|
||||
apply_signature_hash(&mut payload, ca_key_type().as_deref(), &crl_hash.get_clone());
|
||||
spawn_local(async move {
|
||||
match api::generate_crl(id, cert_id_value, &payload).await {
|
||||
Ok(crl) => {
|
||||
@@ -518,12 +530,12 @@ pub fn CertificateDetailPage(vault_id: String, cert_id: String) -> View {
|
||||
input(class="form-control", bind:value=crl_days)
|
||||
}
|
||||
div(class="col-md-3") {
|
||||
label(class="form-label") { "Hash" }
|
||||
select(class="form-select", bind:value=crl_hash) {
|
||||
option(value="sha256") { "SHA-256" }
|
||||
option(value="sha384") { "SHA-384" }
|
||||
option(value="sha512") { "SHA-512" }
|
||||
}
|
||||
(signature_hash_input(
|
||||
"Hash",
|
||||
options,
|
||||
ca_key_type,
|
||||
crl_hash,
|
||||
))
|
||||
}
|
||||
div(class="col-md-3") {
|
||||
button(class="btn btn-primary", on:click=generate_crl) { "Generate CRL" }
|
||||
|
||||
Reference in New Issue
Block a user