Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 73ab16a1

Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)

Re #8706 - Specify custom extensions

Zobrazit rozdíly:

static/create_certificate.html
209 209
                    </td>
210 210
                </div>
211 211
            </tr>
212
            <tr>
213
                <div class="form-group form-check">
214
                    <td><label class="form-check-label" for="specifyExtensionsCheckbox" style="margin-top: 15px">Custom extensions:</label></td>
215
                    <td class="pl-3">
216
                        <input type="checkbox" v-model="customExtensions" id="specifyExtensionsCheckbox" name="specifyExtensions" class="mb-2 form-check-input form-check">
217
                    </td>
218
                </div>
219
            </tr>
220
            <tr v-if="customExtensions">
221
                <div class="form-group">
222
                    <td class="pl-5"><label for="extensions">Extensions:</label></td>
223
                    <td class="pl-3">
224
                        <input type="text" v-model:value="extensions" id="extensions" name="extensions" class="form-control">
225
                    </td>
226
                </div>
227
            </tr>
212 228
            <tr>
213 229
                <td align="center">
214
                    <button class="btn btn-success mt-3 w-auto" v-on:click="onCreateCertificate()">Create certificate</button>
230
                    <button class="btn btn-success mt-3 w-auto" v-on:click="onCreateCertificate">Create certificate</button>
215 231
                </td>
216 232
                <td align="center">
217 233
                    <button class="btn btn-secondary mt-3 w-75" onclick="window.location.href = '/static/index.html'">Cancel</button>
static/js/create_certificate.js
7 7
        isSelfSigned: false,
8 8
        invalidCN: false,
9 9
        customKey: false,
10
        customExtensions: false,
10 11
        // available certificate authorities
11 12
        authorities: [],
12 13
        // data of the selected certificate authorities to be displayed in the form
......
39 40
            },
40 41
            CA: null
41 42
        },
43
        extensions: null,
42 44
        key: {
43 45
            password: null,
44 46
            key_pem: null,
......
103 105
            }
104 106

  
105 107
            // populate optional key field in the request body
106
            if (this.key.password != null && this.key.password !== "") {
108
            delete this.certificateData.key;
109
            if (this.customKey && this.key.password != null && this.key.password !== "") {
107 110
                this.certificateData.key.password = this.key.password;
108 111
            }
109
            if (this.key.key_pem != null) {
112
            if (this.customKey && this.key.key_pem != null) {
110 113
                this.certificateData.key.key_pem = this.key.key_pem;
111 114
            }
112 115

  
116
            // populate optional extensions field in the request body
117
            delete this.certificateData.extensions;
118
            if (this.customExtensions && this.extensions !== "" && this.extensions != null)
119
            {
120
                this.certificateData.extensions = this.extensions;
121
            }
122

  
123

  
113 124
            this.certificateData.validityDays = parseInt(this.certificateData.validityDays);
114 125
            try {
115 126
                // create a deep copy of the certificate dataa

Také k dispozici: Unified diff