Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
python-jwcrypto
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
FreeIPA packaging
python-jwcrypto
Commits
0ac5f17e
Commit
0ac5f17e
authored
May 08, 2015
by
Simo Sorce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method to export only the public part of a key
Signed-off-by:
Simo Sorce
<
simo@redhat.com
>
parent
ff0c94d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
jwcrypto/jwk.py
jwcrypto/jwk.py
+9
-0
No files found.
jwcrypto/jwk.py
View file @
0ac5f17e
...
...
@@ -327,6 +327,15 @@ class JWK(object):
d
.
update
(
self
.
_unknown
)
return
json_encode
(
d
)
def
export_public
(
self
):
"""Exports the public key in the standard JSON format"""
pub
=
{
'kty'
:
self
.
_params
[
'kty'
]}
reg
=
JWKValuesRegistry
[
self
.
_params
[
'kty'
]]
for
param
in
reg
:
if
reg
[
param
][
1
]
==
'Public'
:
pub
[
param
]
=
self
.
_key
[
param
]
return
json_encode
(
pub
)
@
property
def
key_type
(
self
):
return
self
.
_params
.
get
(
'kty'
,
None
)
...
...
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