File tree Expand file tree Collapse file tree
JSONWebToken-Core.package
JWAHMACSHA256.class/class
JsonWebSignature.class/instance
JSONWebToken-OpenSSL.package/JWARSASHA256.class/class Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11sign
2- checkSignature: parts withKey: key
2+ checkSignature: aString withKey: key
3+ | tokenParts |
4+ tokenParts := $. split: aString.
35 (self
4- signMessage:
5- ($.
6- join:
7- {parts first.
8- parts second}) withKey: key)
9- = (Base64UrlEncoder new decode: parts third base64Padded)
6+ signMessage: ($. join: (tokenParts first: 2 ))
7+ withKey: key)
8+ = (Base64UrlEncoder new decode: tokenParts third base64Padded)
109 ifFalse: [ Error signal : ' signature does not match' ]
Original file line number Diff line number Diff line change 11signature
2- checkSignature: parts
3-
2+ checkSignature: aString
3+ | token |
4+ token := (aString isString not )
5+ ifTrue: [
6+ " this seems to be the old usage handing out the parts collection so resemble"
7+ $. join: aString ]
8+ ifFalse: [ aString ].
49
5- self protectedHeader algorithm checkSignature: parts withKey: key
10+ self protectedHeader algorithm checkSignature: token withKey: key
Original file line number Diff line number Diff line change 11sign
2- checkSignature: parts withKey: key
3- | jwtHeaderAndPayload signatureByteArray publicKey |
4- jwtHeaderAndPayload := $.
5- join:
6- {parts first.
7- parts second}.
8- signatureByteArray := parts third base64Padded base64Decoded
2+ checkSignature: aString withKey: key
3+ | jwtHeaderAndPayload signatureByteArray publicKey tokenParts |
4+ tokenParts := $. split: aString.
5+ jwtHeaderAndPayload := $. join: (tokenParts first: 2 ).
6+ signatureByteArray := (Base64UrlEncoder new decode: tokenParts third base64Padded)
97 asByteArray.
108 publicKey := (key includesSubstring: ' BEGIN RSA PUBLIC KEY' )
119 ifTrue: [ LcEvpPublicKey setRSA: (LcRSA fromRsaPublicKeyPemString: key) ]
You can’t perform that action at this time.
0 commit comments