feat(x509 Certificate Generator): add options for RSA bits

This commit is contained in:
ShareVB committed 2026-05-11 13:59:16 +02:00
1 parent 6cc1ad7e98
commit 23ede48549
2 files changed
+25 -5

No files matched your search

+6 -5
View File
@@ -3537,6 +3537,7 @@ tools:
tag-fingerprint: 'Fingerprint:'
tag-public-key: Public key
tag-private-key: Private key
rsa-bits: 'RSA Bits:'
xpath-memo:
title: XPath Syntax Cheatsheet
description: XPath Syntax Cheatsheet
@@ -8707,16 +8708,16 @@ tools:
label-cancel: Cancel
label-hibernate: Hibernate
title-generated-command: Generated command
tag-nbsp-h-nbsp: " h "
tag-nbsp-m-nbsp: " m "
tag-nbsp-s: " s"
tag-nbsp-h-nbsp: ' h '
tag-nbsp-m-nbsp: ' m '
tag-nbsp-s: ' s'
random-line-picker:
title: Random Line Picker
description: Pick random lines from a text input
externalAccess: "null"
externalAccess: 'null'
texts:
label-allow-repeated-lines: Allow repeated lines
label-number-of-lines-to-pick: "Number of lines to pick:"
label-number-of-lines-to-pick: 'Number of lines to pick:'
label-prefix-lines-with-line-number: Add line numbers
placeholder-picked-lines: Picked lines
placeholder-put-your-text-here: Put your text here...
@@ -5,6 +5,7 @@ import TextareaCopyable from '@/components/TextareaCopyable.vue';
import { withDefaultOnErrorAsync } from '@/utils/defaults';
import { computedRefreshableAsync } from '@/composable/computedRefreshable';
import { useValidation } from '@/composable/validation';
import { useQueryParamOrStorage } from '@/composable/queryParams';
const { t } = useI18n();
@@ -29,6 +30,17 @@ const country = ref('France');
const contactEmail = ref('');
const subjectAlternativeNames = ref('');
const emptyCSR = { certificatePem: '', privateKeyPem: '', publicKeyPem: '', fingerprint: '' };
const bits = useQueryParamOrStorage({ name: 'bits', storageName: 'cert-gen:b', defaultValue: 2048 });
const { attrs: bitsValidationAttrs } = useValidation({
source: bits,
rules: [
{
message: t('tools.csr-generator.texts.bits-should-be-256-less-than-bits-less-than-16384-and-be-a-multiple-of-8'),
validator: value => value >= 256 && value <= 16384 && value % 8 === 0,
},
],
});
const [certs, refreshCerts] = computedRefreshableAsync(
() => withDefaultOnErrorAsync(() => {
@@ -38,6 +50,7 @@ const [certs, refreshCerts] = computedRefreshableAsync(
return generateSSLCertificate({
password: password.value,
bits: bits.value,
commonName: commonName.value,
countryName: country.value,
city: city.value,
@@ -181,6 +194,12 @@ const [certs, refreshCerts] = computedRefreshableAsync(
</n-form-item>
</div>
<div>
<n-form-item :label="t('tools.x509-certificate-generator.texts.rsa-bits')" v-bind="bitsValidationAttrs as any" label-placement="left">
<n-input-number v-model:value="bits" min="256" max="16384" step="8" />
</n-form-item>
</div>
<div flex justify-center>
<c-button @click="refreshCerts">
{{ t('tools.x509-certificate-generator.texts.tag-refresh-certificate') }}