Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
zhifan huang
re6stnet
Commits
1a03a2b2
Commit
1a03a2b2
authored
Jun 13, 2022
by
zhifan huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: add coment in test.tool
parent
304784ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
re6st/tests/tools.py
re6st/tests/tools.py
+9
-2
No files found.
re6st/tests/tools.py
View file @
1a03a2b2
...
...
@@ -104,10 +104,17 @@ def create_ca_file(pkey_file, cert_file, serial=0x120010db80042):
def
prefix2cn
(
prefix
):
""" prefix binary format
cn, common name, serial/length
"""
return
"%u/%u"
%
(
int
(
prefix
,
2
),
len
(
prefix
))
def
serial2prefix
(
serial
):
return
bin
(
serial
)[
2
:].
rjust
(
16
,
'0'
)
def
serial2prefix
(
serial
,
length
=
16
):
"""serial, decimal of prefix
prefix binary
"""
# return bin(serial)[2:].rjust(16, '0')
return
"{:0{}b}"
.
format
(
serial
,
length
)
# pkey: private key
def
decrypt
(
pkey
,
incontent
):
...
...
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