raannakasturi commited on
Commit
1d4eed5
·
verified ·
1 Parent(s): dcda463

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -9,15 +9,18 @@ def update_key_options(key_type):
9
 
10
  def privcsr(domains_input, email, key_type, key_size=None, key_curve=None):
11
  domains = domains_input.split(",")
12
- private_key, csr = gen_pvt_csr(domains, email, key_type, key_size=int(key_size) if key_type == "rsa" else key_curve)
 
 
 
13
  return private_key.decode(), csr.decode()
14
 
15
  def app():
16
  with gr.Blocks(title="Project Gatekeeper - Get free SSL Certificates") as webui:
17
  with gr.Row():
18
  with gr.Column():
19
- domains_input = gr.Textbox(label="Enter Domains", placeholder="thenayankasturi.eu.org, *.thenayankasturi.eu.org", type="text", interactive=True)
20
- email = gr.Textbox(label="Enter Email", placeholder="[email protected]", type="text", interactive=True)
21
  with gr.Row():
22
  key_type = gr.Radio(label="Select SSL key type", choices=["rsa", "ecc"], interactive=True, value='ecc')
23
  key_size_dropdown = gr.Dropdown(label="Select Key Size", choices=['2048', '4096'], value='4096', visible=False) # Initially visible
 
9
 
10
  def privcsr(domains_input, email, key_type, key_size=None, key_curve=None):
11
  domains = domains_input.split(",")
12
+ if key_type.lower() == 'rsa':
13
+ private_key, csr = gen_pvt_csr(domains, email, key_type, key_size=int(key_size))
14
+ else:
15
+ private_key, csr = gen_pvt_csr(domains, email, key_type, key_curve=key_curve)
16
  return private_key.decode(), csr.decode()
17
 
18
  def app():
19
  with gr.Blocks(title="Project Gatekeeper - Get free SSL Certificates") as webui:
20
  with gr.Row():
21
  with gr.Column():
22
+ domains_input = gr.Textbox(label="Enter Domains", placeholder="thenayankasturi.eu.org, *.thenayankasturi.eu.org", type="text", interactive=True, value="thenayankasturi.eu.org, *.thenayankasturi.eu.org")
23
+ email = gr.Textbox(label="Enter Email", placeholder="[email protected]", type="text", interactive=True, value="[email protected]")
24
  with gr.Row():
25
  key_type = gr.Radio(label="Select SSL key type", choices=["rsa", "ecc"], interactive=True, value='ecc')
26
  key_size_dropdown = gr.Dropdown(label="Select Key Size", choices=['2048', '4096'], value='4096', visible=False) # Initially visible