Skip to content

Commit

Permalink
Flesh out example
Browse files Browse the repository at this point in the history
  • Loading branch information
brianloveswords committed Jun 2, 2011
1 parent 2b27425 commit d43f67e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/ragecrypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ def verify(self, msg, sig, key):
# named groups will be sent to the class constructor
(r'^(?P<fval>f+)(?P<uval>u+)$', FXUY),
]

## now this will be the algorithm discovered for any of the following headers:
# will sign with FXUY(fval=3, uval=3).sign
jws.sign({'alg': 'fffuuu'}, {'claim':'rad'}, 'key')

# will sign with FXUY(fval=1, uval=8).sign
jws.sign({'alg': 'fuuuuuuuu'}, {'claim':'rad'}, 'key')

# will sign with FXUY(fval=7, uval=12).sign
jws.sign({'alg': 'fffffffuuuuuuuuuuu'}, {'claim':'rad'}, 'key')

0 comments on commit d43f67e

Please sign in to comment.