Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RecodeCertificate
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KIT-CA
RecodeCertificate
Commits
35ea2784
Commit
35ea2784
authored
Mar 20, 2018
by
tobias.dussa
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into Windows
parents
c5aa5566
36b22493
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
2 deletions
+46
-2
RecodeCertificate.py
RecodeCertificate.py
+46
-2
No files found.
RecodeCertificate.py
View file @
35ea2784
...
...
@@ -4,7 +4,51 @@
from
OpenSSL
import
crypto
,
SSL
from
os.path
import
basename
,
dirname
,
isfile
,
splitext
from
sys
import
exit
from
tkinter
import
Tk
,
filedialog
,
messagebox
,
simpledialog
from
tkinter
import
Button
,
E
,
Entry
,
Label
,
LEFT
,
Tk
,
W
,
filedialog
,
messagebox
,
simpledialog
# Define password query dialog
class
_QueryPasswordDialog
(
simpledialog
.
_QueryDialog
):
def
body
(
self
,
master
):
w
=
Label
(
master
,
text
=
self
.
prompt
,
justify
=
LEFT
)
w
.
grid
(
row
=
0
,
padx
=
5
,
sticky
=
W
)
self
.
entry
=
Entry
(
master
,
name
=
"entry"
)
self
.
entry
.
grid
(
row
=
1
,
padx
=
5
,
sticky
=
W
+
E
)
self
.
toggle
=
Button
(
master
,
text
=
"⚷"
,
command
=
self
.
toggleShow
)
self
.
toggle
.
grid
(
row
=
1
,
padx
=
5
,
column
=
1
,
sticky
=
W
+
E
)
if
self
.
initialvalue
is
not
None
:
self
.
entry
.
insert
(
0
,
self
.
initialvalue
)
self
.
entry
.
select_range
(
0
,
END
)
return
self
.
entry
def
toggleShow
(
self
):
if
self
.
entry
[
"show"
]
==
""
:
self
.
entry
[
"show"
]
=
"●"
else
:
self
.
entry
[
"show"
]
=
""
class
_QueryPassword
(
_QueryPasswordDialog
):
def
__init__
(
self
,
*
args
,
**
kw
):
if
"show"
in
kw
:
self
.
__show
=
kw
[
"show"
]
del
kw
[
"show"
]
else
:
self
.
__show
=
"●"
_QueryPasswordDialog
.
__init__
(
self
,
*
args
,
**
kw
)
def
body
(
self
,
master
):
entry
=
_QueryPasswordDialog
.
body
(
self
,
master
)
if
self
.
__show
is
not
None
:
entry
.
configure
(
show
=
self
.
__show
)
return
entry
def
askpassword
(
title
,
prompt
,
**
kw
):
d
=
_QueryPassword
(
title
,
prompt
,
**
kw
)
return
d
.
result
# Create and hide root window
...
...
@@ -28,7 +72,7 @@ while True:
# Read password
while
True
:
password
=
simpledialog
.
askstring
(
'Passworteingabe'
,
'Passwort des geheimen Schlüssels:'
)
password
=
askpassword
(
'Passworteingabe'
,
'Passwort des geheimen Schlüssels:'
)
if
password
is
None
:
messagebox
.
showinfo
(
'Abbruch'
,
'Die Passworteingabe wurde abgebrochen!'
)
exit
(
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment