Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser failed wth "ParameterNotUnderstood: Could not find an action for Header Parameter 'ppt''" #36

Open
veluvarti835 opened this issue Sep 20, 2017 · 1 comment

Comments

@veluvarti835
Copy link

payload ={"alg":"ES256","typ":"passport","ppt":"shaken","x5u":"https://wiresharkserver.mtimslab.atttest.com/vesper/dig-sig.crt"}
payload ={}
header = {"alg":"ES256","typ":"passport","ppt":"shaken","x5u":"https://wiresharkserver.mtimslab.atttest.com/vesper/dig-sig.crt"}
payload = {"attest":"A","dest":{"tn":["+12249587065"]},"iat":1504163217,"orig":{"tn":"+12249587035"},"origid":"6cf14ce7-5c58-403c-8982-07f11b8680d5"}
signature = jws.sign(header, payload, 'secret')
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/jws/init.py", line 23, in sign
header.process(data, 'sign')
File "/usr/lib/python2.7/site-packages/jws/header.py", line 67, in process
instance = cls(param, data['header'][param], data)
File "/usr/lib/python2.7/site-packages/jws/header.py", line 10, in init
self.value = self.clean(value)
File "/usr/lib/python2.7/site-packages/jws/header.py", line 30, in clean
raise ParameterNotUnderstood("Could not find an action for Header Parameter '%s'" % self.name)
jws.exceptions.ParameterNotUnderstood: Could not find an action for Header Parameter 'ppt'

@veluvarti835
Copy link
Author

After adding ppt header in to known headers got below error , can some one help me to resolve it
KNOWN_HEADERS = {
# REQUIRED, signing algo, see signing_methods
'alg': Algorithm,
# OPTIONAL, type of signed content
'typ': GenericString,
# OPTIONAL, JSON Key URL. See http://self-issued.info/docs/draft-jones-json-web-key.html
'jku': VerifyNotImplemented,
# OPTIONAL, key id, hint for which key to use.
'kid': VerifyNotImplemented,
# OPTIONAL, x.509 URL pointing to certificate or certificate chain
'x5u': VerifyNotImplemented,
# OPTIONAL, x.509 certificate thumbprint
'x5t': VerifyNotImplemented,
# OPTIONAL, type of signed content
'ppt': GenericString,
}

signature = jws.sign(header, payload, 'secret')
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/jws/init.py", line 29, in sign
signature = signer(_signing_input(head, payload, is_json), key)
File "/usr/lib/python2.7/site-packages/jws/algos.py", line 127, in sign
return key.sign(msg, hashfunc=self.hasher)
AttributeError: 'str' object has no attribute 'sign'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant