Examples of Protecting Content using JavaScript Object Signing and Encryption (JOSE)
draft-ietf-jose-cookbook-05

The information below is for an old version of the document
Document Type Active Internet-Draft (jose WG)
Last updated 2014-10-24
Stream IETF
Intended RFC status Informational
Formats pdf htmlized bibtex
Reviews
Stream WG state Submitted to IESG for Publication
Revised I-D Needed - Issue raised by WG
Document shepherd Jim Schaad
Shepherd write-up Show (last changed 2014-10-24)
IESG IESG state Publication Requested
Consensus Boilerplate Unknown
Telechat date
Responsible AD Kathleen Moriarty
Send notices to draft-ietf-jose-cookbook.all@tools.ietf.org, ietf@augustcellars.com, jose-chairs@tools.ietf.org, jose@ietf.org
JOSE Working Group                                             M. Miller
Internet-Draft                                       Cisco Systems, Inc.
Intended status: Informational                          October 24, 2014
Expires: April 27, 2015

   Examples of Protecting Content using JavaScript Object Signing and
                           Encryption (JOSE)
                      draft-ietf-jose-cookbook-05

Abstract

   This document contains a set of examples using JavaScript Object
   Signing and Encryption (JOSE) technology to protect data.  These
   examples present a representative sampling JSON Web Key (JWK)
   objects, as well as various JSON Web Signature (JWS) and JSON Web
   Encryption (JWE) results given similar inputs.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on April 27, 2015.

Copyright Notice

   Copyright (c) 2014 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of

Miller                   Expires April 27, 2015                 [Page 1]
Internet-Draft                JOSE Cookbook                 October 2014

   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   5
     1.1.  Conventions Used in this Document . . . . . . . . . . . .   5
   2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   6
   3.  JSON Web Key Examples . . . . . . . . . . . . . . . . . . . .   6
     3.1.  EC Public Key . . . . . . . . . . . . . . . . . . . . . .   6
     3.2.  EC Private Key  . . . . . . . . . . . . . . . . . . . . .   7
     3.3.  RSA Public Key  . . . . . . . . . . . . . . . . . . . . .   7
     3.4.  RSA Private Key . . . . . . . . . . . . . . . . . . . . .   8
     3.5.  Octet Key (MAC Computation) . . . . . . . . . . . . . . .  10
     3.6.  Octet Key (Encryption)  . . . . . . . . . . . . . . . . .  10
   4.  JSON Web Signature Examples . . . . . . . . . . . . . . . . .  11
     4.1.  RSA v1.5 Signature  . . . . . . . . . . . . . . . . . . .  11
       4.1.1.  Input Factors . . . . . . . . . . . . . . . . . . . .  12
       4.1.2.  Signing Operation . . . . . . . . . . . . . . . . . .  12
       4.1.3.  Output Results  . . . . . . . . . . . . . . . . . . .  13
     4.2.  RSA-PSS Signature . . . . . . . . . . . . . . . . . . . .  14
       4.2.1.  Input Factors . . . . . . . . . . . . . . . . . . . .  14
       4.2.2.  Signing Operation . . . . . . . . . . . . . . . . . .  15
       4.2.3.  Output Results  . . . . . . . . . . . . . . . . . . .  16
     4.3.  ECDSA Signature . . . . . . . . . . . . . . . . . . . . .  17
       4.3.1.  Input Factors . . . . . . . . . . . . . . . . . . . .  17
       4.3.2.  Signing Operation . . . . . . . . . . . . . . . . . .  18
       4.3.3.  Output Results  . . . . . . . . . . . . . . . . . . .  18
     4.4.  HMAC-SHA2 Integrity Protection  . . . . . . . . . . . . .  19
       4.4.1.  Input Factors . . . . . . . . . . . . . . . . . . . .  20
       4.4.2.  Signing Operation . . . . . . . . . . . . . . . . . .  20
       4.4.3.  Output Results  . . . . . . . . . . . . . . . . . . .  21
     4.5.  Detached Signature  . . . . . . . . . . . . . . . . . . .  22
       4.5.1.  Input Factors . . . . . . . . . . . . . . . . . . . .  22
       4.5.2.  Signing Operation . . . . . . . . . . . . . . . . . .  22
       4.5.3.  Output Results  . . . . . . . . . . . . . . . . . . .  23
     4.6.  Protecting Specific Header Fields . . . . . . . . . . . .  24
       4.6.1.  Input Factors . . . . . . . . . . . . . . . . . . . .  24
       4.6.2.  Signing Operation . . . . . . . . . . . . . . . . . .  25
       4.6.3.  Output Results  . . . . . . . . . . . . . . . . . . .  26
     4.7.  Protecting Content Only . . . . . . . . . . . . . . . . .  26
       4.7.1.  Input Factors . . . . . . . . . . . . . . . . . . . .  27
Show full document text