There are two ways to use JWT public / private keys: signature and encryption.
If you use the private key for signing, it allows the recipient to identify the sender of the JWT and the integrity of the message, so as not to hide its contents from others (confidentiality). Note that this will be the sender's secret key, which is used to sign the JWT and create the JSON Web Signature (JWS) object. Apparently this refers to the JWT you are looking at.
When using a public key for encryption, it can be used to hide content from anyone other than the intended recipient. The result is a JSON Web Encryption object. Please note that this will be the recipientโs public key, which is used to encrypt the JWT. Apparently, this is what you are looking for.
See: http://jose.readthedocs.org/en/latest/
source share