NAME
    Crypt::JWT - JSON Web Token (JWT, JWS, JWE) as defined by RFC7519,
    RFC7515, RFC7516

SYNOPSIS
       # encoding
       use Crypt::JWT qw(encode_jwt);
       my $jws_token = encode_jwt(payload=>$data, alg=>'HS256', key=>'secret'); 
       my $jwe_token = encode_jwt(payload=>$data, alg=>'A192GCMKW', enc=>'A192CBC_HS384', key=>'secret'); 

       # decoding
       use Crypt::JWT qw(decode_jwt);
       my $data1 = decode_jwt(token=>$jws_token, key=>'secret'); 
       my $data2 = decode_jwt(token=>$jwe_token, key=>'secret');

DESCRIPTION
    BEWARE: experimental, unfinished, unstable, work in progress!!!

    Implements JSON Web Token (JWT) - <https://tools.ietf.org/html/rfc7519>.
    The implementation covers not only JSON Web Signature (JWS) -
    <https://tools.ietf.org/html/rfc7515>, but also JSON Web Encryption
    (JWE) - <https://tools.ietf.org/html/rfc7516>.

    The module implements all (100%) algorithms defined in
    <https://tools.ietf.org/html/rfc7518> - JSON Web Algorithms (JWA).

    Supported JWE (encryption) algorithms:

     alg                 enc
     ------------------  -------------
     dir                 A128GCM
     A128KW              A192GCM
     A192KW              A256GCM
     A256KW              A128CBC-HS256
     A128GCMKW           A192CBC-HS384
     A192GCMKW           A256CBC-HS512
     A256GCMKW           
     PBES2-HS256+A128KW  
     PBES2-HS384+A192KW  
     PBES2-HS512+A256KW  
     RSA-OAEP            
     RSA-OAEP-256        
     RSA1_5              
     ECDH-ES+A128KW
     ECDH-ES+A192KW
     ECDH-ES+A256KW
     ECDH-ES

    Supported JWS (signature) algorithms:

     alg        note
     ---------  ----------------------------------------
     none       no integrity (NOTE: disabled by default)
     HS256      HMAC integrity
     HS384
     HS512
     RS256      RSA+PKCS1-V1_5 signatures
     RS384
     RS512
     PS256      RSA+PSS signatures
     PS384
     PS512
     ES256      ECDSA signatures
     ES384
     ES512

FUNCTIONS
  decode_jwt
     my $data = decode_jwt(%named_args);

    Named arguments:

    token
        XXX-TODO

    key XXX-TODO

    allow_none
        XXX-TODO

  encode_jwt
     my $token = encode_jwt(%named_args);

    Named arguments:

    payload
        XXX-TODO

    key XXX-TODO

    allow_none
        XXX-TODO

    auto_iat
        XXX-TODO

SEE ALSO
    Crypt::Cipher::AES, Crypt::AuthEnc::GCM, Crypt::PK::RSA, Crypt::PK::ECC,
    Crypt::KeyDerivation, Crypt::KeyWrap

