mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-22 14:01:42 +03:00
feat(x509 Certificate Generator): add options for RSA bits
This commit is contained in:
1 parent
6cc1ad7e98
commit
23ede48549
2 files changed
+25
-5
No files matched your search
+6
-5
@@ -3537,6 +3537,7 @@ tools:
|
|||||||
tag-fingerprint: 'Fingerprint:'
|
tag-fingerprint: 'Fingerprint:'
|
||||||
tag-public-key: Public key
|
tag-public-key: Public key
|
||||||
tag-private-key: Private key
|
tag-private-key: Private key
|
||||||
|
rsa-bits: 'RSA Bits:'
|
||||||
xpath-memo:
|
xpath-memo:
|
||||||
title: XPath Syntax Cheatsheet
|
title: XPath Syntax Cheatsheet
|
||||||
description: XPath Syntax Cheatsheet
|
description: XPath Syntax Cheatsheet
|
||||||
@@ -8707,16 +8708,16 @@ tools:
|
|||||||
label-cancel: Cancel
|
label-cancel: Cancel
|
||||||
label-hibernate: Hibernate
|
label-hibernate: Hibernate
|
||||||
title-generated-command: Generated command
|
title-generated-command: Generated command
|
||||||
tag-nbsp-h-nbsp: " h "
|
tag-nbsp-h-nbsp: ' h '
|
||||||
tag-nbsp-m-nbsp: " m "
|
tag-nbsp-m-nbsp: ' m '
|
||||||
tag-nbsp-s: " s"
|
tag-nbsp-s: ' s'
|
||||||
random-line-picker:
|
random-line-picker:
|
||||||
title: Random Line Picker
|
title: Random Line Picker
|
||||||
description: Pick random lines from a text input
|
description: Pick random lines from a text input
|
||||||
externalAccess: "null"
|
externalAccess: 'null'
|
||||||
texts:
|
texts:
|
||||||
label-allow-repeated-lines: Allow repeated lines
|
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
|
label-prefix-lines-with-line-number: Add line numbers
|
||||||
placeholder-picked-lines: Picked lines
|
placeholder-picked-lines: Picked lines
|
||||||
placeholder-put-your-text-here: Put your text here...
|
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 { withDefaultOnErrorAsync } from '@/utils/defaults';
|
||||||
import { computedRefreshableAsync } from '@/composable/computedRefreshable';
|
import { computedRefreshableAsync } from '@/composable/computedRefreshable';
|
||||||
import { useValidation } from '@/composable/validation';
|
import { useValidation } from '@/composable/validation';
|
||||||
|
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
@@ -29,6 +30,17 @@ const country = ref('France');
|
|||||||
const contactEmail = ref('');
|
const contactEmail = ref('');
|
||||||
const subjectAlternativeNames = ref('');
|
const subjectAlternativeNames = ref('');
|
||||||
const emptyCSR = { certificatePem: '', privateKeyPem: '', publicKeyPem: '', fingerprint: '' };
|
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(
|
const [certs, refreshCerts] = computedRefreshableAsync(
|
||||||
() => withDefaultOnErrorAsync(() => {
|
() => withDefaultOnErrorAsync(() => {
|
||||||
@@ -38,6 +50,7 @@ const [certs, refreshCerts] = computedRefreshableAsync(
|
|||||||
|
|
||||||
return generateSSLCertificate({
|
return generateSSLCertificate({
|
||||||
password: password.value,
|
password: password.value,
|
||||||
|
bits: bits.value,
|
||||||
commonName: commonName.value,
|
commonName: commonName.value,
|
||||||
countryName: country.value,
|
countryName: country.value,
|
||||||
city: city.value,
|
city: city.value,
|
||||||
@@ -181,6 +194,12 @@ const [certs, refreshCerts] = computedRefreshableAsync(
|
|||||||
</n-form-item>
|
</n-form-item>
|
||||||
</div>
|
</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>
|
<div flex justify-center>
|
||||||
<c-button @click="refreshCerts">
|
<c-button @click="refreshCerts">
|
||||||
{{ t('tools.x509-certificate-generator.texts.tag-refresh-certificate') }}
|
{{ t('tools.x509-certificate-generator.texts.tag-refresh-certificate') }}
|
||||||
|
|||||||
Reference in new issue
Block a user