diff --git a/locales/en.yml b/locales/en.yml index b5403367..dba98b55 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -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... diff --git a/src/tools/x509-certificate-generator/x509-certificate-generator.vue b/src/tools/x509-certificate-generator/x509-certificate-generator.vue index f9847f21..78e86a47 100644 --- a/src/tools/x509-certificate-generator/x509-certificate-generator.vue +++ b/src/tools/x509-certificate-generator/x509-certificate-generator.vue @@ -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( +
+ + + +
+
{{ t('tools.x509-certificate-generator.texts.tag-refresh-certificate') }}