KEYPROV Working Group                                         A. Doherty
Internet-Draft                         RSA, The Security Division of EMC
Intended status: Standards Track                                  M. Pei
Expires: May 1, July 28, 2008                                    Verisign, Inc.
                                                              S. Machani
                                                        Diversinet Corp.
                                                              M. Nystrom
                                       RSA, The Security Division of EMC
                                                        October 29, 2007
                                                        January 25, 2008

          Dynamic Symmetric Key Provisioning Protocol (DSKPP)
                    draft-ietf-keyprov-dskpp-01.txt
                    draft-ietf-keyprov-dskpp-02.txt

Status of this Memo

   By submitting this Internet-Draft, each author represents that any
   applicable patent or other IPR claims of which he or she is aware
   have been or will be disclosed, and any of which he or she becomes
   aware will be disclosed, in accordance with Section 6 of BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups.  Note that
   other groups may also distribute working documents as Internet-
   Drafts.

   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."

   The list of current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt.

   The list of Internet-Draft Shadow Directories can be accessed at
   http://www.ietf.org/shadow.html.

   This Internet-Draft will expire on May 1, July 28, 2008.

Copyright Notice

   Copyright (C) The IETF Trust (2007). (2008).

Abstract

   DSKPP is a client-server protocol for initialization (and
   configuration) of symmetric keys to locally and remotely accessible
   cryptographic modules.  The protocol can be run with or without
   private-key capabilities in the cryptographic modules, and with or
   without an established public-key infrastructure.

   Three

   Two variations of the protocol support multiple usage scenarios.  The
   four-pass (i.e., two round-trip) variant enables key generation in
   near real-time.  With the four-pass variant, keys are mutually
   generated by the provisioning server and cryptographic module;
   provisioned keys are not transferred over-the-wire or over-the-air.
   Two- and one-pass variants enable
   The two-pass variant enables secure and efficient download and
   installation of symmetric keys to a cryptographic module in
   environments where near real-time communication may not be possible.

   This document builds on information contained in [RFC4758], adding
   specific enhancements in response to implementation experience and
   liaison requests.  It is intended, therefore, intended that this document or a successor
   version thereto will become the basis for subsequent progression of a
   symmetric key provisioning protocol specification on the standards
   track.

Table of Contents

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . .   7
     1.1.  Scope . .  6
     1.1.  Usage Scenarios  . . . . . . . . . . . . . . . . . . . . .  7
       1.1.1.  Single Key Request . . .   7
     1.2.  Background . . . . . . . . . . . . . . .  7
       1.1.2.  Multiple Key Requests  . . . . . . . .   7
   2.  Requirements Notation and Terminology . . . . . . . .  7
       1.1.3.  Session Time-Out Policy  . . . .   8
   3.  Use Cases . . . . . . . . . . .  7
       1.1.4.  Outsourced Provisioning  . . . . . . . . . . . . . . .  11
     3.1.  Single  8
       1.1.5.  Key Request Renewal  . . . . . . . . . . . . . . . . . . .  11
     3.2.  Multiple Key Requests . .  8
       1.1.6.  Pre-Loaded Key Replacement . . . . . . . . . . . . . .  8
       1.1.7.  Pre-Shared Transport Key . .  11
     3.3.  Session Time-Out Policy . . . . . . . . . . . . .  8
       1.1.8.  End-to-End Protection of Key Material  . . . .  11
     3.4.  Outsourced Provisioning . . . .  9
     1.2.  Protocol Entities  . . . . . . . . . . . . .  12
     3.5.  Key Renewal . . . . . . .  9
     1.3.  Initiating DSKPP . . . . . . . . . . . . . . . .  12
     3.6.  Pre-Loaded Key Replacement . . . . . 10
     1.4.  Determining Which Protocol Variant to Use  . . . . . . . . 11
       1.4.1.  Criteria for Using the Four-Pass Protocol  . .  12
     3.7.  Pre-Shared Transport Key . . . . 11
       1.4.2.  Criteria for Using the Two-Pass Protocol . . . . . . . 12
   2.  Terminology  . . . . .  12
     3.8.  SMS-Based Key Transport . . . . . . . . . . . . . . . . .  13
     3.9.  Non-Protected Transport Layer . . . 12
     2.1.  Key Words  . . . . . . . . . . .  13
     3.10. Non-Authenticated Transport Layer . . . . . . . . . . . .  13
   4.  DSKPP Overview . 12
     2.2.  Definitions  . . . . . . . . . . . . . . . . . . . . . .  13
     4.1.  Entities . 12
     2.3.  Notation . . . . . . . . . . . . . . . . . . . . . . .  13
     4.2.  Overview of Protocol Usage . . 14
     2.4.  Abbreviations  . . . . . . . . . . . . .  15
     4.3.  Four-Pass Protocol Usage . . . . . . . . . 15
   3.  DSKPP Protocol Details . . . . . . .  18
       4.3.1.  Message Flow . . . . . . . . . . . . . 15
     3.1.  Four-Pass Protocol Usage . . . . . . .  19
       4.3.2.  Generation of Symmetric Keys for Cryptographic
               Modules . . . . . . . . . . 17
       3.1.1.  Message Flow . . . . . . . . . . . . .  20
       4.3.3.  Client Authentication . . . . . . . . 17
       3.1.2.  Generation of Symmetric Keys for Cryptographic
               Modules  . . . . . . . .  23
       4.3.4.  Key Confirmation . . . . . . . . . . . . . . . 20
       3.1.3.  MAC Calculations . . .  23
       4.3.5.  Server Authentication . . . . . . . . . . . . . . . .  23
     4.4. 22
     3.2.  Two-Pass Protocol Usage  . . . . . . . . . . . . . . . . .  24
       4.4.1. 23
       3.2.1.  Message Flow . . . . . . . . . . . . . . . . . . . .  26
       4.4.2.  Key Confirmation  . . . . . . . . . . . . . . . . . .  27
       4.4.3.  Server Authentication 24
       3.2.2.  Key Protection Profiles  . . . . . . . . . . . . . . . 26
       3.2.3.  MAC Calculations .  27
     4.5.  One-Pass Protocol Usage . . . . . . . . . . . . . . . . .  28
       4.5.1.  Message Flow . 30
     3.3.  User Authentication  . . . . . . . . . . . . . . . . . . .  29
       4.5.2.  Key Confirmation 31
       3.3.1.  Device Identifier  . . . . . . . . . . . . . . . . . .  30
       4.5.3.  Server 32
       3.3.2.  Authentication Data  . . . . . . . . . . . . . . . .  30
   5.  Methods Common to More Than One Protocol Variant  . . . . . .  31
     5.1. 32
     3.4.  The DSKPP One-Way Pseudorandom Function, DSKPP-PRF . . .  31
       5.1.1. . 34
       3.4.1.  Introduction . . . . . . . . . . . . . . . . . . . .  31
       5.1.2. . 34
       3.4.2.  Declaration  . . . . . . . . . . . . . . . . . . . . .  32
     5.2. 35
     3.5.  Encryption of Pseudorandom Nonces Sent from the DSKPP
           Client (Applicable to Four-Pass and Two-Pass DSKPP) . . .  32
     5.3.  Client Authentication Mechanisms (Applicable to Four-
           and Two-Pass DSKPP) . . . . . . . . . . . . . . . . . . .  32
       5.3.1.  Device Certificate . . . . 35
   4.  DSKPP Message Formats  . . . . . . . . . . . . .  33
       5.3.2.  Device Identifier . . . . . . . 36
     4.1.  General XML Schema Requirements  . . . . . . . . . . .  33
       5.3.3.  Authentication Code . . 36
     4.2.  Components of the <KeyProvTrigger> Message . . . . . . . . 36
     4.3.  Components of the <KeyProvClientHello> Request . . . . . . 37
       4.3.1.  The DeviceIdentifierDataType Type  .  33
     5.4.  Client Authentication Examples . . . . . . . . . 40
       4.3.2.  The ProtocolVariantsType Type  . . . .  36
       5.4.1.  Example Using a MAC from an Authentication Code . . .  36
       5.4.2.  Example Using a Device Certificate . . . . . 40
       4.3.3.  The KeyContainersFormatType Type . . . .  36
   6.  Four-Pass Protocol . . . . . . . 41
       4.3.4.  The AuthenticationDataType Type  . . . . . . . . . . . 42
     4.4.  Components of the <KeyProvServerHello> Response (Used
           Only in Four-Pass DSKPP) . . .  36
     6.1.  XML Basics . . . . . . . . . . . . . . 44
     4.5.  Components of a <KeyProvClientNonce> Request (Used
           Only in Four-Pass DSKPP) . . . . . . . . .  36
     6.2.  Round-Trip #1:  <KeyProvClientHello> and
           <KeyProvServerHello> . . . . . . . . 45
     4.6.  Components of a <KeyProvServerFinished> Response . . . . . 46
     4.7.  The StatusCode Type  . . . . .  37
       6.2.1.  Examples . . . . . . . . . . . . . . 48
   5.  Extensibility  . . . . . . . .  37
       6.2.2.  Components of the <KeyProvClientHello> Request . . .  41
       6.2.3.  Components of the <KeyProvServerHello> Response . . .  45
     6.3.  Round-Trip #2: <KeyProvClientNonce> and
           <KeyProvServerFinished> . . . . . . . . . . 50
     5.1.  The ClientInfoType Type  . . . . . . .  46
       6.3.1.  Examples . . . . . . . . . . 50
     5.2.  The ServerInfoType Type  . . . . . . . . . . . .  46
       6.3.2.  Components of a <KeyProvClientNonce> Request . . . .  47
       6.3.3.  Components of a <KeyProvServerFinished> Response . 50
   6.  Protocol Bindings  .  48
     6.4.  DSKPP Server Results:  The StatusCode Type . . . . . . .  49
   7.  Two-Pass Protocol . . . . . . . . . . . . . . 50
     6.1.  General Requirements . . . . . . . .  50
     7.1.  XML Basics . . . . . . . . . . . 50
     6.2.  HTTP/1.1 Binding for DSKPP . . . . . . . . . . . .  50
     7.2.  Round-Trip #1:  <KeyProvClientHello> and
           <KeyProvServerFinished> . . . . 50
       6.2.1.  Introduction . . . . . . . . . . . . .  51
       7.2.1.  Examples . . . . . . . . 50
       6.2.2.  Identification of DSKPP Messages . . . . . . . . . . . 50
       6.2.3.  HTTP Headers . . .  51
       7.2.2.  Components of the <KeyProvClientHello> Request . . .  59
       7.2.3.  Components of a <KeyProvServerFinished> Response . .  60
     7.3.  DSKPP Server Results:  The StatusCode Type . . . . . . .  62
   8.  One-Pass Protocol . . . . . . 51
       6.2.4.  HTTP Operations  . . . . . . . . . . . . . . . .  63
     8.1.  XML Basics . . . 51
       6.2.5.  HTTP Status Codes  . . . . . . . . . . . . . . . . . . 51
       6.2.6.  HTTP Authentication  . .  63
     8.2.  Server to Client Only: <KeyProvServerFinished> . . . . .  64
       8.2.1.  Example . . . . . . . . . . 52
       6.2.7.  Initialization of DSKPP  . . . . . . . . . . . . .  64
       8.2.2.  Components of a <KeyProvServerFinished> Response . .  65
   9.  Trigger 52
       6.2.8.  Example Messages . . . . . . . . . . . . . . . . . . . 52
   7.  DSKPP Schema . . . . . . . .  66
     9.1.  XML Basics . . . . . . . . . . . . . . . . . 53
   8.  Conformance Requirements . . . . . .  66
     9.2.  Example . . . . . . . . . . . . . 61
   9.  Security Considerations  . . . . . . . . . . . .  67
     9.3.  Components of the <KeyProvTrigger> Message . . . . . . .  67
   10. Extensibility 62
     9.1.  General  . . . . . . . . . . . . . . . . . . . . . . . .  68
     10.1. The ClientInfoType Type . 62
     9.2.  Active Attacks . . . . . . . . . . . . . . . .  68
     10.2. The ServerInfoType Type . . . . . . 62
       9.2.1.  Introduction . . . . . . . . . . .  68
     10.3. The KeyInitializationDataType Type . . . . . . . . . . 62
       9.2.2.  Message Modifications  .  68
   11. Key Initialization Profiles of Two- and One-Pass DSKPP . . .  69
     11.1. Introduction . . . . . . . . . . . . 62
       9.2.3.  Message Deletion . . . . . . . . . .  69
     11.2. Key Transport Profile . . . . . . . . . 64
       9.2.4.  Message Insertion  . . . . . . . . .  69
       11.2.1. Introduction . . . . . . . . . 64
       9.2.5.  Message Replay . . . . . . . . . . .  69
       11.2.2. Identification . . . . . . . . . 65
       9.2.6.  Message Reordering . . . . . . . . . .  69
       11.2.3. Payloads . . . . . . . . 65
       9.2.7.  Man-in-the-Middle  . . . . . . . . . . . . . .  69
     11.3. Key Wrap Profile . . . . 65
     9.3.  Passive Attacks  . . . . . . . . . . . . . . . .  70
       11.3.1. Introduction . . . . . 65
     9.4.  Cryptographic Attacks  . . . . . . . . . . . . . . .  70
       11.3.2. Identification . . . 66
     9.5.  Attacks on the Interaction between DSKPP and User
           Authentication . . . . . . . . . . . . . . . .  71
       11.3.3. Payloads . . . . . . 66
     9.6.  Additional Considerations  . . . . . . . . . . . . . . . .  71
     11.4. Passphrase-Based Key Wrap Profile 67
       9.6.1.  Client Contributions to K_TOKEN Entropy  . . . . . . . 67
       9.6.2.  Key Confirmation . . . . .  72
       11.4.1. Introduction . . . . . . . . . . . . . . 67
       9.6.3.  Server Authentication  . . . . . .  72
       11.4.2. Identification . . . . . . . . . . 67
       9.6.4.  User Authentication  . . . . . . . . .  72
       11.4.3. Payloads . . . . . . . . 67
       9.6.5.  Key Protection in the Two-Pass Passphrase Profile  . . 68
   10. Internationalization Considerations  . . . . . . . . . . . .  72
   12. Protocol Bindings . 69
   11. IANA Considerations  . . . . . . . . . . . . . . . . . . . . .  73
     12.1. General Requirements 69
   12. Intellectual Property Considerations . . . . . . . . . . . . . 69
   13. Contributors . . . . .  74
     12.2. HTTP/1.1 Binding for DSKPP . . . . . . . . . . . . . . .  74
       12.2.1. Introduction . . . . . 69
   14. Acknowledgements . . . . . . . . . . . . . . .  74
       12.2.2. Identification of DSKPP Messages . . . . . . . . 69
   15. References . .  74
       12.2.3. HTTP Headers . . . . . . . . . . . . . . . . . . . .  74
       12.2.4. HTTP Operations . . . . 70
     15.1. Normative references . . . . . . . . . . . . . . .  74
       12.2.5. HTTP Status Codes . . . . 70
     15.2. Informative references . . . . . . . . . . . . . .  75
       12.2.6. HTTP Authentication . . . . 71
   Appendix A.  Examples  . . . . . . . . . . . . .  75
       12.2.7. Initialization of DSKPP . . . . . . . . . 72
     A.1.  Trigger Message  . . . . . .  75
       12.2.8. Example Messages . . . . . . . . . . . . . . . 73
     A.2.  Four-Pass Protocol . . .  75
   13. DSKPP Schema . . . . . . . . . . . . . . . . . 73
       A.2.1.  <KeyProvClientHello> Without a Preceding Trigger . . . 73
       A.2.2.  <KeyProvClientHello> Assuming a Preceding Trigger  . . . .  76
   14. Security Considerations . . . . . . . . . . . . . . . . . . .  85
     14.1. General . . . . . . . . . . . . . . . . 74
       A.2.3.  <KeyProvServerHello> Without a Preceding Trigger . . . 75
       A.2.4.  <KeyProvServerHello> Assuming a Preceding Trigger  . . 76
       A.2.5.  <KeyProvClientNonce> Using Default Encryption  . . . .  85
     14.2. Active Attacks 77
       A.2.6.  <KeyProvServerFinished> Using Default Encryption . . . 78
     A.3.  Two-Pass Protocol  . . . . . . . . . . . . . . . . . .  85
       14.2.1. Introduction . . 79
       A.3.1.  Example Using the Key Transport Profile  . . . . . . . 79
       A.3.2.  Example Using the Key Wrap Profile . . . . . . . . . . 82
       A.3.3.  Example Using the Passphrase-Based Key Wrap Profile  . 85
       14.2.2. Message Modifications . . . . .
   Appendix B.  Integration with PKCS #11 . . . . . . . . . . .  85
       14.2.3. Message Deletion . . . 88
     B.1.  The 4-pass Variant . . . . . . . . . . . . . . .  87
       14.2.4. Message Insertion . . . . . 88
     B.2.  The 2-pass Variant . . . . . . . . . . . . .  87
       14.2.5. Message Replay . . . . . . . 88
   Appendix C.  Example of DSKPP-PRF Realizations . . . . . . . . . . 91
     C.1.  Introduction . .  87
       14.2.6. Message Reordering . . . . . . . . . . . . . . . . .  88
       14.2.7. Man-in-the-Middle . . . . 91
     C.2.  DSKPP-PRF-AES  . . . . . . . . . . . . . .  88
     14.3. Passive Attacks . . . . . . . . 91
       C.2.1.  Identification . . . . . . . . . . . . .  88
     14.4. Cryptographic Attacks . . . . . . . 91
       C.2.2.  Definition . . . . . . . . . . .  88
     14.5. Attacks on the Interaction between DSKPP and User
           Authentication . . . . . . . . . . . 91
       C.2.3.  Example  . . . . . . . . . .  89
     14.6. Additional Considerations Specific to 2- and 1-pass
           DSKPP . . . . . . . . . . . . . 92
     C.3.  DSKPP-PRF-SHA256 . . . . . . . . . . . . .  89
       14.6.1. Client Contributions to K_TOKEN Entropy . . . . . . .  89
       14.6.2. Key Confirmation . 93
       C.3.1.  Identification . . . . . . . . . . . . . . . . .  90
       14.6.3. Server Authentication . . . 93
       C.3.2.  Definition . . . . . . . . . . . . .  90
       14.6.4. Client Authentication . . . . . . . . . 93
       C.3.3.  Example  . . . . . . .  90
       14.6.5. Key Protection in the Passphrase Profile . . . . . .  91
   15. Internationalization Considerations . . . . . . . . . . 94
   Authors' Addresses . . .  91
   16. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  92
   17. 94
   Intellectual Property Considerations  . . . . . . . . . . . .  92
   18. Contributors  . . . . . . . . . . . . . . . . . . . . . . . .  92
   19. Acknowledgements  . . . . . . . . . . . . . . . . . . and Copyright Statements . . . .  92
   20. References . . . . . . . . . . . . . . . . . . . . . . . . .  93
     20.1. Normative references  . . . . . . . . . . . . . . . . . .  93
     20.2. Informative references  . . . . . . . . . . . . . . . . .  94
   Appendix A.  Integration with PKCS #11  . . . . . . . . . . . . .  95
     A.1.  The 4-pass Variant  . . . . . . . . . . . . . . . . . . .  96
     A.2.  The 2-pass Variant  . . . . . . . . . . . . . . . . . . .  96
     A.3.  The 1-pass Variant  . . . . . . . . . . . . . . . . . . .  98
   Appendix B.  Example of DSKPP-PRF Realizations  . . . . . . . . . 100
     B.1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . 101
     B.2.  DSKPP-PRF-AES . . . . . . . . . . . . . . . . . . . . . . 101
       B.2.1.  Identification  . . . . . . . . . . . . . . . . . . . 101
       B.2.2.  Definition  . . . . . . . . . . . . . . . . . . . . . 101
       B.2.3.  Example . . . . . . . . . . . . . . . . . . . . . . . 102
     B.3.  DSKPP-PRF-SHA256  . . . . . . . . . . . . . . . . . . . . 102
       B.3.1.  Identification  . . . . . . . . . . . . . . . . . . . 102
       B.3.2.  Definition  . . . . . . . . . . . . . . . . . . . . . 103
       B.3.3.  Example . . . . . . . . . . . . . . . . . . . . . . . 104
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . . 104
   Intellectual Property and Copyright Statements  . . . . . . . . . 106

1.  Introduction

1.1.  Scope

   This document describes a client-server protocol for initialization
   (and configuration) of symmetric keys to locally and remotely
   accessible cryptographic modules.  The protocol can be run with or
   without private-key capabilities in the cryptographic modules, and
   with or without an established public-key infrastructure.  The
   objectives of this protocol are to:

   o     Provide a secure method of initializing cryptographic modules
         with symmetric keys without exposing generated, secret material
         to any other entities than the server and the cryptographic
         module itself.
   o     Provide a secure method of generating and transporting
         symmetric keys to a cryptographic module in environments where
         near real-time communication is not possible.
   o     Provide a secure method of transporting pre-generated (i.e.,
         legacy) keys to a cryptographic module.
   o     Provide a solution that is easy to administer and scales well.

   The mechanism is intended for general use within computer and
   communications systems employing symmetric key cryptographic modules
   that are locally (i.e., over-the-wire) or remotely (i.e., over-the-
   air) accessible.

1.2.  Background

   A locally accessible symmetric key cryptographic module may be hosted
   by, for example, a hardware device connected to a personal computer
   through an electronic interface, such as USB, or a software
   application resident on a personal computer.  A remotely accessible
   symmetric key cryptographic module may be hosted by, for example, any
   device that can support over-the-air communication, such as a hand-
   held hardware device (e.g., a mobile phone).  The cryptographic
   module itself offers symmetric key cryptographic functionality that
   may be used to authenticate a user towards some service, perform data
   encryption, etc.  Increasingly, these modules enable their
   programmatic initialization as well as programmatic retrieval of
   their output values.  This document intends to meet the need for an
   open and inter-operable mechanism to programmatically initialize and
   configure symmetric keys to locally and remotely accessible
   cryptographic modules.

   The target mechanism makes use of a symmetric key provisioning
   server.  In an ideal deployment scenario, near real-time
   communication is possible between the provisioning server and the
   cryptographic module.  In such an environment, it is possible for the
   cryptographic module and provisioning server to mutually generate a
   symmetric key, and to ensure that keys are not transported between
   them.

   There are, however, several deployment scenarios that make mutual key
   generation less suitable.  Specifically, scenarios where near real-
   time communication between the symmetric key provisioning server and
   the cryptographic module is not possible, and scenarios with
   significant design constraints.  Examples include work-flow
   constraints (e.g., policies that require incremental administrative
   approval), network design constraints that create network latency,
   and budget constraints that sustain reliance upon legacy systems that
   already have supplies of pre-generated keys.  In these situations,
   the cryptographic module is required to download and install a
   symmetric key from the provisioning server in a secure and efficient
   manner.

   This document tries to meet the needs of these scenarios by
   describing three variations to DSKPP for the provisioning of
   symmetric keys in two round trips or less.  The four-pass (i.e., two
   round-trip) variant enables key generation in near real-time.  With
   this variant, keys are mutually generated by the provisioning server
   and cryptographic module; provisioned keys are not transferred over-
   the-wire or over-the-air.  In contrast, two- and one-pass variants
   enable secure and efficient download and installation of symmetric
   keys to a cryptographic module in environments where near real-time
   communication is not possible.

2.  Requirements Notation and Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in [RFC2119].

   The following notations are used in this document:

   ||              String concatenation

   [x]             Optional element x

   A ^ B           Exclusive-OR operation on strings A and B (where A
                   and B are of equal length)
   ENC_X(Y)        Encryption of message Y with symmetric key X, using a
                   defined block cipher

   ENC_PX(Y)       Encryption using message Y with a public key X

   KDF_X(Y)        Key derivation function that generates an arbitrary
                   number of octets of output using secret X and seed Y

   DSKPP-PRF_X(Y,Z)  Pseudo random function that generates a fixed
                   number Z of octets using secret X and seed Y (used in
                   DSKPP methods for MAC computations and key
                   derivation)

   MAC_X(Y)        Keyed message authentication code computed over Y
                   with symmetric key X

   SIGN_x(Y)       Function that provides authentication and integrity
                   protection of message content Y using private key x

   B64(X)          Base 64 encoding of string X

   H(X)            Hash function applied to X

   Alg_List        List of encryption and MAC algorithms supported by
                   the client

   Alg_Sel         Algorithms list selected by the server for the DSKPP
                   protocol run

   DSKPP client    Manages communication between the symmetric key
                   cryptographic module and the DSKPP server

   DSKPP server    The symmetric key provisioning server that
                   participates in the DSKPP protocol run

   Issuer          The organization that issues or authorizes issuance
                   of the symmetric key to the end user of the symmetric
                   key cryptographic module (e.g., a bank who issues
                   one-time password authentication tokens to their
                   retail banking users)
   ID_C            Identifier for DSKPP client

   ID_S            Identifier for DSKPP server
   AUTHCODE        Client Authentication Code comprised of a string of
                   numeric characters known to the device and the server
                   and containing an identifier and a password (the
                   AUTHCODE may be used to derive the AUTHDATA during
                   the DSKPP protocol exchange)

   AUTHDATA        Client Authentication Data that may be derived from
                   the AUTHCODE or using the client private key,
                   k_CLIENT

   K               Key used to encrypt R_C (either K_SERVER or K_SHARED)

   K_AUTHCODE      Secret key that is derived from AUTHCODE and used for
                   client authentication purposes

   k_CLIENT        Private key of the DSKPP client

   K_CLIENT        Public key of the DSKPP client

   K_DERIVED       Secret key derived from a passphrase that is known to
                   both the DSKPP client or user and the DSKPP server

   K_MAC           Secret key used for key confirmation and server
                   authentication purposes, and generated in DSKPP

   K_MAC'          A second secret key used for server authentication
                   purposes in 2- and 1-pass DSKPP

   K_SERVER        Public key of the DSKPP server

   K_SHARED        Secret key shared between the DSKPP client and the
                   DSKPP server

   K_TOKEN         Secret key used for cryptographic module
                   computations, and generated in DSKPP

   K_CONFDATA      Key configuration data carried within the key
                   container

   R               Pseudorandom value chosen by the DSKPP client and
                   used for MAC computations, which is mandatory for
                   2-pass DSKPP and optional for 4-pass

   R_C             Pseudorandom value chosen by the DSKPP client and
                   used as input to the generation of K_TOKEN
   R_S             Pseudorandom value chosen by the DSKPP server and
                   used as input to the generation of K_TOKEN

   URL_S           Server address as a URL

   I               Unsigned integer representing a counter value that is
                   monotonically increasing and guaranteed not to be
                   used again by the server towards the cryptographic
                   module

   I'              Similar to I except I' is always higher than I

   The following typographical convention is used in the body of the
   text: <XMLElement>.

3.  Use Cases

   This section describes typical use cases.

3.1.  Single Key Request

   A cryptographic module hosted by a device, such as a mobile phone,
   makes a request for a symmetric key from a provisioning server.
   Depending upon how the system is deployed, the provisioning server
   may generate a new key on-the-fly or use a pre-generated key, e.g.,
   one provided by a legacy back-end issuance server.  The provisioning
   server assigns a unique key ID to the symmetric key and provisions it
   to the cryptographic module.

3.2.  Multiple Key Requests

   A cryptographic module makes multiple requests for symmetric keys
   from the same provisioning server.  The symmetric keys may or may not
   be of the same type, i.e., the keys may be used with different
   symmetric key cryptographic algorithms, including one-time password
   authentication algorithms, and AES encryption algorithm.

3.3.  Session Time-Out Policy

   Once a cryptographic module initiates a symmetric key request, the
   provisioning server may require that any subsequent actions to
   complete the provisioning cycle occur within a certain time window.
   For example, an issuer may provide a time-limited authentication code
   to a user during registration, which the user will input into the
   cryptographic module to authenticate themselves with the provisioning
   server.  If the user inputs a valid authentication code within the
   fixed time period established by the issuer, the server will allow a
   key to be provisioned to the cryptographic module hosted by the
   user's device.

3.4.  Outsourced Provisioning

   A symmetric key issuer outsources its key provisioning to a third
   party key provisioning server provider.  The issuer is responsible
   for authenticating and granting rights to users to acquire keys while
   acting as a proxy to the cryptographic module to acquire symmetric
   keys from the provisioning server; the cryptographic module
   communicates with the issuer proxy server, which forwards
   provisioning requests to the provisioning server.

3.5.  Key Renewal

   A cryptographic module requests renewal of a symmetric key using the
   same key ID already associated with the key.  Such a need may occur
   in the case when a user wants to upgrade her device that houses the
   cryptographic module or when a key has expired.  When a user uses the
   same cryptographic module to, for example, perform strong
   authentication at multiple Web login sites, keeping the same key ID
   removes the need for the user to register a new key ID at each site.

3.6.  Pre-Loaded Key Replacement

   This use case represents a special case of symmetric key renewal in
   which a local administrator can authenticate the user procedurally
   before initiating the provisioning process.  It also allows for an
   issuer to pre-load a key onto a cryptographic module with a
   restriction that the key is replaced with a new key prior to use of
   the cryptographic module.  Another variation of this use case is the
   issuer who recycles devices.  In this case, an issuer would provision
   a new symmetric key to a cryptographic module hosted on a device that
   was previously owned by another user.

   Note that this use case is essentially the same as the last use case
   wherein the same key ID is used for renewal.

3.7.  Pre-Shared Transport Key

   A cryptographic module is loaded onto a smart card after the card is
   issued to a user.  The symmetric key for the cryptographic module
   will then be provisioned using a secure channel mechanism present in
   many smart card platforms.  This allows a direct secure channel to be
   established between the smart card chip and the provisioning server.
   For example, the card commands (i.e., Application Protocol Data
   Units, or APDUs) are encrypted with a pre-shared transport key and
   sent directly to the smart card chip, allowing secure post-issuance
   in-the-field provisioning.  This secure flow can pass Transport Layer
   Security (TLS) and other transport security boundaries.

   Note that two pre-conditions for this use case are for the protocol
   to be tunneled and the provisioning server to know the correct pre-
   established transport key.

3.8.  SMS-Based Key Transport

   A mobile device supports Short Message Service (SMS) but is not able
   to support a data service allowing for HTTP or HTTPS transports.  In
   addition, an application may use a cryptographic module to enforce an
   acceptable level of protection for download of the symmetric key via
   SMS.  In such a case, the cryptographic module hosted by the mobile
   device may initiate a symmetric key request from a desktop computer
   and ask the server to send the key to the mobile device through SMS.
   User authentication is carried out via the online communication
   established between the desktop computer and the provisioning server.

3.9.  Non-Protected Transport Layer

   Some devices are not able to support a secure transport channel such
   as SSL or TLS to provide data confidentiality.  A cryptographic
   module hosted by such a device requests a symmetric key from the
   provisioning server.  It is up to DSKPP to ensure data
   confidentiality over non-secure networks.

3.10.  Non-Authenticated Transport Layer

   Some devices are not able to use a transport protocol that provides
   server authentication such as SSL or TLS.  A cryptographic module
   hosted by such a device wants to be sure that it sends a request for
   a symmetric key to a legitimate provisioning server.  It is up to
   DSKPP to provide proper client and server authentication.

4.  DSKPP Overview

4.1.  Entities

   In principle, the protocol involves a DSKPP client and a DSKPP
   server.  The DSKPP client manages communication between the
   cryptographic module and the provisioning server.  The DSKPP server
   herein represents the provisioning server.

   A high-level object model that describes the client-side entities and
   how they relate to each other is shown in Figure 1.

   -----------          -------------
   | User    |          | Device    |
   |---------|*  owns  *|-----------|
   | UserID  |--------->| DeviceID  |
   | ...     |          | ...       |
   -----------          -------------
                            | 1
                            |
                            | contains
                            |
                            | *
                            V
                      -----------------------
                      |Cryptographic Module |
                      |---------------------|
                      |CryptoModuleID
                      |Encryption Algorithms|
                      |MAC Algorithms       |
                      |...                  |
                      -----------------------
                            | 1
                            |
                            | contains
                            |
                            | *
                            V
                      -----------------------
                      |Key Container        |
                      |---------------------|
                      |KeyID                |
                      |Key Type             |
                      |...                  |
                      -----------------------

                          Figure 1: Object Model

   Conceptually, each entity represents the following:

   User:                   The person or client to whom devices are
                           issued

   UserID:                 A unique identifier for the user or client

   Device:                 A physical piece of hardware or software
                           framework that hosts symmetric key
                           cryptographic modules
   DeviceID:               A unique identifier for the device

   Cryptographic Module:   A component of an application, which enables
                           symmetric key cryptographic functionality

   CryptoModuleID:         A unique identifier for an instance of the
                           cryptographic module

   Encryption Algorithms:  Encryption algorithms supported by the
                           cryptographic module

   MAC Algorithms:         MAC algorithms supported by the cryptographic
                           module

   Key Container:          An object that encapsulates a symmetric key
                           and its configuration data

   KeyID:                  A unique identifier for the symmetric key

   Key Type:               The type of symmetric key cryptographic
                           methods for which the key will be used (e.g.,
                           OATH HOTP or RSA SecurID authentication, AES
                           encryption, etc.)

   It is assumed that a device will host an application layered above
   the cryptographic module, and this application will manage
   communication between the DSKPP client and cryptographic module.  The
   manner in which the communicating application will transfer DSKPP
   protocol elements to and from the cryptographic module is transparent
   to the DSKPP server.  One method for this transfer is described in
   [CT-KIP-P11].

4.2.  Overview of Protocol Usage

   DSKPP enables symmetric key provisioning between a DSKPP server and
   DSKPP client.  The DSKPP protocol supports the following types of
   requests and responses:

      <KeyProvClientHello>

          With this request, a DSKPP client initiates contact with the
          DSKPP server, indicating what protocol versions and variants,
          key types, encryption and MAC algorithms that it supports.  In
          addition, the request may include client authentication data
          that the DSKPP server uses to verify proof-of-possession of
          the device.

      <KeyProvServerHello>
          Upon reception of a <KeyProvClientHello> request, the DSKPP
          server uses the <KeyProvServerHello> response to specify which
          protocol version and variant, key type, encryption algorithm,
          and MAC algorithm that will be used by the DSKPP server and
          DSKPP client during the protocol run.  The decision of which
          variant, key type, and cryptographic algorithms to pick is
          policy- and implementation-dependent and therefore outside the
          scope of this document.
          The <KeyProvServerHello> response includes the DSKPP server's
          random nonce, R_S. The response also consists of information
          about either a shared secret key, or its own public key, that
          the DSKPP client uses when sending its protected random nonce,
          R_C, in the <KeyProvClientNonce> request (see below).
          Optionally, the DSKPP server may provide a MAC that the DSKPP
          client may use for server authentication.

      <KeyProvClientNonce>

          With this request, a DSKPP client and DSKPP server securely
          exchange protected data, e.g., the protected random nonce R_C.
          In addition, the request may include client authentication
          data that the DSKPP server uses to verify proof-of-possession
          of the device.

      <KeyProvServerFinished>

          The <KeyProvServerFinished> response is a confirmation message
          that includes a key container that holds configuration data,
          and may also contain protected key material (this depends on
          the protocol variant, as discussed below).
          Optionally, the DSKPP server may provide a MAC that the DSKPP
          client may use for server authentication.

   To initiate a DSKPP session:
   1.  A user may use a browser to connect to a web server that is
       running on some host.  The user may then identify (and optionally
       authenticate) herself (through some means that essentially are
       out of scope for this document) and request a symmetric key.
   2.  A client application may request a symmetric key by invoking the
       DSKPP client.
   3.  A DSKPP server may send a trigger message to a client
       application, which would then invoke the DSKPP client.

   To contact the DSKPP server:

   1.  A user may indicate how the DSKPP client is to contact a certain
       DSKPP server during a browsing session.
   2.  A DSKPP client may be pre-configured to contact a certain DSKPP
       server.
   3.  A user may be informed out-of-band about the location of the
       DSKPP server.

   Once the location of the DSKPP server is known, the DSKPP client and
   the DSKPP server engage in a 4-pass, 2-pass, or 1-pass protocol.
   Depending upon the policy and implementation, a DSKPP server selects
   which variant of the protocol to use: 4-pass, 2-pass, or 1-pass.
   With the four-pass variant, keys are mutually generated by the DSKPP
   server and DSKPP client; provisioned keys are not transferred over-
   the-wire or over-the-air.  Two- and one-pass variants enable secure
   and efficient download and installation of symmetric keys to a DSKPP
   client in environments where near real-time communication may not be
   possible.Figure 2 shows which messages get exchanged during each type
   of protocol run (4-pass, 2-pass, or 1-pass).
   +---------------+                            +---------------+
   |               |                            |               |
   |  DSKPP client |                            |  DSKPP server |
   |               |                            |               |
   +---------------+                            +---------------+
           |                                            |
           |        [ <---- DSKPP trigger ----- ]       |
           |                                            |
           |        ------- Client Hello ------->       |
           |        (Applicable to 4- and 2-pass)       |
           |                                            |
           |        <------ Server Hello --------       |
           |         (Applicable to 4-pass only)        |
           |                                            |
           |        ------- Client Nonce ------->       |
           |         (Applicable to 4-pass only)        |
           |                                            |
           |        <----- Server Finished ------       |
           |      (Applicable to 4-, 2-, and 1-pass)    |
           |                                            |

      Figure 2: The DSKPP protocol (with OPTIONAL preceding trigger)

   The table below identifies which protocol variants may be applied to
   the use cases from Section 3:

   ----------------------------------------------------------
   Protocol   Applicable                Applicable
   Variant    Use Cases                 Deployment Scenarios
   ----------------------------------------------------------
   4-pass     All but 3.6 and           Near real-time
              3.8 if mutual key         communication is
              generation is desired;    possible
              none if transport of
              a pre-generated key

   2-pass     All                       Either near real-time
                                        or non real-time
                                        communication may be
                                        possible

   1-pass     All but 3.8               Either near real-time
                                        or non real-time
                                        communication may be
                                        possible

            Figure 3: Mapping of protocol variants to use cases

4.3.  Four-Pass Protocol Usage

   The 4-pass protocol flow is suitable for environments wherein there
   is near real-time communication possible between the DSKPP client and
   DSKPP server.  It is not suitable for environments wherein
   administrative approval is a required step in the flow, nor for
   provisioning of pre-generated keys.

   The full four-pass protocol exchange is as follows:

   [<Trigger>]:

      [ID_Device], [ID_K], [URL_S], [R_S]

   <KeyProvClientHello>:

      [ID_Device], [ID_K], [R_S], Alg_List

   <KeyProvServerHello>:

      R_S, Alg_Sel, [K_SERVER], [DSKPP-PRF_K_MAC'("MAC 1 Computation" ||
      [R] || R_S, len(R_S))

   <KeyProvClientNonce>:

      AUTHDATA, ENC_PK_SERVER(R_C) OR AUTHDATA, ENC_K_SHARED(R_C)

   <KeyProvServerFinished>:

      K_CONFDATA, DSKPP-PRF_K_MAC("MAC 2 Computation"||R_C, len(R_C))

   The following subsections describe the exchange in more detail.

4.3.1.  Message Flow

   The 4-pass protocol flow consists of two round trips between the
   DSKPP client and DSKPP server (see Figure 2), where each round-trip
   involves two "passes", i.e., one request message and one response
   message:

   Round-trip #1:  Pass 1 = <KeyProvClientHello>, Pass 2 =
                   <KeyProvServerHello>

   Round-trip #2:  Pass 3 = <KeyProvClientNonce>, Pass 4 =
                   <KeyProvServerFinished>

4.3.1.1.  Round-trip #1: <KeyProvClientHello> and <KeyProvServerHello>

   The DSKPP client sends a <KeyProvClientHello> message to the DSKPP
   server.  The message provides information to the DSKPP server about
   the DSKPP versions, protocol variants, key types, encryption and MAC
   algorithms supported by the cryptographic module for the purposes of
   this protocol.

   The DSKPP server responds to the DSKPP client with a
   <KeyProvServerHello> message, whose content includes a random nonce,
   R_S, along with information about the type of key to generate, and
   the encryption algorithm chosen to protect sensitive data sent in the
   protocol.  The length of the nonce R_S may depend on the selected key
   type.  The <KeyProvServerHello> message also provides information
   about either a shared secret key to use for encrypting the
   cryptographic module's random nonce (see description of
   <KeyProvClientNonce> below), or its own public key.  Optionally,
   <KeyProvServerHello> may include a MAC that the DSKPP client may use
   for server authentication during key replacement.

4.3.1.2.  Round-trip #2: <KeyProvClientNonce> and
          <KeyProvServerFinished>

   Based on information contained in the <KeyProvServerHello> message,
   the cryptographic module generates a random nonce, R_C. The length of
   the nonce R_C may depend on the selected key type.  The cryptographic
   module encrypts R_C using the selected encryption algorithm and with
   a key, K, that is either the DSKPP server's public key, K_SERVER, or
   a shared secret key, K_SHARED, as indicated by the DSKPP server.  If
   K is equivalent to K_SERVER, then the cryptographic module SHOULD
   verify the server's certificate before using it to encrypt R_C in
   accordance with [RFC3280].  The DSKPP client then sends the encrypted
   random nonce to the DSKPP server in a <KeyProvClientNonce> message,
   and may include client authentication data, such as a certificate or
   MAC derived from an authentication code and R_C. Finally, the
   cryptographic module calculates a symmetric key, K_TOKEN, of the
   selected type from the combination of the two random nonces R_S and
   R_C, the encryption key K, and possibly some other data, using the
   DSKPP-PRF function defined in Section 5.1.

   The DSKPP server decrypts R_C, calculates K_TOKEN from the
   combination of the two random nonces R_S and R_C, the encryption key
   K, and possibly some other data, using the DSKPP-PRF function defined
   in Section 5.1.  The server then associates K_TOKEN with the
   cryptographic module in a server-side data store.  The intent is that
   the data store later on will be used by some service that needs to
   verify or decrypt data produced by the cryptographic module and the
   key.

   Once the association has been made, the DSKPP server sends a
   confirmation message to the DSKPP client called
   <KeyProvServerFinished>.  Optionally, <KeyProvServerFinished> may
   include a MAC that the DSKPP client may use for server
   authentication.  The confirmation message includes a key container
   that holds an identifier for the generated key (but not the key
   itself) and additional configuration information, e.g., the identity
   of the DSKPP server.  The default symmetric key container format that
   is used in the <KeyProvServerFinished> message is based on the
   Portable Symmetric Key Container (PSKC) defined in [PSKC].
   Alternative formats MAY include PKCS#12 [PKCS-12] or PKCS#5 XML
   [PKCS-5-XML] format.

   Upon receipt of the DSKPP server's confirmation message, the
   cryptographic module associates the provided key container with the
   generated key K_TOKEN, and stores any provided configuration data.

4.3.2.  Generation of Symmetric Keys for Cryptographic Modules

   With 4-pass DSKPP, the symmetric key that is the target of
   provisioning, is generated on-the-fly without being transferred
   between the DSKPP client and DSKPP server.  A sample data flow
   depicting how this works followed by computational information are
   provided in the subsections below.

4.3.2.1.  Data Flow

   A sample data flow showing key generation during the 4-pass protocol
   is shown in Figure 4.
   +----------------------+    +-------+     +----------------------+
   |    +------------+    |    |       |     |                      |
   |    | Server key |    |    |       |     |                      |
   | +<-|  Public    |------>------------->-------------+---------+ |
   | |  |  Private   |    |    |       |     |          |         | |
   | |  +------------+    |    |       |     |          |         | |
   | |        |           |    |       |     |          |         | |
   | V        V           |    |       |     |          V         V |
   | |   +---------+      |    |       |     |        +---------+ | |
   | |   | Decrypt |<-------<-------------<-----------| Encrypt | | |
   | |   +---------+      |    |       |     |        +---------+ | |
   | |      |  +--------+ |    |       |     |            ^       | |
   | |      |  | Server | |    |       |     |            |       | |
   | |      |  | Random |--->------------->------+  +----------+  | |
   | |      |  +--------+ |    |       |     |   |  | Client   |  | |
   | |      |      |      |    |       |     |   |  | Random   |  | |
   | |      |      |      |    |       |     |   |  +----------+  | |
   | |      |      |      |    |       |     |   |        |       | |
   | |      V      V      |    |       |     |   V        V       | |
   | |   +------------+   |    |       |     | +------------+     | |
   | +-->|  DSKPP PRF |   |    |       |     | |  DSKPP PRF |<----+ |
   |     +------------+   |    |       |     | +------------+       |
   |           |          |    |       |     |       |              |
   |           V          |    |       |     |       V              |
   |       +-------+      |    |       |     |   +-------+          |
   |       |  Key  |      |    |       |     |   |  Key  |          |
   |       +-------+      |    |       |     |   +-------+          |
   |       +-------+      |    |       |     |   +-------+          |
   |       |Key Id |-------->------------->------|Key Id |          |
   |       +-------+      |    |       |     |   +-------+          |
   +----------------------+    +-------+     +----------------------+
         DSKPP Server         DSKPP Client         DSKPP Client
                               (PC Host)      (cryptographic module)

   Figure 4: Principal data flow for DSKPP key generation             -
                          using public server key

   Note: Conceptually, although R_C is one pseudorandom string, it may
   be viewed as consisting of two components, R_C1 and R_C2, where R_C1
   is generated during the protocol run, and R_C2 can be pre-generated
   and loaded on the cryptographic module before the device is issued to
   the user.  In that case, the latter string, R_C2, SHOULD be unique
   for each cryptographic module.

   The inclusion of the two random nonces R_S and R_C in the key
   generation provides assurance to both sides (the cryptographic module
   and the DSKPP server) that they have contributed to the key's
   randomness and that the key is unique.  The inclusion of the
   encryption key K ensures that no man-in-the-middle may be present, or
   else the cryptographic module will end up with a key different from
   the one stored by the legitimate DSKPP server.

   Note: A man-in-the-middle (in the form of corrupt client software or
   a mistakenly contacted server) may present his own public key to the
   cryptographic module.  This will enable the attacker to learn the
   client's version of K_TOKEN.  However, the attacker is not able to
   persuade the legitimate server to derive the same value for K_TOKEN,
   since K_TOKEN is a function of the public key involved, and the
   attacker's public key must be different than the correct server's (or
   else the attacker would not be able to decrypt the information
   received from the client).  Therefore, once the attacker is no longer
   "in the middle," the client and server will detect that they are "out
   of sync" when they try to use their keys.  In the case of encrypting
   R_C with K_SERVER, it is therefore important to verify that K_SERVER
   really is the legitimate server's key.  One way to do this is to
   independently validate a newly generated K_TOKEN against some
   validation service at the server (e.g. by using a connection
   independent from the one used for the key generation).

4.3.2.2.  Computing the Symmetric Key

   In DSKPP, keys are generated using the DSKPP-PRF function defined in
   Section 5.1, a secret random value R_C chosen by the DSKPP client, a
   random value R_S chosen by the DSKPP server, and the key k used to
   encrypt R_C. The input parameter s of DSKPP-PRF is set to the
   concatenation of the (ASCII) string "Key generation", k, and R_S, and
   the input parameter dsLen is set to the desired length of the key,
   K_TOKEN (the length of K_TOKEN is given by the key's type):

   dsLen = (desired length of K_TOKEN)

   K_TOKEN = DSKPP-PRF (R_C, "Key generation" || k || R_S, dsLen)

   When computing K_TOKEN above, the output of DSKPP-PRF MAY be subject
   to an algorithm-dependent transform before being adopted as a key of
   the selected type.  One example of this is the need for parity in DES
   keys.

4.3.3.  Client Authentication

   To ensure that a generated key K_TOKEN ends up associated with the
   correct cryptographic module and user, the DSKPP client using any of
   the methods described in Section 5.3.  Whatever the method, the DSKPP
   server MUST ensure that a generated key is associated with the
   correct cryptographic module, and if applicable, the correct user.

4.3.4.  Key Confirmation

   In four-pass DSKPP, the client includes a nonce R_C in the
   <KeyProvClientHello> message.  The MAC value in the
   <KeyProvServerFinished> message MUST be computed on the (ASCII)
   string "MAC 2 computation", the client nonce R_C using a MAC key
   K_MAC.  This key MUST be generated together with K_TOKEN using R_C
   and R_S.

   The MAC value in <KeyProvServerFinished> MAY be computed by using the
   DSKPP-PRF function of Section 5.1, in which case the input parameter
   s MUST consist of the concatenation of the (ASCII) string "MAC 2
   computation", R_C, the parameter dsLen MUST be set to the length of
   R_C:

   dsLen = len(R_C)

   MAC = DSKPP-PRF (K_MAC, "MAC 2 computation" || R_C, dsLen)

4.3.5.  Server Authentication

   A DSKPP server MUST authenticate itself to avoid a false "Commit" of
   a symmetric key that which could cause the cryptographic module to
   end up in an initialized state for which the server does not know the
   stored key.  To do this, the DSKPP server authenticates itself by
   including a MAC value in the <KeyProvServerHello> message when
   replacing a existing key.  The MAC value is generated using the
   existing the MAC key K_MAC' (the MAC key that existed before this
   protocol run).  The MAC algorithm MUST be the same as the algorithm
   used for key confirmation purposes.  In addition, a DSKPP server can
   leverage transport layer authentication if it is available.

   When the MAC value is used for server authentication, the value MAY
   be computed by using the DSKPP-PRF function of Section 5.1, in which
   case the input parameter s MUST be set to the concatenation of the
   (ASCII) string "MAC 1 computation", R (if sent by the client), and
   R_S, and k MUST be set to the existing MAC key K_MAC' .  The input
   parameter dsLen MUST be set to the length of R_S:

   dsLen = len(R_S)
   MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || [R ||] R_S, dsLen)

4.4.  Two-Pass Protocol Usage

   The 2-pass protocol flow is suitable for environments wherein near
   real-time communication between the DSKPP client and server may not
   be possible.  It is also suitable for environments wherein
   administrative approval is a required step in the flow, and for
   provisioning of pre-generated keys.  In the 2-pass protocol flow, the
   client's initial <KeyProvClientHello> message is directly followed by
   a <KeyProvServerFinished> message.  There is no exchange of the
   <KeyProvServerHello> message or the <KeyProvClientNonce> message.
   However, as the two-pass variant of DSKPP consists of one round trip
   to the server, the client is still able to include its random nonce,
   R_C, algorithm preferences and supported key types in the
   <KeyProvClientHello> message.  Note that by including R_C in
   <KeyProvClientHello>, the DSKPP client is able to ensure the server
   is alive before "committing" the key.  Also note that the DSKPP
   "trigger" message MAY be used to trigger the client's sending of the
   <KeyProvClientHello> message.

   Essentially, two-pass DSKPP is a transport of key material from the
   DSKPP server to the DSKPP client.  Two-pass DSKPP supports multiple
   key initialization methods that ensure K_TOKEN is not exposed to any
   other entity than the DSKPP server and the cryptographic module
   itself.  Currently, three such key initialization methods are defined
   (refer to Section 11), each supporting a different usage of 2-pass
   DSKPP:

   Key Transport               This profile is intended for PKI-capable
                               devices.  Key transport is carried out
                               using a public key, K_CLIENT, whose
                               private key part resides in the
                               cryptographic module as the transport
                               key.
   Key Wrap                    This profile is ideal for pre-keyed
                               devices, e.g., SIM cards.  Key wrap is
                               carried out using a symmetric key-
                               wrapping key, K_SHARED, which is known in
                               advance by both the cryptographic module
                               and the DSKPP server.
   Passphrase-Based Key Wrap   This profile is a variation of the Key
                               Wrap Profile.  It is applicable to
                               constrained devices with keypads, e.g.,
                               mobile phones.  Key wrap is carried out
                               using a passphrase-derived key-wrapping
                               key, K_DERIVED, which is known in advance
                               by both the cryptographic module and
                               DSKPP server.

   The full 2-pass protocol exchange when the key is transported using
   the client public key is as follows:

   [<Trigger>]:

      [ID_Device], [ID_K], [URL_S],[R_S]

   <KeyProvClientHello>:

      [ID_Device], ID_K, R_S, R_C, AUTHDATA, Alg_List

   <KeyProvServerFinished>:

      ENC_K_CLIENT ( K_TOKEN || K_MAC)), K_CONFDATA, ID_S, DSKPP-
      PRF_K_MAC("MAC 1 Computation" || ID_S || R_C, len(R_C) ), [ DSKPP-
      PRF_K_MAC'("MAC 1 Computation" || ID_S || R_C), 16]

   The full 2-pass protocol exchange when the key is wrapped using a
   shared key is as follows:

   [<Trigger>]:

      [ID_Device], [ID_K], [URL_S],[R_S]

   <KeyProvClientHello>:

      [ID_Device], ID_K, R_S, R_C, AUTHDATA, Alg_List

   <KeyProvServerFinished>:

      ENC_K_SHARED(K_TOKEN || K_MAC), K_CONFDATA, ID_S, DSKPP-
      PRF_K_MAC("MAC 1 Computation" || ID_S || R_C), [ DSKPP-
      PRF_K_MAC'("MAC 1 Computation "|| ID_S||R_C)]

   The full 2-pass protocol when the key is wrapped using a passphrase
   based derived key is as follows:

   [<Trigger>]:

      [ID_Device], [ID_K], [URL_S],[R_S]

   <KeyProvClientHello>:

      [ID_Device], ID_K, R_S, R_C, AUTHDATA, Alg_List

   <KeyProvServerFinished>:

      ENC_K_DERIVED(K_TOKEN || K_MAC), K_CONFDATA, ID_S, DSKPP-
      PRF_K_MAC("MAC 1 Computation" || ID_S || R_C), [ DSKPP-
      PRF_K_MAC'("MAC 1 Computation" || ID_S || R_C)]

   The following subsections describe these exchanges in more detail.

4.4.1.  Message Flow

   The 2-pass protocol flow consists of one round trip between the DSKPP
   client and DSKPP server, which consists of two "passes", i.e., one
   request message and one response message:

   Round-trip #1: Pass 1=<KeyProvClientHello>, Pass
   2=<KeyProvServerFinished>

   a.  The DSKPP client sends a <KeyProvClientHello> message to the
       DSKPP server.  The message provides the client nonce, R_C, and
       information about the DSKPP versions, protocol variants, key
       types, encryption and MAC algorithms supported by the
       cryptographic module for the purposes of this protocol.  The
       message may also include client authentication data, such as
       device certificate or MAC derived from authentication code and
       R_C. Authentication code is sent in clear only when underlying
       transport layer can ensure data confidentiality.  Unlike 4-pass
       DSKPP, 2-pass DSKPP client uses the <KeyProvClientHello> message
       to declare which key initialization method it supports, providing
       required payload information, e.g., K_CLIENT for the Key
       Transport Profile.
   b.  The DSKPP server generates a key K from which two keys, K_TOKEN
       and K_MAC are derived.  (Alternatively, the key K may have been
       pre-generated as described in Section 3.1.  K is either
       transported or wrapped in accordance with the key initialization
       method specified by the DSKPP client in the <KeyProvClientHello>
       message.  The server then associates K_TOKEN with the
       cryptographic module in a server-side data store.  The intent is
       that the data store later on will be used by some service that
       needs to verify or decrypt data produced by the cryptographic
       module and the key.
   c.  Once the association has been made, the DSKPP server sends a
       confirmation message to the DSKPP client called
       <KeyProvServerFinished>.  The confirmation message includes a key
       container that holds an identifier for the key, the key K from
       which K_TOKEN and K_MAC are derived, and additional configuration
       information (note that the latter MUST include the identity of
       the DSKPP server for authentication purposes).  In addition,
       <KeyProvServerFinished> MUST include two MACs whose values are
       calculated with contribution from the client nonce, R_C, provided
       in the <KeyProvClientHello> message.  The data will allow the
       cryptographic module to perform key confirmation and server
       authentication before "committing" the key.  Note that the second
       MAC value that is intended for key confirmation MAY only be used
       for replacing and existing key.
   d.  Upon receipt of the DSKPP server's confirmation message, the
       cryptographic module extracts the key data from the provided key
       container, uses the provided MAC values to perform key
       confirmation and server authentication, and stores the key
       material locally.

4.4.2.  Key Confirmation

   In two-pass DSKPP, the client is REQUIRED to include a nonce R in the
   <KeyProvClientHello> message.  Further, the server is REQUIRED to
   include an identifier, ID_S, for itself (via the key container) in
   the <KeyProvServerFinished> message.  The MAC value in the
   <KeyProvServerFinished> message MUST be computed on the (ASCII)
   string "MAC 1 computation", the server identifier ID_S, and R using a
   MAC key K_MAC.  This key MUST be provided together with K_TOKEN to
   the cryptographic module.

   If DSKPP-PRF is used as the MAC algorithm, then the input parameter s
   MUST consist of the concatenation of the (ASCII) string "MAC 1
   computation" and R, and the parameter dsLen MUST be set to the length
   of R:

   dsLen = len(R)

   MAC = DSKPP-PRF (K_MAC, "MAC 1 computation" || ID_S || R, dsLen)

4.4.3.  Server Authentication

   A server MUST authenticate itself when attempting to replace an
   existing K_TOKEN.  In 2-pass DSKPP, servers authenticate themselves
   by including a second MAC value in the AuthenticationDataType element
   of <KeyProvServerFinished>.  The MAC value in the
   AuthenticationDataType element MUST be computed on the (ASCII) string
   "MAC 1 computation", the server identifier ID_S, and R, using the
   existing MAC key K_MAC' (the MAC key that existed before this
   protocol run).  The MAC algorithm MUST be the same as the algorithm
   used for key confirmation purposes.

   If DSKPP-PRF is used as the MAC algorithm, then the input parameter s
   MUST consist of the concatenation of the (ASCII) string "MAC 1
   computation" ID_S, and R. The parameter dsLen MUST be set to at least
   16 (i.e. the length of the MAC MUST be at least 16 octets):

   dsLen >= 16

   MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || ID_S || R, dsLen)

4.5.  One-Pass Protocol Usage

   The one-pass protocol flow is suitable for environments wherein near
   real-time communication between the DSKPP client and server may not
   be possible.  It is also suitable for environments wherein
   administrative approval is a required step in the flow, and for
   provisioning of pre-generated keys.  In one-pass DSKPP, the server
   simply sends a <KeyProvServerFinished> message to the DSKPP client.
   In this case, there is no exchange of the <KeyProvClientHello>,
   <KeyProvServerHello>, and <KeyProvClientNonce> DSKPP messages, and
   hence there is no way for the client to express supported algorithms
   or key types.  Before attempting one-pass DSKPP, the server MUST
   therefore have prior knowledge not only that the client is able and
   willing to accept this variant of DSKPP, but also of algorithms and
   key types supported by the client.

   Essentially, one-pass DSKPP is a transport of key material from the
   DSKPP server to the DSKPP client.  As with two-pass DSKPP, the one-
   pass variant relies on key initialization methods that ensure K_TOKEN
   is not exposed to any other entity than the DSKPP server and the
   cryptographic module itself.  The same key initialization profiles
   are defined as described in Section 4.4 and Section 11.

   Outside the specific cases where one-pass DSKPP is desired, clients
   SHOULD be constructed and configured to only accept DSKPP server
   messages in response to client-initiated transactions.

   The 1-pass protocol when the key is transported using the client
   public Key is as follows:

   <KeyProvServerFinished>:

      ENC_K_CLIENT ( K_TOKEN || K_MAC)), K_CONFDATA, DSKPP-PRF_K_MAC
      ("MAC 1 Computation" || ID_S || I), [ DSKPP-PRF_K_MAC'("MAC 2
      Computation"||ID_S||I')]

   The 1-pass protocol when the key is wrapped using a shared key is as
   follows:

   <KeyProvServerFinished>:

      ENC_K_SHARED (K_TOKEN || K_MAC), K_CONFDATA, DSKPP-PRF_K_MAC("MAC
      1 Computation" || ID_S || I), [ PRF_K_MAC'("MAC 2 Computation" ||
      ID_S || I')]

   The 1-pass protocol when the key is wrapped using a passphrase
   derived key is as follows:

   <KeyProvServerFinished>:

      ENC_K_DERIVED(K_TOKEN || K_MAC), K_CONFDATA, DSKPP-PRF_K_MAC("MAC
      1 Computation" || ID_S || I), [DSKPP-PRF_K_MAC'("MAC 2
      Computation" || ID_S || I')]

   The subsections below describe the 1-pass protocol in more detail.

4.5.1.  Message Flow

   The 1-pass protocol flow consists of one "pass", i.e., a single
   message sent from the DSKPP server to the DSKPP client:

   Pass 1: <KeyProvServerFinished>

   a.  The DSKPP server generates a key K from which two keys, K_TOKEN
       and K_MAC are derived.  K is either transported or wrapped in
       accordance with the key initialization method known in advance by
       the DSKPP server.  The server then associates K_TOKEN with the
       cryptographic module in a server-side data store.  The intent is
       that the data store later on will be used by some service that
       needs to verify or decrypt data produced by the cryptographic
       module and the key.
   b.  Once the association has been made, the DSKPP server sends a
       confirmation message to the DSKPP client called
       <KeyProvServerFinished>.  The confirmation message includes a key
       container that holds an identifier for the key, the key K from
       which K_TOKEN and K_MAC are derived, and additional configuration
       information (note that the latter MUST include the identity of
       the DSKPP server for authentication purposes).  In addition,
       <KeyProvServerFinished> MUST include two MACs, which will allow
       the cryptographic module to perform key confirmation and server
       authentication before "commuting" the key.  Note that unlike two-
       pass DSKPP, in the one-pass variant, the server does not have the
       client nonce, R_C, and therefore the MACs values are calculated
       with contribution from an unsigned integer, I, generated by the
       server during the protocol run.

   c.  Upon receipt of the DSKPP server's confirmation message, the
       cryptographic module extracts the key data from the provided key
       container, uses the two MAC values to perform key confirmation
       and server authentication, and stores the key material locally.

4.5.2.  Key Confirmation

   In one-pass DSKPP, the server MUST include an identifier, ID_S, for
   itself (via the key container) in the <KeyProvServerFinished>
   message.  The MAC value in the <KeyProvServerFinished> message MUST
   be computed on the (ASCII) string "MAC 1 computation", the server
   identifier ID_S, and an unsigned integer value I, using a MAC key
   K_MAC.  The value I MUST be monotonically increasing and guaranteed
   not to be used again by this server towards this cryptographic
   module.  It could for example be the number of seconds since some
   point in time with sufficient granularity, a counter value, or a
   combination of the two where the counter value is reset for each new
   time value.  In contrast to the MAC calculation in four-pass DSKPP,
   the MAC key K_MAC MUST be provided together with K_TOKEN to the
   cryptographic module.

   Note: The integer I does not necessarily need to be maintained by the
   DSKPP server on a per cryptographic module basis (it is enough if the
   server can guarantee that the same value is never being sent twice to
   the same cryptographic module).

   If DSKPP-PRF is used as the MAC algorithm, then the input parameter s
   MUST consist of the concatenation of the (ASCII) string "MAC 1
   computation", ID_S, and I. The parameter dsLen MUST be set to at
   least 16 (i.e. the length of the MAC MUST be at least 16 octets):

   dsLen >= 16

   MAC = DSKPP-PRF (K_MAC, "MAC 1 computation" || ID_S || I, dsLen)

   The server MUST provide I to the client in the Nonce attribute of the
   <Mac> element of the <KeyProvServerFinished> message using the
   AuthenticationCodeMacType defined in Section 6.2.2.4.

4.5.3.  Server Authentication

   As discussed in , servers need to authenticate themselves when
   attempting to replace an existing K_TOKEN.  In 1-pass DSKPP, servers
   authenticate themselves by including a second MAC value in the
   AuthenticationDataType element of <KeyProvServerFinished>.  The MAC
   value in the AuthenticationDataType element MUST be computed on the
   (ASCII) string "MAC 1 computation", the server identifier ID_S, and a
   new value I', I' > I, using the existing MAC key K_MAC' (the MAC key
   that existed before this protocol run).  The MAC algorithm MUST be
   the same as the algorithm used for key confirmation purposes.

   If DSKPP-PRF is used as the MAC algorithm, then the input parameter s
   MUST consist of the concatenation of the (ASCII) string "MAC 1
   computation" ID_S, and I'.  The parameter dsLen MUST be set to at
   least 16 (i.e. the length of the MAC MUST be at least 16 octets):

   dsLen >= 16

   MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || ID_S || I', dsLen)

   The server MUST provide I' to the client in the Nonce attribute of
   the <Mac> element of the AuthenticationDataType extension.  If the
   protocol run is successful, the client stores I' as the new value of
   I for this server.

5.  Methods Common to More Than One Protocol Variant

   The mechanisms contained in this section are used in more than one
   variant of DSKPP.

5.1.  The DSKPP One-Way Pseudorandom Function, DSKPP-PRF

5.1.1.  Introduction

   All of the protocol variants depend on DSKPP-PRF.  The general
   requirements on DSKPP-PRF are the same as on keyed hash functions: It
   MUST take an arbitrary length input, and be one-way and collision-
   free (for a definition of these terms, see, e.g., [FAQ]).  Further,
   the DSKPP-PRF function MUST be capable of generating a variable-
   length output, and its output MUST be unpredictable even if other
   outputs for the same key are known.

   It is assumed that any realization of DSKPP-PRF takes three input
   parameters: A secret key k, some combination of variable data, and
   the desired length of the output.  The combination of variable data
   can, without loss of generalization, be considered as a salt value
   (see PKCS#5 Version 2.0 [PKCS-5], Section 4), and this
   characterization of DSKPP-PRF SHOULD fit all actual PRF algorithms
   implemented by cryptographic modules.  From the point of view of this
   specification, DSKPP-PRF is a "black-box" function that, given the
   inputs, generates a pseudorandom value.

   Separate specifications MAY define the implementation of DSKPP-PRF
   for various types of cryptographic modules.  Appendix B contains two
   example realizations of DSKPP-PRF.

5.1.2.  Declaration

   DSKPP-PRF (k, s, dsLen)

   Input:

   k     secret key in octet string format
   s     octet string of varying length consisting of variable data
         distinguishing the particular string being derived
   dsLen desired length of the output

   Output:

   DS    pseudorandom string, dsLen-octets long
   For the purposes of this document, the secret key k MUST be at least
   16 octets long.

5.2.  Encryption of Pseudorandom Nonces Sent from the DSKPP Client
      (Applicable to Four-Pass and Two-Pass DSKPP)

   During 4- and 2-pass message exchanges, DSKPP client random nonce(s)
   are either encrypted with the public key provided by the DSKPP server
   or by a shared secret key.  For example, in the case of a public RSA
   key, an RSA encryption scheme from PKCS #1 [PKCS-1] MAY be used.

   In the case of a shared secret key, to avoid dependence on other
   algorithms, the DSKPP client MAY use the DSKPP-PRF function described
   herein with the shared secret key K_SHARED as input parameter k (in
   this case, K_SHARED SHOULD be used solely for this purpose), the
   concatenation of the (ASCII) string "Encryption" and the server's
   nonce R_S as input parameter s, and dsLen set to the length of R_C:

   dsLen = len(R_C)

   DS = DSKPP-PRF(K_SHARED, "Encryption" || R_S, dsLen)

   This will produce a pseudorandom string DS of length equal to R_C.
   Encryption of R_C MAY then be achieved by XOR-ing DS with R_C:

   Enc-R_C = DS ^ R_C

   The DSKPP server will then perform the reverse operation to extract
   R_C from Enc-R_C.

5.3.  Client Authentication Mechanisms (Applicable to Four- and Two-Pass
      DSKPP)

   To ensure that a generated K_TOKEN ends up associated with the
   correct cryptographic module and user, the DSKPP server MAY couple an
   initial user authentication to the DSKPP execution in several ways,
   as discussed in the following sub-sections.  Whatever the method, the
   DSKPP server MUST ensure that a generated key is associated with the
   correct cryptographic module, and if applicable, the correct user.
   For a further discussion of this, and threats related to man-in-the-
   middle attacks in this context, see Section 14.

5.3.1.  Device Certificate

   Instead of requiring an Authentication Code for in-band
   authentication, a device private key and certificate could be used,
   which was supplied with the cryptographic module by its issuer for
   client authentication at the transport layer e.g TLS/HTTPS.  When the
   Device certificate is available and client authentication is not
   provided in the transport layer, the DSKPP client may include a
   device's certificate signed data for the authentication data.

5.3.2.  Device Identifier

   The DSKPP server could be pre-configured with a unique device
   identifier corresponding to a particular cryptographic module.  The
   DSKPP server MAY then include this identifier in the DSKPP
   initialization trigger, and the DSKPP client would include it in its
   message(s) to the DSKPP server for authentication.  Note that it is
   also legitimate for a DSKPP client to initiate the DSKPP protocol run
   without having received an initialization message from a server, but
   in this case any provided device identifier MUST NOT be accepted by
   the DSKPP server unless the server has access to a unique key for the
   identified device and that key will be used in the protocol.

5.3.3.  Authentication Code

   As shown in Figure 5, a key issuer may provide a one-time value,
   called an Authentication Code, to the user or device out-of-band and
   require this value to be used by the DSKPP client when contacting the
   DSKPP server.  The DSKPP client MAY include the authentication data
   in its <KeyProvClientHello> (and <KeyProvClientNonce> for four-pass)
   message, and the DSKPP server MUST verify the data before continuing
   with the protocol run.

   Note: An alternate method for getting the Authentication Code to the
   client, is for the DSKPP server to place the value in the
   <TriggerNonce> element of the DSKPP initialization trigger (if
   triggers are used; see Section 12.2.7) .  When this method is used, a
   transport providing privacy and integrity MUST be used to deliver the
   DSKPP initialization trigger from the DSKPP server to the DSKPP
   client, e.g.  HTTPS.

   +------------+  Get Authentication Code  +------------+
   |    User    |<------------------------->|   Issuer   |
   +------------+                           +------------+
          |                                        |
          |                                        |
          |                                        |
          V                                        V
   +--------------+                        +--------------+
   |    DSKPP     |   Authentication Data  |    DSKPP     |
   |    Client    |----------------------->|    Server    |
   +--------------+                        +--------------+

      Figure 5: User Authentication with One-Time               Code

   The Authentication Code, AUTHCODE, may be considered as a special
   form of a shared secret between a User and a DSKPP server.  The
   Issuer may generate the Authentication Code as follows:

   AUTHCODE = passwordLen || identifier || password || checksum

   where

   passwordLen  : 1 digit indicating the 'password' length.  The maximum
             length of the password is 10.  A passwordLen value '0'
             indicates a password of 10 digits.

   identifier  : A globally unique identifier of the user's order for
             token provisioning.  The length of the identifier may be
             fixed e.g. 10 digits or variable e.g. 1 to 20 digits.  The
             identifier may be generated as a sequence number.

   password  : 6 to 10 digits.  The password should be generated by the
             system as a random number to make the AUTHCODE more
             difficult to guess.

   checksum  : 1 digit calculated from the remaining digits in the code.

   The Authentication Data, AUTHDATA, may be derived from the AUTHCODE
   and other information as follows:

   MAC = DSKPP-PRF-AES(K_AUTHCODE, AUTHCODE->Identifier || URL_S ||
   [R_S], 16)

   where
      Refer to Section 5.1 for a description of DSKPP-PRF in general and
      Appendix B for a description of DSKPP-PRF-AES.

      In four-pass DSKPP, the cryptographic module uses the client nonce
      R_C, the server nonce R_S, and the server URL URL_S to calculate
      the MAC.  In two-pass DSKPP, the cryptographic module does not
      have access to the server nonce R_S therefore only the client
      nonce R_C is used in combination with the server URL URL_S to
      produce the MAC.

      The K_AUTHCODE MAY be derived from AUTHCODE>password as follows:
         K_AUTHCODE = truncate( Hash( Hash(...n times...(
         AUTHCODE->password ||R_C||[K]) ) ) )

      where

         K is optional and MAY be one of the following:

                   K_CLIENT: The device public key when a device
                   certificate is available and used for key transport
                   in 2-pass

                   K_SHARED: The shared key between the Client and the
                   Server when it is used for key wrap in two-pass or
                   for R_C protection in four-pass

                   K_DERIVED: when a passphrase derived key is used for
                   key wrap in two-pass.

         'truncate()' returns the first 16 bytes from the result of the
         last hash iteration, and n is the number of hash iterations. n
         may be any number between 10 and 1000.

   Notes:
   1  Authentication data MAY be omitted if client certificate
      authentication has been provided by the transport channel such as
      TLS.

   2  When an issuer delegates symmetric key provisioning to a third
      party provisioning service provider, both client authentication
      and issuer authentication are required by the provisioning server.
      Client authentication to the issuer MAY be in-band or out-of-band
      as described above.  The issuer acts as a proxy for the
      provisioning server.  The issuer authenticates to the provisioning
      service provider either using a certificate or a pre-established
      secret key.

5.4.  Client Authentication Examples

5.4.1.  Example Using a MAC from an Authentication Code

     <AuthenticationData>
       <ClientID>31300257</ClientID>
       <AuthenticationCodeMac>
         <IterationCount>512</IterationCount>
         <Mac>4bRJf9xXd3KchKoTenHJiw==</Mac>
       </AuthenticationCodeMac>
                 </AuthenticationData>

5.4.2.  Example Using a Device Certificate

  <AuthenticationData>
    <DigitalSignature>
      <ds:SignedInfo>
        <ds:CanonicalizationMethod
          Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
        <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
        <ds:Reference URI="#Nonce">
          <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
          <ds:DigestValue></ds:DigestValue>
        </ds:Reference>
      </ds:SignedInfo>
      <ds:SignatureValue></ds:SignatureValue>
      <ds:KeyInfo>
        <ds:X509Data>
          <ds:X509Certificate>miib</ds:X509Certificate>
        </ds:X509Data>
      </ds:KeyInfo>
      <ds:Object Id="Nonce">xwQzwEl0CjPAiQeDxwRJdQ==</ds:Object>
              </DigitalSignature>

6.  Four-Pass Protocol

   In this section, example messages are used to describe parameters,
   encoding and semantics in a 4-pass DSKPP exchanges.  The examples are
   written using XML.  While they are syntactically correct, MAC and
   cipher values are fictitious.

6.1.  XML Basics

   The DSKPP XML schema can be found in Section 13.  Some DSKPP elements
   rely on the parties being able to compare received values with stored
   values.  Unless otherwise noted, all elements in this document that
   have the XML Schema "xs:string" type, or a type derived from it, MUST
   be compared using an exact binary comparison.  In particular, DSKPP
   implementations MUST NOT depend on case-insensitive string
   comparisons, normalization or trimming of white space, or conversion
   of locale-specific formats such as numbers.

   Implementations that compare values that are represented using
   different character encodings MUST use a comparison method that
   returns the same result as converting both values to the Unicode
   character encoding, Normalization Form C [UNICODE], and then
   performing an exact binary comparison.

   No collation or sorting order for attributes or element values is
   defined.  Therefore, DSKPP implementations MUST NOT depend on
   specific sorting orders for values.

6.2.  Round-Trip #1:  <KeyProvClientHello> and <KeyProvServerHello>

6.2.1.  Examples

6.2.1.1.  Example Without a Preceding Trigger

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvClientHello Version="1.0"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
    keyprov-dskpp-1.0.xsd">
  <DeviceIdentifierData>
    <DeviceId>
      <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
      <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
      <pskc:Model>U2</pskc:Model>
    </DeviceId>
  </DeviceIdentifierData>
  <SupportedKeyTypes>
    <Algorithm>urn:ietf:params:xml:schema:keyprov:otpalg#HOTP</Algorithm>
    <Algorithm>
      http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES
    </Algorithm>
  </SupportedKeyTypes>
  <SupportedEncryptionAlgorithms>
    <Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5</Algorithm>
    <Algorithm>
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
    </Algorithm>
  </SupportedEncryptionAlgorithms>
  <SupportedMacAlgorithms>
    <Algorithm>
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
    </Algorithm>
  </SupportedMacAlgorithms>
  <SupportedProtocolVariants><FourPass/></SupportedProtocolVariants>
  <SupportedKeyContainers>
    <KeyContainerFormat>
      urn:ietf:params:xml:schema:keyprov:container#KeyContainer
    </KeyContainerFormat>
  </SupportedKeyContainers>
</dskpp:KeyProvClientHello>

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvServerHello Version="1.0" SessionID="4114" Status="Success"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
  keyprov-dskpp-1.0.xsd">
  <KeyType>
    urn:ietf:params:xml:schema:keyprov:otpalg#SecurID-AES
  </KeyType>
  <EncryptionAlgorithm>
    urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
  </EncryptionAlgorithm>
  <MacAlgorithm>
    urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
  </MacAlgorithm>
  <EncryptionKey>
    <ds:KeyName>KEY-1</ds:KeyName>
  </EncryptionKey>
  <KeyContainerFormat>
    urn:ietf:params:xml:schema:keyprov:container#KeyContainer
  </KeyContainerFormat>
  <Payload>
    <Nonce>qw2ewasde312asder394jw==</Nonce>
  </Payload>
</dskpp:KeyProvServerHello>

6.2.1.2.  Example Assuming a Preceding Trigger

<?xml version="1.0" encoding="UTF-8"?>

<dskpp:KeyProvClientHello Version="1.0"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
    keyprov-dskpp-1.0.xsd">
  <DeviceIdentifierData>
    <DeviceId>
      <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
      <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
      <pskc:Model>U2</pskc:Model>
    </DeviceId>
  </DeviceIdentifierData>
  <KeyID>SE9UUDAwMDAwMDAx</KeyID>
  <TriggerNonce>112dsdfwf312asder394jw==</TriggerNonce>
  <SupportedKeyTypes>
    <Algorithm>urn:ietf:params:xml:schema:keyprov:otpalg#HOTP</Algorithm>
    <Algorithm>
      http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES
    </Algorithm>
  </SupportedKeyTypes>
  <SupportedEncryptionAlgorithms>
    <Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5</Algorithm>
    <Algorithm>
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
    </Algorithm>
  </SupportedEncryptionAlgorithms>
  <SupportedMacAlgorithms>
    <Algorithm>
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
    </Algorithm>
  </SupportedMacAlgorithms>
  <SupportedProtocolVariants><FourPass/></SupportedProtocolVariants>
  <SupportedKeyContainers>
    <KeyContainerFormat>
      urn:ietf:params:xml:schema:keyprov:container#KeyContainer
    </KeyContainerFormat>
  </SupportedKeyContainers>
</dskpp:KeyProvClientHello>

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvServerHello Version="1.0" SessionID="4114" Status="Success"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
    keyprov-dskpp-1.0.xsd">
  <KeyType>
    http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES
  </KeyType>
  <EncryptionAlgorithm>
    urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
  </EncryptionAlgorithm>
  <MacAlgorithm>
    urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
  </MacAlgorithm>
  <EncryptionKey>
    <ds:KeyName>KEY-1</ds:KeyName>
  </EncryptionKey>
  <KeyContainerFormat>
    urn:ietf:params:xml:schema:keyprov:container#KeyContainer
  </KeyContainerFormat>
  <Payload>
    <Nonce>qw2ewasde312asder394jw==</Nonce>
  </Payload>
  <Mac MacAlgorithm=
    "urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes">
    cXcycmFuZG9tMzEyYXNkZXIzOTRqdw==
  </Mac>
</dskpp:KeyProvServerHello>

6.2.2.  Components of the <KeyProvClientHello> Request

   The components of this message have the following meaning:
   o  Version: (attribute inherited from the AbstractRequestType type)
      The highest version of this protocol the client supports.  Only
      version one ("1.0") is currently specified.
   o  <DeviceIdentifierData>: An identifier for the 96

1.  Introduction

   A symmetric key cryptographic module
      as defined in Section 5.3 above.  The identifier MUST only be
      present if provides data authentication and
   encryption services to software (or firmware) applications hosted on
   hardware devices, such shared secrets exist or if the identifier was
      provided by the server in a <KeyProvTrigger> element (see
      Section 12.2.7 below).  In the latter case, it MUST have the same
      value as the identifier provided in that element.
   o  <KeyID>: An identifier for the key personal computers, handheld mobile phones,
   one-time password tokens, USB flash drives, tape drives, etc.  Until
   recently, provisioning symmetric keys to these modules has been labor
   intensive, involving manual operations that will be overwritten if the
      protocol run is successful.  The identifier MUST only be present
      if the key exists or if the identifier was provided by the server
      in are device-specific, and
   inherently error-prone.

   Fortunately, an increasing number of hardware devices enable
   programmatic initialization of their applications.  For example, a <KeyProvTrigger> element, in which case, it MUST have the
      same value as the identifier provided in that element (see
   U3-ready thumb drive lets users load and configure applications
   locally through a
      (Section 9) USB port on their PC.  Other hardware devices, such
   as Personal Digital Assistant (PDA) phones, allow users to load and Section 12.2.7 below).
   o  <KeyProvClientNonce>: This is the nonce R, which, when present,
      MUST be used by the server when calculating MAC values (see
      below).  It is RECOMMENDED that clients include this element
      whenever
   configure applications over-the-air.  Likewise, programmable
   cryptographic modules enable issuers to provision symmetric keys via
   the <KeyID> element is present.
   o  <TriggerNonce>: Internet, whether over-the-wire or over-the-air.

   This OPTIONAL element MUST be present if and only
      if document describes the Dynamic Symmetric Key Provisioning
   Protocol (DSKPP), which leverages these recent technological
   developments.  DSKPP run was initialized with a <KeyProvTrigger> message
      (see Section 12.2.7 below), provides an open and MUST, in that case, have the same
      value as the <TriggerNonce> child of that message.  A server using
      nonces in this way MUST verify that the nonce is valid interoperable mechanism for
   initializing and configuring symmetric keys to cryptographic modules
   that
      any device or key identifier values provided in are accessible over the
      <KeyProvTrigger> message match Internet.  The description is based on
   the corresponding identifier values information contained in RFC4758, and contains specific
   enhancements, such as User Authentication and support for the <KeyProvClientHello> message.
   o  <SupportedKeyTypes>: A sequence [PSKC]
   format for transmission of URIs indicating the key types
      for which the cryptographic module material.

   DSKPP is willing to generate keys
      through DSKPP.
   o  <SupportedEncryptionAlgorithms>: A sequence of URIs indicating the
      encryption algorithms supported a client-server protocol with two variations.  One variation
   establishes a symmetric key by mutually authenticated key agreement.
   The other variation relies on key distribution.  In the former case,
   key agreement enables two parties (a cryptographic module for
      the purposes of DSKPP.  The DSKPP client MAY indicate the same
      algorithm both as and key
   provisioning server) to establish a supported symmetric cryptographic key type and as using
   an encryption
      algorithm.
   o  <SupportedMacAlgorithms>: A sequence exchange of URIs indicating the MAC
      algorithms supported by four messages, such that the cryptographic module for key is not transported
   over the purposes
      of DSKPP.  The DSKPP client MAY indicate Internet.  In the same algorithm both
      as an encryption algorithm and as latter case, key distribution enables a MAC algorithm (e.g.,
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes defined
      in Appendix B).
   o  <SupportedProtocolVariants>: This OPTIONAL element is used by
   key provisioning server to transport a symmetric key to a
   cryptographic module over the Internet using an exchange of two
   messages.  In either case, DSKPP client to indicate support for four-pass or two-pass DSKPP.
      If two-pass support is specified, then <KeyProvClientNonce> MUST
      be set flexible enough to nonce R be run with or
   without private-key capability in the <KeyProvClientHello> message unless
      <TriggerNonce> cryptographic module, and with
   or without an established public-key infrastructure.

   All DSKPP communications consist of pairs of messages: a request and
   a response.  Each pair is already present.
   o  <SupportedKeyContainers>: This OPTIONAL element called an "exchange", and each message sent
   in an exchange is called a sequence "pass".  Thus, an implementation of
      URIs indicating DSKPP
   that relies on mutually authenticated key agreement is called the
   "four-pass protocol"; an implementation of DSKPP that relies on key container formats supported by
   distribution is called the "two-pass protocol".

   DSKPP
      client. message flow always consists of a request followed by a
   response.  It is the responsibility of the client to ensure
   reliability.  If this element the response is not provided, then the DSKPP server
      MUST proceed received with
      "urn:ietf:params:xml:schema:keyprov:container#KeyContainer" (see
      [PSKC]).
   o  <AuthenticationData>: This OPTIONAL element contains data that a timeout
   interval, the
      DSKPP client uses needs to authenticate retransmit the user or device to request (or abandon the DSKPP
      server.  The element is set as specified in Section 5.3.
   o  <Extensions>: A sequence
   connection).  Number of extensions.  One extension is defined
      for this message retries and lengths of timeouts are not
   covered in this version of DSKPP: the ClientInfoType (see
      Section 10).

6.2.2.1.  The document because they do not affect interoperability.

1.1.  Usage Scenarios

   DSKPP Client:  The DeviceIdentifierDataType Type

   The DeviceIdentifierDataType type is expected to be used to uniquely identify provision symmetric keys to
   cryptographic modules in a number of different scenarios, each with
   its own special requirements.

1.1.1.  Single Key Request

   The usual scenario is that a cryptographic module makes a request for
   a symmetric key from a provisioning server that is located on the
   local network or somewhere on the Internet.  Depending upon the
   device that houses
   deployment scenario, the cryptographic module, provisioning server may generate a new key
   on-the-fly or use a pre-generated key, e.g., one provided by a mobile phone. legacy
   back-end issuance server.  The device identifier allows the DSKPP provisioning server to find, e.g., assigns a pre-
   shared transport unique
   key for 2-pass DSKPP and/or ID to the correct shared
   secret for MAC'ing purposes.  The default DeviceIdentifierDataType is
   defined in [PSKC].

6.2.2.2.  Selecting a Protocol Variant: The ProtocolVariantsType Type

   The ProtocolVariantsType type is OPTIONAL for a DSKPP client, who MAY
   use symmetric key and provisions it to indicate the number of passes of cryptographic
   module.

1.1.2.  Multiple Key Requests

   A cryptographic module makes multiple requests for symmetric keys
   from the DSKPP protocol that it
   supports. same provisioning server.  The ProtocolVariantsType MAY be used to indicate support
   for 4-pass or 2-pass DSKPP.  Because 1-pass DSKPP does symmetric keys need not include a
   client request to be of
   the server, same type, i.e., the ProtocolVariantsType type MAY NOT keys may be used to indicate support for 1-pass DSKPP.  If the
   ProtocolVariantsType is not used, then the DSKPP server will proceed with ordinary 4-pass DSKPP.  However, it does not support 4-pass
   DSKPP, then the server MUST find different symmetric
   key cryptographic algorithms, including one-time password
   authentication algorithms, and AES encryption algorithm.

1.1.3.  Session Time-Out Policy

   Once a suitable two-pass variant or else cryptographic module initiates a symmetric key request, the protocol run will fail.

   The TwoPassSupportType type signals client support for
   provisioning server may require that any subsequent actions to
   complete the 2-pass
   version of DSKPP, informs provisioning cycle occur within a certain time window.
   For example, an issuer may provide a time-limited authentication code
   to a user during registration, which the server of supported two-pass variants,
   and provides OPTIONAL payload data user will input into the
   cryptographic module to authenticate themselves with the DSKPP provisioning
   server.  The payload
   is sent in an opportunistic fashion, and MAY be discarded by the
   DSKPP server if  If the server does not support user inputs a valid authentication code within the two-pass variant
   fixed time period established by the
   payload is associated with.  The elements of this type have issuer, the
   following meaning:
   o  <SupportedKeyInitializationMethod>: A two-pass server will allow a
   key initialization
      method supported to be provisioned to the cryptographic module hosted by the DSKPP client.  Multiple supported methods
      MAY be present, in which case they MUST be listed in order of
      precedence.
   o  <Payload>: An OPTIONAL payload associated with each supported key
      initialization method.
   user's device.

1.1.4.  Outsourced Provisioning

   A DSKPP client that indicates support for two-pass DSKPP MUST also
   include the nonce R in symmetric key issuer outsources its <KeyProvClientHello> message (this will
   enable the client key provisioning to verify that the DSKPP server it is communicating
   with is alive).

6.2.2.3.  Selecting a Key Container Format: The KeyContainersFormatType
          Type

   The OPTIONAL KeyContainersFormatType type is a list of type-value
   pairs that a DSKPP client or server MAY use to define third-
   party key container
   formats it supports.  Key container formats are identified through
   URIs, e.g., the PSKC KeyContainer URI
   "urn:ietf:params:xml:schema:keyprov:container#KeyContainer" (see
   [PSKC]).

6.2.2.4.  Selecting a Client and Server Authentication Mechanism: The
          AuthenticationDataType Type provisioning server provider.  The OPTIONAL AuthenticationDataType type issuer is used by DSKPP clients responsible
   for authenticating and
   server granting rights to carry authentication values in DSKPP messages.  The element
   MAY contain a device certificate or MAC derived from an
   authentication code users to acquire keys while
   acting as follows:
   a.  A DSKPP client MAY include a one-time use AuthenticationCode that
       was given by proxy to the cryptographic module to acquire symmetric
   keys from the provisioning server; the cryptographic module
   communicates with the issuer proxy server, which forwards
   provisioning requests to the user for acquiring provisioning server.

1.1.5.  Key Renewal

   A cryptographic module requests renewal of a symmetric key using the
   same key ID already associated with the key.  An AuthenticationCode MAY or MAY NOT contain alphanumeric
       characters  Such a need may occur
   in addition to numeric digits depending on the case when a user wants to upgrade her device
       type and policy of that houses the issuer.  For
   cryptographic module or when a key has expired.  When a user uses the
   same cryptographic module to, for example, if perform strong
   authentication at multiple Web login sites, keeping the device is same key ID
   removes the need for the user to register a
       mobile phone, new key ID at each site.

1.1.6.  Pre-Loaded Key Replacement

   This scenario represents a code that special case of symmetric key renewal in
   which a local administrator can authenticate the user enters on procedurally
   before initiating the keypad would
       typically be restricted to numeric digits provisioning process.  It also allows for ease of use.  An
       authentication code MAY be sent an
   issuer to pre-load a key onto a cryptographic module with a
   restriction that the DSKPP server as MAC data
       calculated according key is replaced with a new key prior to section Section 5.3.3.
   b.  A DSKPP client MAY contain Authentication Data consisting use of
       signed data
   the cryptographic module.  Another variation of client Nonce with a client certificate's private
       key.  A service provider may have this scenario is the
   issuer who recycles devices.  In this case, an issuer would provision
   a policy to issue new symmetric
       keys for key to a device only if it has cryptographic module hosted on a trusted device certificate.
       An authentication code isn't required in that
   was previously owned by another user.

   Note that this case.
   c. usage scenario is essentially the same as the last
   scenario wherein the same key ID is used for renewal.

1.1.7.  Pre-Shared Transport Key

   A DSKPP server MAY use cryptographic module is loaded onto a smart card after the AuthenticationDataType element
       AuthenticationCodeMac card is
   issued to carry a MAC user.  The symmetric key for authenticating itself to the client.  For example, when a successful 1- or 2-pass DSKPP
       protocol run cryptographic module
   will result in an existing key being replaced, then
       the DSKPP server MUST include be provisioned using a MAC proving secure channel mechanism present in
   many smart card platforms.  This allows a direct secure channel to be
   established between the DSKPP client
       that the server knows smart card chip and the value of provisioning server.
   For example, the card commands (i.e., Application Protocol Data
   Units, or APDUs) are encrypted with a pre-shared transport key it is about and
   sent directly to
       replace.

   The element of the AuthenticationDataType type have smart card chip, allowing secure post-issuance
   in-the-field provisioning.  This secure flow can pass Transport Layer
   Security (TLS) and other transport security boundaries.

   Note that two pre-conditions for this usage scenario are for the following
   meaning:
   o  <ClientID>: A requester's identifier.  The value MAY
   protocol to be a user ID,
      a device ID, or a keyID associated with tunneled and the provisioning server to know the
   correct pre-established transport key.

1.1.8.  End-to-End Protection of Key Material

   In this scenario, transport layer security does not provide end-to-
   end protection of key material transported from the requester's
      authentication value.  When provisioning
   server to the authentication data is based cryptographic module.  For example, TLS may terminate
   at an application hosted on a
      certificate, <ClientID> can be omitted, as PC rather than at the certificate itself
      is typically sufficient to identify cryptographic
   module (i.e., the requester.  Also, if endpoint) located on a
      <KeyProvTrigger> message was provided by the server to initiate data storage device.
   Mutually authenticated key agreement provides end-to-end protection,
   which TLS cannot provide.

1.2.  Protocol Entities

   In principle, the DSKPP protocol run, <ClientID> can be omitted, as involves a DSKPP client and a DSKPP
   server.  The DSKPP client manages communication between the
      DeviceID, KeyID, and/or nonce provided in
   cryptographic module and the
      <InitializationTriggerType> element ought to be sufficient to
      identify provisioning server.  In this document,
   the requester.
   o  <AuthenticationCodeMac>: An authentication MAC DSKPP server represents the provisioning server.

   A high-level object model that describes the client-side entities and OPTIONAL
      additional information (e.g., MAC algorithm).  The value could be
      a one-time use value sent as a MAC value
   how they relate to each other is shown in Figure 1.  Conceptually,
   each entity is represented by the DSKPP server; or,
      it could be definitions found in Section 2.2.

   -----------          -------------
   | User    |          | Device    |
   |---------|*  owns  *|-----------|
   | UserID  |--------->| DeviceID  |
   | ...     |          | ...       |
   -----------          -------------
                             | 1
                             |
                             | contains
                             |
                             | *
                             V
                 --------------------------
                 |Cryptographic Module    |
                 |------------------------|
                 |Crypto Module ID        |
                 |Security Attribute List |
                 |...                     |
                 --------------------------
                            | 1
                            |
                            | contains
                            |
                            | *
                            V
                   -----------------------
                   |Key Container        |
                   |---------------------|
                   |Key ID               |
                   |Key Type             |
                   |...                  |
                   -----------------------

                          Figure 1: Object Model

   It is assumed that a MAC value sent to the DSKPP client.  Refer to
      section Section 5.3.3 for calculation of MAC with device will host an
      authentication code.
   o  <DigitalSignature>: Client nonce R_C signed using application layered above
   the device
      certificate cryptographic module, and sent in KeyProvClientHello for two-pass protocol
      or in KeyProvClientNonce for four-pass protocol.

6.2.3.  Components of this application will manage
   communication between the <KeyProvServerHello> Response

   This message is DSKPP client and cryptographic module.  The
   manner in which the first message sent communicating application will transfer DSKPP
   protocol elements to and from the DSKPP server cryptographic module is transparent
   to the DSKPP client (assuming server.  One method for this transfer is described in
   [CT-KIP-P11].

1.3.  Initiating DSKPP

   To initiate DSKPP:

   1.  A server may first send a DSKPP trigger message has not been sent to
   initiate the protocol, a client
       application (e.g., in which case, response to a user browsing to a Web site
       that requires a symmetric key for authentication), although this message
       step is the second
   message sent from optional.
   2.  A client application calls on the DSKPP server client to the send a
       symmetric key request to a DSKPP client).  It is sent
   upon reception of server, thus beginning a <KeyProvClientHello> message.  The components DSKPP
       protocol run.

   One of
   this message have the following meaning:

   o  Version: (attribute inherited from the AbstractResponseType type)
      The version selected by actions may be used to contact a DSKPP server:

   1.  A user may indicate how the DSKPP client is to contact a certain
       DSKPP server during a browsing session.
   2.  A DSKPP client may be pre-configured to contact a certain DSKPP
       server.  MAY
   3.  A user may be lower than informed out-of-band about the
      version indicated by location of the
       DSKPP server.

   Once the location of the DSKPP server is known, the DSKPP client, in which case, local policy
      at the client MUST determine whether and
   the DSKPP server engage in a 4-pass or not 2-pass protocol.

1.4.  Determining Which Protocol Variant to continue the
      session.
   o  SessionID: (attribute inherited from Use

   The four-pass and two-pass protocols are appropriate in different
   deployment scenarios, as described in the AbstractResponseType
      type) An identifier sub-sections below.

1.4.1.  Criteria for this session.
   o  Status: (attribute inherited from Using the AbstractResponseType type)
      Return code for Four-Pass Protocol

   The four-pass protocol is needed under one or more of the <KeyProvClientHello>.  If Status following
   conditions:

   o  The cryptographic module is not
      "Continue", only the Status and Version attributes will be
      present; otherwise, all the other element MUST pre-populated with a transport
      key, nor hosted on a pre-keyed device (e.g., a SIM card), nor has
      a keypad that can be present used for entering a passphrase (such as well.
      present on a mobile phone).
   o  <KeyType>:  The hardware device will be used within multiple security domains,
      which means that each domain will need to provision its own
      symmetric key.  However, the cryptographic module does not have a
      transport key, or other type of the key to that can be generated. used with multiple
      provisioning servers.
   o  <EncryptionAlgorithm>: The encryption algorithm to use when
      protecting R_C.  A cryptographic module does not have private-key capabilities.
   o  <MacAlgorithm>: The MAC algorithm to  When the system provides a single point for exposing key material.
      This risk can be used mitigated by ensuring that both parties
      contribute entropy to the DSKPP server. key, such as with key agreement.
   o  <EncryptionKey>: Information about  A consumer of the protocol requires algorithm agility, esp. the
      ability to negotiate which encryption mechanisms and key types are
      used during a protocol run.

1.4.2.  Criteria for Using the Two-Pass Protocol

   The two-pass protocol is needed under one or more of the following
   conditions:

   o  A device is not able to use when encrypting
      R_C. It will either support near real-time communications.
   o  Pre-existing (i.e., legacy) keys must be provisioned to the server's public key (the <ds:KeyValue>
      alternative of ds:KeyInfoType) or an identifier for
      cryptographic module.
   o  The cryptographic module has a shared
      secret transport key (the <ds:KeyName> alternative and is capable of ds:KeyInfoType).
      performing private-key operations.
   o  <KeyContainerFormat>:  The cryptographic module has a pre-shared key container format type to be used by
      the DSKPP server. (e.g., a mobile
      phone with a SIM card).\
   o  The default setting relies on the
      KeyContainerType element defined cryptographic module has a keypad in
      "urn:ietf:params:xml:schema:keyprov:container" [PSKC]. which a user may enter a
      passphrase, useful for deriving a key-wrapping key for
      distribution of key material.
   o  <Payload>: The actual payload.  For this version  A consumer of the protocol,
      only one payload is defined: protocol requires algorithm agility, esp. the pseudorandom string R_S.
      ability to negotiate which encryption mechanisms and key types are
      used during a protocol run.
   o  <Extensions>: A list  Workflow dictates that an approval process is required as part of server extensions.  Two extensions are
      defined
      the protocol run (e.g., for this message user authorization).
   o  Near real-time communication between the client and server is not
      possible.

2.  Terminology

2.1.  Key Words

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this version
   document are to be interpreted as described in [RFC2119].

2.2.  Definitions

   Authentication Code (AC):  Client Authentication Code comprised of DSKPP: a
       string of numeric characters known to the
      ClientInfoType device and the ServerInfoType (see Section 10).
   o  <Mac>: The MAC MUST server
       and containing an identifier and a password

   Authentication Data (AD):  Client Authentication Data that may be present if the DSKPP run will result in
       derived from the
      replacement Authentication Code (AC)

   Cryptographic Module:  A component of an existing application, which enables
       symmetric key with a new one (i.e., if
      the <KeyID> element was present in the <ClientHello message).  In
      this case, the DSKPP server MUST prove to the cryptographic module
      that it is authorized to replace it.

      The DSKPP client MUST verify the MAC if the successful execution functionality
   CryptoModule ID:  A unique identifier for an instance of the protocol will result in the replacement
       cryptographic module

   Device:  A physical piece of an existing hardware or software framework that
       hosts symmetric key with a newly generated one.  The DSKPP client MUST
      terminate cryptographic modules

   Device ID (DeviceID):  A unique identifier for the device

   DSKPP session if Client:  Manages communication between the MAC does not verify, symmetric key
       cryptographic module and MUST
      delete any nonces, keys, and/or secrets associated with the failed
      run of the DSKPP protocol. server

   DSKPP Server:  The MacType's MacAlgorithm attribute MUST, when present, identify symmetric key provisioning server that
       participates in the negotiated MAC algorithm.

6.3.  Round-Trip #2: <KeyProvClientNonce> DSKPP protocol run

   DSKPP Server ID (ServerID):  The unique identifier of a DSKPP server

   Key Container (KC):  An object that encapsulates a symmetric key and <KeyProvServerFinished>

6.3.1.  Examples

6.3.1.1.  Example Using Default Encryption

   This message contains
       its configuration data

   Key Container Header (KCH):  Information about the nonce chosen by Key Container,
       useful for two-pass DSKPP, e.g., the cryptographic module,
   R_C, encrypted by ServerID and KPM

   Key ID (KeyID):  A unique identifier for the specified encryption symmetric key and encryption
   algorithm.

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:KeyProvClientNonce Version="1.0" SessionID="4114"
     xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
       keyprov-dskpp-1.0.xsd">
     <EncryptedNonce>VXENc+Um/9/NvmYKiHDLaErK0gk=</EncryptedNonce>
     <AuthenticationData>
       <ClientID>31300257</ClientID>
       <AuthenticationCodeMac>
         <IterationCount>512</IterationCount>
         <Mac>4bRJf9xXd3KchKoTenHJiw==</Mac>
       </AuthenticationCodeMac>
     </AuthenticationData>
   </dskpp:KeyProvClientNonce>

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvServerFinished Version="1.0" SessionID="4114" Status="Success"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
    keyprov-dskpp-1.0.xsd">
  <KeyContainer>
    <KeyContainer Version="1.0">
      <pskc:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
      <pskc:Device>
        <pskc:Key
          KeyAlgorithm=
          "http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES"
          KeyId="XL0000000001234">
          <pskc:Issuer>CredentialIssuer</pskc:Issuer>
          <pskc:Usage otp="true">
            <pskc:ResponseFormat format="DECIMAL" length="6"/>
          </pskc:Usage>
          <pskc:FriendlyName>MyFirstToken</pskc:FriendlyName>
          <pskc:Data Name="TIME">
            <pskc:Value>AAAAADuaygA=</pskc:Value>
          </pskc:Data>
          <pskc:Expiry>10/30/2012</pskc:Expiry>
        </pskc:Key>
      </pskc:Device>
    </KeyContainer>
  </KeyContainer>
  <Mac
    MacAlgorithm="urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes">
    miidfasde312asder394jw==
  </Mac>
</dskpp:KeyProvServerFinished>

6.3.2.  Components

   Key Protection Method (KPM):  The key protection profile used during
       two-pass DSKPP

   Key Protection Method List (KPML):  The list of key protection
       methods supported by a <KeyProvClientNonce> Request cryptographic module

   Key Type:  The components type of this message have the following meaning:

   o  Version: (inherited from symmetric key cryptographic methods for which
       the AbstractRequestType type) MUST key will be used (e.g., OATH HOTP or RSA SecurID
       authentication, AES encryption, etc.)

   Security Attribute List (SAL):  A payload that contains the
      same version as in the <KeyProvServerHello> message.
   o  <SessionID>: MUST have the same value as the SessionID attribute
      in the received <KeyProvServerHello> message.
   o  <EncryptedNonce>: The nonce generated DSKPP
       version, DSKPP variation (four- or two-pass), key container
       formats, key types, and encrypted by cryptographic algorithms that the
       cryptographic module.  The encryption MUST be made using module is capable of supporting

   Security Context (SC):  A payload that contains the
      selected encryption algorithm and identified key, DSKPP version,
       DSKPP variation (four- or two-pass), key container format, key
       type, and as specified
      in Section 5.1.

   o  <AuthenticationData>: cryptographic algorithms relevant to the current
       protocol run
   User:  The authentication data value MUST be set as
      specified in Section 5.3 person or client to whom devices are issued

   User ID:  A unique identifier for the user or client

2.3.  Notation

   ||                String concatenation

   [x]               Optional element x

   A ^ B             Exclusive-OR operation on strings A and Section 6.2.2.4.
   o  <Extensions>: B (where A list of extensions.  Two extensions
                     and B are defined
      for this message in this version of DSKPP: equal length)

   <XMLElement>      A typographical convention used in the ClientInfoType and body of the ServerInfoType
                     text

   DSKPP-PRF(k,x,l)  A keyed psuedo-random function (see Section 10)

6.3.3.  Components 3.4)

   E(k,m)            Encryption of a <KeyProvServerFinished> Response

   This message m with the key k

   K                 Key used to encrypt R_C (either K_SERVER, K_SHARED
                     or K_DERIVED), or in MAC or DSKPP_PRF computations

   K_AC              Secret key that is derived from the last message Authentication
                     Code and used for user authentication purposes

   K_CLIENT          Public key of the DSKPP protocol run.  In client

   K_DERIVED         Secret key derived from a
   4-pass exchange, passphrase that is known
                     to both the DSKPP client or user and the DSKPP
                     server sends this message in response to a
   <KeyProvClientNonce> message, whereas

   K_MAC             Secret key used for key confirmation and server
                     authentication purposes, and generated in a 2-pass exchange, the DSKPP

   K_MAC'            A second secret key used for server sends this message authentication
                     purposes in response to a <KeyProvClientHello>
   message.  In a 1-pass exchange, 2-pass DSKPP

   K_SERVER          Public key of the DSKPP server sends only this
   message to the client.  The components of this message have

   K_SHARED          Secret key shared between the
   following meaning:

   o  Version: (inherited from DSKPP client and the AbstractResponseType type) The
                     DSKPP
      version server
   K_TOKEN           Secret key used in this session.
   o  SessionID: (inherited from the AbstractResponseType type) The
      previously established identifier for this session.
   o  Status: (inherited from cryptographic module
                     computations, and generated in DSKPP

   R                 Pseudorandom value chosen by the AbstractResponseType type) Return code DSKPP client and
                     used for MAC computations

   R_C               Pseudorandom value chosen by the <KeyProvServerFinished> message.  If Status is not
      "Success", only the Status, SessionID, DSKPP client and Version attributes will
      be present (the presence of the SessionID attribute is dependent
      on the type of reported error); otherwise, all the other elements
      MUST be present as well.  In this latter case, the
      <KeyProvServerFinished> message can be seen
                     used as a "Commit" message,
      instructing the cryptographic module input to store the generated key
      and associate the given key identifier with this key.
   o  <KeyContainer>: The key container containing symmetric key values
      (in the case generation of a 2- or 1-pass exchange) and configuration data.
      The default container format is based on K_TOKEN

   R_S               Pseudorandom value chosen by the KeyContainerType type
      from PSKC, DSKPP server and
                     used as defined in [PSKC].
   o  <Extensions>: A list input to the generation of extensions K_TOKEN

   R_TRIGGER         Pseudorandom value chosen by the DSKPP server.
      For this message, this version of server and
                     used as input in a trigger message.
   URL_S             Server address as a URL

2.4.  Abbreviations

   AC      Authentication Code
   AD      Authentication Data
   DSKPP defines one extension, the
      ClientInfoType   Dynamic Symmetric Key Provisioning Protocol
   HTTP    Hypertext Transfer Protocol
   KC      Key Container
   KCH     Key Container Header
   KPM     Key Protection Method
   KPML    Key Protection Method List
   MAC     Message Authentication Code
   PC      Personal Computer
   PDU     Protocol Data Unit
   PKCS    Public-Key Cryptography Standards
   PRF     Pseudo-Random Function
   PSKC    Portable Symmetric Key Container
   SAL     Security Attribute List (see Section 10).
   o  <Mac>: To avoid 2.2)
   SC      Security Context (see Section 2.2)
   TLS     Transport Layer Security
   URL     Uniform Resource Locator
   USB     Universal Serial Bus
   XML     eXtensible Markup Language

3.  DSKPP Protocol Details

   DSKPP enables symmetric key provisioning between a DSKPP server and
   DSKPP client.  The DSKPP protocol supports the request and response
   messages shown in Figure 2.  These messages are described below.

   +---------------+                            +---------------+
   |               |                            |               |
   |  DSKPP Client |                            |  DSKPP Server |
   |               |                            |               |
   +---------------+                            +---------------+
           |                                            |
           | [ <--------- <KeyProvTrigger> --------- ]  |
           |                                            |
           |   ------- <KeyProvClientHello> ------->    |
           |        (Applicable to 4- and 2-pass)       |
           |                                            |
           |   <------ <KeyProvServerHello> --------    |
           |        (Applicable to 4-pass only)         |
           |                                            |
           |   ------- <KeyProvClientNonce> ------->    |
           |        (Applicable to 4-pass only)         |
           |                                            |
           |   <---- <KeyProvServerFinished> -------    |
           |       (Applicable to 4- and 2-pass)        |
           |                                            |

      Figure 2: The DSKPP protocol (with OPTIONAL preceding trigger)

   [<KeyProvTrigger>]:  A DSKPP server may initiate the DSKPP protocol
       by sending a false "Commit" <KeyProvTrigger> message.  For example, this message causing the cryptographic
      module
       may be sent in response to end up a user requesting a symmetric key in an initialized state for which a
       browsing session.  The trigger message always contains a nonce to
       allow the server does
      not know to couple the stored key, <KeyProvServerFinished> messages MUST
      always be authenticated trigger with a MAC.  The MAC MUST be made using
      the already established MAC algorithm.
      When receiving later
       <KeyProvClientHello> request.

   <KeyProvClientHello>:  With this request, a <KeyProvServerFinished> message DSKPP client initiates
       contact with
      Status="Success" for which the DSKPP server, indicating which protocol versions
       and variations (four-pass or two-pass), key types, encryption and
       MAC verifies, algorithms that it supports.  In addition, the DSKPP request may
       include client MUST
      associate authentication data that the generated key K_TOKEN with DSKPP server uses to
       verify proof-of-possession of the provided device.

   <KeyProvServerHello>:  Upon receiving a <KeyProvClientHello> request,
       the DSKPP server uses the <KeyProvServerHello> response to
       specify which protocol version and variation, key
      identifier type,
       encryption algorithm, and store this data permanently.  After this operation,
      it MUST NOT MAC algorithm that will be possible to overwrite used by the key unless knowledge
       DSKPP server and DSKPP client during the protocol run.  The
       decision of
      an authorizing which variation, key type, and cryptographic
       algorithms to pick is proven through policy- and implementation-dependent and
       therefore outside the scope of this document.

       The <KeyProvServerHello> response includes the DSKPP server's
       random nonce, R_S. The response also consists of information
       about either a shared secret key, or its own public key, that the
       DSKPP client uses when sending its protected random nonce, R_C,
       in the <KeyProvClientNonce> request (see below).

       Optionally, the DSKPP server may provide a MAC on that the DSKPP
       client may use for server authentication.

   <KeyProvClientNonce>:  With this request, a later
      <KeyProvServerHello> (and <KeyProvServerFinished>) message.

      The DSKPP client MUST verify the MAC.  The and DSKPP
       server securely exchange protected data, e.g., the protected
       random nonce R_C. In addition, the request may include client MUST
      terminate
       authentication data that the DSKPP session if server uses to verify proof-
       of-possession of the MAC does not verify, device.

   <KeyProvServerFinished>:  The <KeyProvServerFinished> response is a
       confirmation message that includes a key container that holds
       configuration data, and MUST,
      in this case, may also delete any nonces, keys, and/or secrets
      associated with contain protected key material
       (this depends on the failed run of protocol variation, as discussed below).

       Optionally, the DSKPP protocol.
      The MacType's MacAlgorithm attribute MUST, when present, identify
      the negotiated server may provide a MAC algorithm.

6.4. that the DSKPP Server Results:
       client may use for server authentication.

3.1.  Four-Pass Protocol Usage

   This section describes the message flow and methods that comprise the
   four-pass protocol variant.

3.1.1.  Message Flow

   The StatusCode Type four-pass protocol flow consists of two message exchanges:

   1:  Pass 1 = <KeyProvClientHello>, Pass 2 = <KeyProvServerHello>
   2:  Pass 3 = <KeyProvClientNonce>, Pass 4 = <KeyProvServerFinished>

   The StatusCode type enumerates all possible return codes.  Upon
   transmission or receipt first pair of messages negotiate cryptographic algorithms and
   exchange nonces.  The second pair of messages establishes a message for which the Status attribute's
   value symmetric
   key using mutually authenticated key agreement.

   The DSKPP server MUST ensure that a generated key is not "Success" or "Continue", associated with
   the default behavior, unless
   explicitly stated otherwise below, is that both correct cryptographic module, and if applicable, the correct
   user.  To do this, the DSKPP server MAY couple an initial user
   authentication to the DSKPP server execution using one of the mechanisms
   described in Section 3.3.

   The purpose and content of each message are described below,
   including the optional <KeyProvTrigger>.

           DSKPP client MUST immediately terminate the Client                         DSKPP session. Server
           ------------                         ------------
                                [<---] R_TRIGGER, [DeviceID],
                                            [KeyID], [URL_S]

   The DSKPP
   servers and server optionally sends a <KeyProvTrigger> message to the
   DSKPP clients client.  The trigger message MUST delete any secret values generated as contain a result of failed runs of nonce, R_TRIGGER,
   to allow the DSKPP protocol.  Session identifiers server to couple the trigger with a later
   <KeyProvClientHello> request. <KeyProvTrigger> MAY include DeviceID
   to allow the client to select the device with which it will
   communicate.  The DeviceID MAY also be retained from successful or failed protocol runs used later to authenticate the
   client (see Section 3.3.1).  In the case of key renewal,
   <KeyProvTrigger> MAY include the identifier for replay
   detection purposes, but such retained identifiers MUST NOT be reused the key, KeyID, that
   is being replaced.  Finally, the trigger MAY contain a URL for subsequent runs of the protocol.

   When possible,
   DSKP client to use when contacting the DSKPP server.

           DSKPP Client                         DSKPP Server
           ------------                         ------------
           SAL, [R_TRIGGER],
           [DeviceID], [KeyID]     --->

   The DSKPP client SHOULD present an appropriate error sends a <KeyProvClientHello> message to the user.

   These status codes are valid in all 4-Pass DSKPP Response messages
   unless explicitly stated otherwise:
   o  "Continue" indicates that the DSKPP server is ready for
   server.  This message MUST contain a
      subsequent request from the Security Attribute List (SAL),
   identifying which DSKPP client.  It cannot be sent in versions, protocol variations (in this case
   "four-pass"), key container formats, key types, encryption and MAC
   algorithms that the server's final message.
   o  "Success" indicates successful completion of client supports.  In addition, if a trigger
   message preceded <KeyProvClientHello>, then it passes the DSKPP session.
      It can only be sent parameters
   received in <KeyProvTrigger> back to the server's final message.
   o  "Abort" indicates DSKPP Server.  In
   particular, it MUST include R_TRIGGER so that the DSKPP server rejected can
   associate the DSKPP
      client's request for unspecified reasons.
   o  "AccessDenied" indicates that client with the trigger message, and SHOULD include
   DeviceID and KeyID.

           DSKPP client is not authorized
      to contact this Client                         DSKPP server.
   o  "MalformedRequest" indicates that the Server
           ------------                         ------------
                                   <---  SC, R_S, [K], [MAC]

   The DSKPP server failed responds to parse
      the DSKPP client's request.
   o  "UnknownRequest" indicates that the DSKPP client made with a request
      that is unknown
   <KeyProvServerHello> message, whose content MUST include a Security
   Context (SC).  The client will use the SC to select the DSKPP server.
   o  "UnknownCriticalExtension" indicates version
   and variation (e.g., four-pass), type of key to generate, and
   cryptographic algorithms that it will use for the remainder of the
   protocol run. <KeyProvServerHello> MUST also include the server's
   random nonce, R_S, whose length may depend on the selected key type.
   In addition, the <KeyProvServerHello> message MAY provide K, which
   represents its own public key (K_SERVER) or information about a critical DSKPP
      extension
   shared secret key (K_SHARED) to use for encrypting the cryptographic
   module's random nonce (see below) used by description of <KeyProvClientNonce>
   below).  Optionally, <KeyProvServerHello> MAY include a MAC that the
   DSKPP client was not supported
      or recognized by can use for server authentication in the case of key
   renewal (Section 3.1.3.1 describes how to calculate the MAC).

           DSKPP server.
   o  "UnsupportedVersion" indicates Client                         DSKPP Server
           ------------                         ------------
           E(K,R_C), [AD]          --->

   Based on the Security Context (SC) provided in the
   <KeyProvServerHello> message, the cryptographic module generates a
   random nonce, R_C. The length of the nonce R_C will depend on the
   selected key type.  The cryptographic module encrypts R_C using the
   selected encryption algorithm and with a key, K, that is either the
   DSKPP client used server's public key, K_SERVER, or a DSKPP
      protocol version not supported shared secret key,
   K_SHARED, as indicated by the DSKPP server.  This error

   Note: If K is
      only valid in equivalent to K_SERVER, then the cryptographic module
   SHOULD verify the DSKPP server's first response message.
   o  "NoSupportedKeyTypes" indicates that certificate before using it to encrypt R_C
   in accordance with [RFC3280].

   Note: If successful execution of the DSKPP client only
      suggested protocol will result in the
   replacement of an existing key types that are not supported by with a newly generated one, the DSKPP server.
      This error is only valid
   client MUST verify the MAC provided in the DSKPP server's first response <KeyProvServer> message.

   o  "NoSupportedEncryptionAlgorithms" indicates that the
   The DSKPP client
      only suggested encryption algorithms that are not supported by MUST terminate the DSKPP server.  This error is only valid in session if the MAC does not
   verify, and MUST delete any nonces, keys, and/or secrets associated
   with the failed run.

   The DSKPP server's
      first response message.
   o  "NoSupportedMacAlgorithms" indicates that client MUST send the encrypted random nonce to the DSKPP
   server in a <KeyProvClientNonce> message, and MAY include client only
      suggested
   Authentication Data (AD), such as a MAC algorithms that are not supported by derived from an
   authentication code and R_C (refer to Section 3.3.2).  Finally, the DSKPP
      server.  This error is only valid
   cryptographic module calculates and stores a symmetric key, K_TOKEN,
   of the key type specified in the SC received in <KeyProvServerHello>
   (refer to Section 3.1.2.2.<KeyProvServerFinished> for a description
   of how K_TOKEN is generated).

           DSKPP server's first
      response message.
   o  "NoProtocolVariants" indicates that Client                         DSKPP Server
           ------------                         ------------
                                    <---             KC, MAC

   If Authentication Data (AD) was received in the <KeyProvClientNonce>
   message, then the DSKPP client only
      suggested a protocol variant (either 2-pass or 4-pass) that is not
      supported by server MUST authenticate the DSKPP server.  This error is only valid user in the
   accordance with Section 3.3.2.  If authentication fails, then DSKPP server's first response messagei
   o  "NoSupportedKeyContainers" indicates that
   server MUST abort.  Otherwise, the DSKPP client only
      suggested server decrypts R_C,
   calculates K_TOKEN from the combination of the two random nonces R_S
   and R_C, the encryption key container formats that are not supported by K, and possibly some other data, using
   the
      DSKPP server.  This error is only valid DSKPP-PRF function defined in Section 3.4.  The server then
   associates K_TOKEN with the DSKPP server's
      first response message.
   o  "AuthenticationDataMissing" indicates that the DSKPP client didn't
      provide authentication cryptographic module in a server-side
   data store.  The intent is that the DSKPP server required.
   o  "AuthenticationDataInvalid" indicates data store later on will be used
   by some service that the DSKPP client
      supplied user needs to verify or device authentication decrypt data that produced by the DSKPP server
      failed to validate.
   o  "InitializationFailed" indicates that
   cryptographic module and the key.

   Once the association has been made, the DSKPP server could not
      generate sends a valid key given the provided data.  When this status
      code is received,
   confirmation message to the DSKPP client SHOULD try to restart DSKPP, as
      it is possible that called
   <KeyProvServerFinished>.  The confirmation message MUST include a new run will succeed.
   o  "ProvisioningPeriodExpired" indicates Key
   Container (KC) that holds an identifier for the provisioning period
      set by generated key (but
   not the DSKPP server has expired.  When key itself) and additional configuration information, e.g.,
   the status code identity of the DSKPP server.  The default symmetric key
   container format is
      received, based on the Portable Symmetric Key Container
   (PSKC) defined in [PSKC].  Alternative formats MAY include PKCS#12
   [PKCS-12] or PKCS#5 XML [PKCS-5-XML] format.  In addition to a Key
   Container, <KeyProvServerFinished> MUST also include a MAC that the
   DSKPP client SHOULD report the key initialization
      failure reason will use to authenticate the user and message before commiting
   K_TOKEN.

   After receiving a <KeyProvServerFinished> message with Status =
   "Success", the user DSKPP client MUST register with verify the MAC.  The DSKPP server to initialize a new key.

7.  Two-Pass Protocol

   In this section, example messages are used to describe parameters,
   encoding and semantics in a 2-pass client
   MUST terminate the DSKPP exchanges.  The examples are
   written using XML.  While they are syntactically correct, session if the MAC does not verify, and
   cipher values are fictitious.

7.1.  XML Basics

   The DSKPP XML schema can be found
   MUST, in Section 13.  Some this case, also delete any nonces, keys, and/or secrets
   associated with the failed run of the protocol.  If
   <KeyProvServerFinished> has Status = "Success" and the MAC was
   verified, then the DSKPP elements
   rely on client MUST associate the parties being able to compare received values provided key
   container with stored
   values.  Unless otherwise noted, all elements in this document that
   have the XML Schema "xs:string" type, or a type derived from it, generated key K_TOKEN, and store this data
   permanently.  After this operation, it MUST NOT be compared using possible to
   overwrite the key unless knowledge of an exact binary comparison.  In particular, DSKPP
   implementations MUST NOT depend authorizing key is proven
   through a MAC on case-insensitive string
   comparisons, normalization or trimming of white space, or conversion
   of locale-specific formats such as numbers.

   Implementations that compare values that are represented using
   different character encodings MUST use a comparison method later <KeyProvServerHello> (and
   <KeyProvServerFinished>) message.

3.1.2.  Generation of Symmetric Keys for Cryptographic Modules

   With 4-pass DSKPP, the symmetric key that
   returns is the same result as converting both values to target of
   provisioning, is generated on-the-fly without being transferred
   between the Unicode
   character encoding, Normalization Form C [UNICODE], DSKPP client and then
   performing an exact binary comparison.

   No collation or sorting order for attributes or element values DSKPP server.  A sample data flow
   depicting how this works followed by computational information are
   provided in the subsections below.

3.1.2.1.  Data Flow

   A sample data flow showing key generation during the 4-pass protocol
   is
   defined.  Therefore, shown in Figure 8.

   +----------------------+    +-------+     +----------------------+
   |    +------------+    |    |       |     |                      |
   |    | Server key |    |    |       |     |                      |
   | +<-|  Public    |------>------------->-------------+---------+ |
   | |  |  Private   |    |    |       |     |          |         | |
   | |  +------------+    |    |       |     |          |         | |
   | |        |           |    |       |     |          |         | |
   | V        V           |    |       |     |          V         V |
   | |   +---------+      |    |       |     |        +---------+ | |
   | |   | Decrypt |<-------<-------------<-----------| Encrypt | | |
   | |   +---------+      |    |       |     |        +---------+ | |
   | |      |  +--------+ |    |       |     |            ^       | |
   | |      |  | Server | |    |       |     |            |       | |
   | |      |  | Random |--->------------->------+  +----------+  | |
   | |      |  +--------+ |    |       |     |   |  | Client   |  | |
   | |      |      |      |    |       |     |   |  | Random   |  | |
   | |      |      |      |    |       |     |   |  +----------+  | |
   | |      |      |      |    |       |     |   |        |       | |
   | |      V      V      |    |       |     |   V        V       | |
   | |   +------------+   |    |       |     | +------------+     | |
   | +-->|  DSKPP implementations MUST NOT depend on
   specific sorting orders for values.

7.2.  Round-Trip #1:  <KeyProvClientHello> and <KeyProvServerFinished>

7.2.1.  Examples

7.2.1.1.  Example Using the Key Transport Profile

   The client indicates support all the Key Transport, Key Wrap, and
   Passphrase-Based PRF |   |    |       |     | |  DSKPP PRF |<----+ |
   |     +------------+   |    |       |     | +------------+       |
   |           |          |    |       |     |       |              |
   |           V          |    |       |     |       V              |
   |       +-------+      |    |       |     |   +-------+          |
   |       |  Key Wrap profiles (see Section 11):

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvClientHello Version="1.0"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
  keyprov-dskpp-1.0.xsd">
  <DeviceIdentifierData>
    <DeviceId>
      <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
      <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
      <pskc:Model>U2</pskc:Model>
    </DeviceId>
  </DeviceIdentifierData>
  <ClientNonce>xwQzwEl0CjPAiQeDxwRJdQ==</ClientNonce>
  <SupportedKeyTypes>
    <Algorithm>urn:ietf:params:xml:schema:keyprov:otpalg#HOTP</Algorithm>
    <Algorithm>
      http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES
    </Algorithm>
  </SupportedKeyTypes>
  <SupportedEncryptionAlgorithms>
    <Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5</Algorithm>
    <Algorithm>http://www.w3.org/2001/04/xmlenc#kw-aes128</Algorithm>
    <Algorithm>urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes</Algorithm>
  </SupportedEncryptionAlgorithms>
  <SupportedMacAlgorithms>
    <Algorithm>urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes</Algorithm>
  </SupportedMacAlgorithms>
  <SupportedProtocolVariants>
    <TwoPass>
      <SupportedKeyInitializationMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#wrap
      </SupportedKeyInitializationMethod>
      <Payload xsi:type="ds:KeyInfoType">
        <ds:KeyName>Key_001</ds:KeyName>
      </Payload>
      <SupportedKeyInitializationMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#transport
      </SupportedKeyInitializationMethod>
      <SupportedKeyInitializationMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#passphrase-wrap
      </SupportedKeyInitializationMethod>
      <Payload xsi:type="ds:KeyInfoType">
        <ds:X509Data>
          <ds:X509Certificate>miib</ds:X509Certificate>
        </ds:X509Data>
      </Payload>
    </TwoPass>
  </SupportedProtocolVariants>
  <SupportedKeyContainers>
    <KeyContainerFormat>
      urn:ietf:params:xml:schema:keyprov:container#KeyContainer
    </KeyContainerFormat>
  </SupportedKeyContainers>
  <AuthenticationData>
    <DigitalSignature>
      <ds:SignedInfo>
        <ds:CanonicalizationMethod
          Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
        <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
        <ds:Reference URI="#Nonce">
          <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
          <ds:DigestValue></ds:DigestValue>
        </ds:Reference>
      </ds:SignedInfo>
      <ds:SignatureValue></ds:SignatureValue>
      <ds:KeyInfo>
        <ds:X509Data>
          <ds:X509Certificate>miib</ds:X509Certificate>
        </ds:X509Data>
      </ds:KeyInfo>
      <ds:Object Id="Nonce">xwQzwEl0CjPAiQeDxwRJdQ==</ds:Object>
    </DigitalSignature>
  </AuthenticationData>
</dskpp:KeyProvClientHello>

   In this example, the server responds to the previous request using
   the key transport profile.

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvServerFinished Version="1.0" SessionID="4114" Status="Success"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
    keyprov-dskpp-1.0.xsd">
  <KeyContainer>
    <KeyContainer Version="1.0">
      <pskc:EncryptionMethod
        Algorithm="http://www.w3.org/2001/05/xmlenc#rsa_1_5">
        <pskc:KeyInfo>
          <ds:X509Data>
            <ds:X509Certificate>miib</ds:X509Certificate>
          </ds:X509Data>
        </pskc:KeyInfo>
      </pskc:EncryptionMethod>
      <pskc:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
      <Device xmlns="urn:ietf:params:xml:ns:keyprov:1.0:container">
        <Key KeyAlgorithm="urn:ietf:params:xml:schema:keyprov:otpalg#HOTP"
          KeyId="SDU312345678">
          <Issuer>CredentialIssuer</Issuer>
          <Usage otp="true">
            <ResponseFormat format="DECIMAL" length="6"/>
          </Usage>
          <FriendlyName>MyFirstToken</FriendlyName>
          <Data Name="SECRET">
            <Value>
              7JHUyp3azOkqJENSsh6b2vxXzwGBYypzJxEr+ikQAa229KV/BgZhGA==
            </Value>
            <ValueDigest>
              i8j+kpbfKQsSlwmJYS99lQ==
            </ValueDigest>
          </Data>
          <Data Name="COUNTER">
            <Value>AAAAAAAAAAA=</Value>
          </Data>
          <Expiry>10/30/2012</Expiry>
        </Key>
      </Device>
    </KeyContainer>
  </KeyContainer>
  <Mac
    MacAlgorithm="urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes">
    miidfasde312asder394jw==
  </Mac>
  <AuthenticationData>
    <AuthenticationCodeMac>
      <Mac>4bRJf9xXd3KchKoTenHJiw==</Mac>
    </AuthenticationCodeMac>
  </AuthenticationData>
</dskpp:KeyProvServerFinished>

7.2.1.2.  Example Using the  |      |    |       |     |   |  Key Wrap Profile

   The client sends a request that specifies a shared  |          |
   |       +-------+      |    |       |     |   +-------+          |
   |       +-------+      |    |       |     |   +-------+          |
   |       |Key Id |-------->------------->------|Key Id |          |
   |       +-------+      |    |       |     |   +-------+          |
   +----------------------+    +-------+     +----------------------+
         DSKPP Server         DSKPP Client         DSKPP Client
                               (PC Host)      (cryptographic module)

   Figure 8: Principal data flow for DSKPP key to protect the
   K_TOKEN, and the server responds generation             -
                          using the Key Wrap Profile.
   Authentication data in this example is basing on an authentication
   code rather than a device certificate.

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvClientHello Version="1.0"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:pkcs-5="http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5v2-0#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
  keyprov-dskpp-1.0.xsd">
  <DeviceIdentifierData>
    <DeviceId>
      <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
      <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
      <pskc:Model>U2</pskc:Model>
    </DeviceId>
  </DeviceIdentifierData>
  <ClientNonce>xwQzwEl0CjPAiQeDxwRJdQ==</ClientNonce>
  <SupportedKeyTypes>
    <Algorithm>urn:ietf:params:xml:schema:keyprov:otpalg#HOTP</Algorithm>
    <Algorithm>
      http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES
    </Algorithm>
  </SupportedKeyTypes>
  <SupportedEncryptionAlgorithms>
    <Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5</Algorithm>
    <Algorithm>http://www.w3.org/2001/04/xmlenc#kw-aes128</Algorithm>
    <Algorithm>
      http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2
    </Algorithm>
    <Algorithm>
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
    </Algorithm>
  </SupportedEncryptionAlgorithms>
  <SupportedMacAlgorithms>
    <Algorithm>
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
    </Algorithm>
  </SupportedMacAlgorithms>
  <SupportedProtocolVariants>
    <TwoPass>
      <SupportedKeyInitializationMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#wrap
      </SupportedKeyInitializationMethod>
      <Payload xsi:type="ds:KeyInfoType">
        <ds:KeyName>Key_001</ds:KeyName>
      </Payload>
    </TwoPass>
  </SupportedProtocolVariants>
  <SupportedKeyContainers>
    <KeyContainerFormat>
      urn:ietf:params:xml:schema:keyprov:container#KeyContainer
    </KeyContainerFormat>
  </SupportedKeyContainers>
  <AuthenticationData>
    <ClientID>31300257</ClientID>
    <AuthenticationCodeMac>
      <IterationCount>512</IterationCount>
      <Mac>4bRJf9xXd3KchKoTenHJiw==</Mac>
    </AuthenticationCodeMac>
  </AuthenticationData>
</dskpp:KeyProvClientHello>

   In this example, the public server responds to the previous request using
   the key wrap profile.

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvServerFinished Version="1.0" Status="Success"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
  keyprov-dskpp-1.0.xsd">
  <KeyContainer>
    <ServerID>https://www.somedskppservice.com/</ServerID>
    <KeyContainer Version="1.0">
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes128"
        xmlns="urn:ietf:params:xml:ns:keyprov:1.0:container">
        <KeyInfo>
           <ds:KeyName>Key-001</ds:KeyName>
         </KeyInfo>
      </EncryptionMethod>
      <pskc:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
      <Device xmlns="urn:ietf:params:xml:ns:keyprov:1.0:container">
        <Key KeyAlgorithm="urn:ietf:params:xml:schema:keyprov:otpalg#HOTP"
          KeyId="SDU312345678">
          <Issuer>CredentialIssuer</Issuer>
          <Usage otp="true">
            <ResponseFormat format="DECIMAL" length="6"/>
          </Usage>
          <FriendlyName>MyFirstToken</FriendlyName>
          <Data Name="SECRET">
            <Value>
              JSPUyp3azOkqJENSsh6b2hdXz1WBYypzJxEr+ikQAa22M6V/BgZhRg==
            </Value>
            <ValueDigest>
              i8j+kpbfKQsSlwmJYS99lQ==
            </ValueDigest>
          </Data>
          <Data Name="COUNTER">
            <Value>AAAAAAAAAAA=</Value>
          </Data>
          <Expiry>10/30/2012</Expiry>
        </Key>
      </Device>
    </KeyContainer>
  </KeyContainer>
  <Mac MacAlgorithm="urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes">
    miidfasde312asder394jw==
  </Mac>
  <AuthenticationData>
    <AuthenticationCodeMac>
      <Mac>4bRJf9xXd3KchKoTenHJiw==</Mac>
    </AuthenticationCodeMac>
  </AuthenticationData>
</dskpp:KeyProvServerFinished>

7.2.1.3.  Example Using the Passphrase-Based Key Wrap Profile

   The client sends a request similar to that in Section 7.2.1.1 with
   authentication data basing on an authentication code, and the server
   responds using the Passphrase-Based Key Wrap Profile.  The
   authentication data

   Note: Conceptually, although R_C is set in clear text when one pseudorandom string, it is sent over a
   secure transport channel such may
   be viewed as TLS.

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvClientHello Version="1.0"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:pkcs-5="http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5v2-0#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
  keyprov-dskpp-1.0.xsd">
  <DeviceIdentifierData>
    <DeviceId>
      <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
      <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
      <pskc:Model>U2</pskc:Model>
    </DeviceId>
  </DeviceIdentifierData>
  <ClientNonce>xwQzwEl0CjPAiQeDxwRJdQ==</ClientNonce>
  <SupportedKeyTypes>
    <Algorithm>urn:ietf:params:xml:schema:keyprov:otpalg#HOTP</Algorithm>
    <Algorithm>
      http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES
    </Algorithm>
  </SupportedKeyTypes>
  <SupportedEncryptionAlgorithms>
    <Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5</Algorithm>
    <Algorithm>http://www.w3.org/2001/04/xmlenc#kw-aes128</Algorithm>
    <Algorithm>
      http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2
    </Algorithm>
    <Algorithm>
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
    </Algorithm>
  </SupportedEncryptionAlgorithms>
  <SupportedMacAlgorithms>
    <Algorithm>
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes
    </Algorithm>
  </SupportedMacAlgorithms>
  <SupportedProtocolVariants>
    <TwoPass>
      <SupportedKeyInitializationMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#wrap
      </SupportedKeyInitializationMethod>
      <Payload xsi:type="ds:KeyInfoType">
        <ds:KeyName>Key_001</ds:KeyName>
      </Payload>
      <SupportedKeyInitializationMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#passphrase-wrap
      </SupportedKeyInitializationMethod>
    </TwoPass>
  </SupportedProtocolVariants>
  <SupportedKeyContainers>
    <KeyContainerFormat>
      urn:ietf:params:xml:schema:keyprov:container#KeyContainer
    </KeyContainerFormat>
  </SupportedKeyContainers>
  <AuthenticationData>
    <ClientID>31300257</ClientID>
    <AuthenticationCodeMac>
      <IterationCount>512</IterationCount>
      <Mac>4bRJf9xXd3KchKoTenHJiw==</Mac>
    </AuthenticationCodeMac>
  </AuthenticationData>
</dskpp:KeyProvClientHello>

   In this example, the server responds to the previous request using
   the Passphrase-Based Key Wrap Profile.

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvServerFinished Version="1.0" SessionID="4114" Status="Success"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
    keyprov-dskpp-1.0.xsd">
  <KeyContainer>
    <KeyContainer Version="1.0">
      <EncryptionMethod
        Algorithm="http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2"
        xmlns="urn:ietf:params:xml:ns:keyprov:1.0:container">
          <PBEEncryptionParam
             EncryptionAlgorithm="http://www.w3.org/2001/04/xmlenc#kw-aes128-cbc">
            <PBESalt>y6TzckeLRQw=</PBESalt>
            <PBEIterationCount>1024</PBEIterationCount>
          </PBEEncryptionParam>
          <IV>c2FtcGxlaXY=</IV>
        </EncryptionMethod>
      <pskc:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
      <Device xmlns="urn:ietf:params:xml:ns:keyprov:1.0:container">
        <Key KeyAlgorithm="urn:ietf:params:xml:schema:keyprov:otpalg#HOTP"
          KeyId="SDU312345678">
          <Issuer>CredentialIssuer</Issuer>
          <Usage otp="true">
            <ResponseFormat format="DECIMAL" length="6"/>
          </Usage>
          <FriendlyName>MyFirstToken</FriendlyName>
          <Data Name="SECRET">
            <Value>
              JSPUyp3azOkqJENSsh6b2hdXz1WBYypzJxEr+ikQAa22M6V/BgZhRg==
            </Value>
            <ValueDigest>
              i8j+kpbfKQsSlwmJYS99lQ==
            </ValueDigest>
          </Data>
          <Data Name="COUNTER">
            <Value>AAAAAAAAAAA=</Value>
          </Data>
          <Expiry>10/30/2012</Expiry>
        </Key>
      </Device>
    </KeyContainer>
  </KeyContainer>
  <Mac MacAlgorithm="urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes">
    miidfasde312asder394jw==
  </Mac>
  <AuthenticationData>
    <AuthenticationCodeMac>
      <Mac>4bRJf9xXd3KchKoTenHJiw==</Mac>
    </AuthenticationCodeMac>
  </AuthenticationData>
</dskpp:KeyProvServerFinished>

7.2.2.  Components of the <KeyProvClientHello> Request

   The components of this message have the following meaning:
   o  Version: (attribute inherited from the AbstractRequestType type)
      The highest version consisting of this protocol the client supports.  Only
      version one ("1.0") two components, R_C1 and R_C2, where R_C1
   is currently specified.
   o  <DeviceIdentifierData>: An identifier for generated during the protocol run, and R_C2 can be pre-generated
   and loaded on the cryptographic module
      as defined in Section 5.3 above.  The identifier MUST only be
      present if such shared secrets exist or if before the identifier was
      provided by device is issued to
   the server in a <KeyProvTrigger> element (see
      Section 12.2.7 below). user.  In the latter case, it MUST have the same
      value as the identifier provided in that element.
   o  <KeyID>: An identifier for case, the key that will latter string, R_C2, SHOULD be overwritten if the
      protocol run is successful. unique
   for each cryptographic module.

   The identifier MUST only be present
      if the key exists or the identifier was provided by inclusion of the server two random nonces R_S and R_C in
      a <KeyProvTrigger> element (see Section 12.2.7 below).  In the
      latter case, it MUST have the same value as key
   generation provides assurance to both sides (the cryptographic module
   and the identifier
      provided in DSKPP server) that element.

   o  <KeyProvClientNonce>: This is the nonce R, which, when present,
      MUST be used by they have contributed to the server when calculating MAC values (see
      below).  It is RECOMMENDED key's
   randomness and that clients include this element
      whenever the <KeyID> element key is present.
   o  <TriggerNonce>: This OPTIONAL element MUST unique.  The inclusion of the
   encryption key K ensures that no man-in-the-middle may be present if and only
      if present, or
   else the DSKPP run was initialized cryptographic module will end up with a <KeyProvTrigger> message
      (see Section 12.2.7 below), and MUST, in that case, have key different from
   the same
      value as one stored by the <TriggerNonce> child of that message. legitimate DSKPP server.

   Note: A server using
      nonces in this way MUST verify that man-in-the-middle (in the nonce is valid and that
      any device form of corrupt client software or
   a mistakenly contacted server) may present his own public key identifier values provided in to the
      <KeyProvTrigger> message match
   cryptographic module.  This will enable the corresponding identifier values
      in attacker to learn the <KeyProvClientHello> message.
   o  <SupportedKeyTypes>: A sequence
   client's version of URIs indicating the key types
      for which K_TOKEN.  However, the cryptographic module attacker is willing not able to generate keys
      through DSKPP.
   o  <SupportedEncryptionAlgorithms>: A sequence of URIs indicating
   persuade the
      encryption algorithms supported by legitimate server to derive the cryptographic module same value for
      the purposes K_TOKEN,
   since K_TOKEN is a function of DSKPP.  The DSKPP client MAY indicate the same
      algorithm both as a supported public key type involved, and as an encryption
      algorithm.
   o  <SupportedMacAlgorithms>: A sequence of URIs indicating the MAC
      algorithms supported by
   attacker's public key must be different than the cryptographic module for correct server's (or
   else the purposes
      of DSKPP.  The DSKPP client MAY indicate attacker would not be able to decrypt the same algorithm both
      as an encryption algorithm and as a MAC algorithm (e.g.,
      urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes defined
      in Appendix B).
   o  <SupportedProtocolVariants>: This OPTIONAL element information
   received from the client).  Therefore, once the attacker is used by no longer
   "in the middle," the
      DSKPP client and server will detect that they are "out
   of sync" when they try to indicate support for four-pass or two-pass DSKPP.
      If two-pass support use their keys.  In the case of encrypting
   R_C with K_SERVER, it is specified, then <KeyProvClientNonce> MUST
      be set therefore important to nonce R in the <KeyProvClientHello> message unless
      <TriggerNonce> verify that K_SERVER
   really is already present.
   o  <SupportedKeyContainers>: This OPTIONAL element the legitimate server's key.  One way to do this is to
   independently validate a sequence of
      URIs indicating newly generated K_TOKEN against some
   validation service at the key container formats supported server (e.g. by using a connection
   independent from the DSKPP
      client.  If this element is not provided, then one used for the key generation).

3.1.2.2.  Computing the Symmetric Key

   In DSKPP, keys are generated using the DSKPP-PRF function defined in
   Section 3.4, a secret random value R_C chosen by the DSKPP server
      MUST proceed with
      "urn:ietf:params:xml:schema:keyprov:container#KeyContainer" (see
      [PSKC].
   o  <AuthenticationData>: This OPTIONAL element contains data that client, a
   random value R_S chosen by the DSKPP client uses to authenticate server, and the user or device key K used to the DSKPP
      server.
   encrypt R_C. The element input parameter s of DSKPP-PRF is set as specified in Section 5.3.
   o  <Extensions>: A sequence to the
   concatenation of extensions.  One extension the (ASCII) string "Key generation", K, and R_S, and
   the input parameter dsLen is defined
      for this message in this version set to the desired length of DSKPP: the ClientInfoType (see
      Section 10).

7.2.3.  Components key,
   K_TOKEN (the length of a <KeyProvServerFinished> Response

   This message K_TOKEN is given by the last message key's type):

   dsLen = (desired length of K_TOKEN)

   K_TOKEN = DSKPP-PRF (R_C, "Key generation" || K || R_S, dsLen)

   When computing K_TOKEN above, the DSKPP protocol run.  In output of DSKPP-PRF MAY be subject
   to an algorithm-dependent transform before being adopted as a
   4-pass exchange, key of
   the DSKPP server sends selected type.  One example of this message is the need for parity in response to a
   <KeyProvClientNonce> message, whereas DES
   keys.

3.1.3.  MAC Calculations

3.1.3.1.  Server Authorization in the Case of Key Renewal

   A MAC MUST be present in a 2-pass exchange, the DSKPP
   server sends this <KeyProvServerHello> message if the
   DSKPP run will result in response to a <KeyProvClientHello>
   message.  In the replacement of an existing key with a 1-pass exchange,
   new one as proof that the DSKPP server sends only this
   message is authorized to perform the client.  The components of this message have the
   following meaning:

   o  Version: (inherited from
   action.  When the AbstractResponseType type) The DSKPP
      version MAC value is used in this session.
   o  SessionID: (inherited from the AbstractResponseType type) The
      previously established identifier for this session.
   o  Status: (inherited from the AbstractResponseType type) Return code
      for the <KeyProvServerFinished> message.  If Status is not
      "Success", only server authentication, the Status, SessionID, and Version attributes will
   value MAY be present (the presence of the SessionID attribute is dependent
      on computed by using the type DSKPP-PRF function of reported error); otherwise, all Section 3.4,
   in which case the other elements input parameter s MUST be present as well.  In this latter case, set to the
      <KeyProvServerFinished> message can be seen as a "Commit" message,
      instructing concatenation
   of the cryptographic module to store (ASCII) string "MAC 1 computation", R (if sent by the generated key client),
   and associate R_S, and K MUST be set to the given key identifier with this key.
   o  <KeyContainer>: The key container containing symmetric existing MAC key values
      (in the case of a 2- or 1-pass exchange) and configuration data. K_MAC' .  The default container format is based on the KeyContainerType type
      from PSKC, as defined in [PSKC].
   o  <Extensions>: A list of extensions chosen by the DSKPP server.
      For this message, this version of DSKPP defines one extension,
   input parameter dsLen MUST be set to the
      ClientInfoType (see Section 10).
   o  <Mac>: length of R_S:

   dsLen = len(R_S)

   MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || [R ||] R_S, dsLen)

3.1.3.2.  Key Confirmation

   To avoid a false "Commit" message causing the cryptographic module to
   end up in an initialized state for in which the server does not know recognize
   the stored key, <KeyProvServerFinished> <ServerFinished> messages MUST
      always be authenticated with
   a MAC.  The MAC MUST be made calculated using the already established MAC algorithm.
   o  <AuthenticationData>: This OPTIONAL element contains data
   algorithm and MUST be computed on the (ASCII) string "MAC 2
   computation" and R_C using the existing the MAC key K_MAC' (i.e., the
   MAC key that
      allows existed before this protocol run).  If DSKPP-PRFof
   Section 3.4 is used as the MAC algorithm, then the input parameter s
   MUST consist of the concatenation of the (ASCII) string "MAC 2
   computation", R_C, and dsLen as follows:

   dsLen = len(R_C)

   MAC = DSKPP-PRF (K_MAC, "MAC 2 computation" || R_C, dsLen)

3.2.  Two-Pass Protocol Usage

   Two-pass DSKPP client is essentially a transport of key material from the
   DSKPP server to authenticate the DSKPP client.  Two-pass DSKPP supports multiple
   key protection methods that ensure K_TOKEN is not exposed to any
   other entity than the DSKPP server and the cryptographic module
   itself.  Currently, three such key protection methods are defined
   (refer to Section 3.2.2), each supporting a different usage of 2-pass
   DSKPP:

   Key Transport               This profile is intended for PKI-capable
                               devices.  Key transport is carried out
                               using a public key, K_CLIENT, whose
                               private key part resides in the
                               cryptographic module as the transport
                               key.

   Key Wrap                    This profile is ideal for pre-keyed
                               devices, e.g., SIM cards.  Key wrap is
                               carried out using a symmetric key-
                               wrapping key, K_SHARED, which is known in
                               advance by both the cryptographic module
                               and the DSKPP server.  The MAC
      value
   Passphrase-Based Key Wrap   This profile is a variation of the Key
                               Wrap Profile.  It is calculated applicable to
                               constrained devices with K_MAC' as specified in Section 4.4.3.
      When receiving keypads, e.g.,
                               mobile phones.  Key wrap is carried out
                               using a <KeyProvServerFinished> message with
      Status="Success" for passphrase-derived key-wrapping
                               key, K_DERIVED, which is known in advance
                               by both the MAC verifies, the cryptographic module and
                               DSKPP client MUST
      associate the generated key K_TOKEN with server.
   This section describes the provided key
      identifier message flow and store this data permanently.  After this operation,
      it MUST not be possible to overwrite methods that comprise the key unless knowledge
   two-pass protocol variant.

3.2.1.  Message Flow

   The two-pass protocol flow consists of
      an authorizing key one exchange:

   1:  Pass 1 = <KeyProvClientHello>, Pass 2 = <KeyProvServerFinished>

   The client's initial <KeyProvClientHello> message is proven through a MAC on directly
   followed by a later <KeyProvServerFinished> message (unlike the four-pass
   variant, there is no exchange of the <KeyProvServerHello> (and <KeyProvServerFinished>) message.
      The DSKPP client MUST verify and
   <KeyProvClientNonce> messages).  However, as the MAC.  The two-pass variation
   of DSKPP client MUST
      terminate consists of one round trip to the DSKPP session if server, the MAC does not verify, client is
   still able to include its random nonce, R_C, algorithm preferences
   and MUST, supported key types in this case, also delete any nonces, keys, and/or secrets
      associated with the failed run of the DSKPP protocol.
      The MacType's MacAlgorithm attribute MUST, when present, identify <KeyProvClientHello> message.  Note
   that by including R_C in <KeyProvClientHello>, the negotiated MAC algorithm.

7.3. DSKPP Server Results:  The StatusCode Type

   The StatusCode type enumerates all possible return codes.  Upon
   transmission or receipt of a message for which the Status attribute's
   value client is not "Success" or "Continue", the default behavior, unless
   explicitly stated otherwise below,
   able to ensure the server is alive before "committing" the key.

   To ensure that both a generated key K_TOKEN ends up associated with the DSKPP server
   correct cryptographic module and user, the DSKPP client MUST immediately terminate server MAY couple an
   initial user authentication to the DSKPP session.  DSKPP
   servers and DSKPP clients MUST delete any secret values generated as
   a result of failed runs execution using one of the DSKPP protocol.  Session identifiers
   MAY be retained from successful or failed protocol runs for replay
   detection purposes, but such retained identifiers MUST not be reused
   for subsequent runs of
   mechanisms described in Section 3.3.  Whatever the protocol.

   When possible, mechanism, the
   DSKPP client SHOULD present an appropriate error
   message to server MUST ensure that a generated key is associated with the
   correct cryptographic module, and if applicable, the correct user.

   These status codes

   The purpose and content of each message are valid in all DSKPP Response messages unless
   explicitly stated otherwise:
   o  "Continue" indicates that described below,
   including the optional <KeyProvTrigger>.

           DSKPP Client                         DSKPP Server
           ------------                         ------------
                                [<---] R_TRIGGER, [DeviceID],
                                            [KeyID], [URL_S]

   The DSKPP server is ready for optionally sends a
      subsequent request from <KeyProvTrigger> message to the
   DSKPP client.  It cannot be sent in  The trigger message MUST contain a nonce, R_TRIGGER,
   to allow the server's final message.
   o  "Success" indicates successful completion server to couple the trigger with a later
   <KeyProvClientHello> request. <KeyProvTrigger> MAY include DeviceID
   to allow the client to select the device with which it will
   communicate.  In the case of key renewal, <KeyProvTrigger> SHOULD
   include the DSKPP session.
      It can only be sent in identifier for the server's final message.
   o  "Abort" indicates key, KeyID, that is being replaced.
   Finally, the DSKPP server rejected the DSKPP
      client's request trigger MAY contain a URL for unspecified reasons.
   o  "AccessDenied" indicates that the DSKPP DSKP client is not authorized to contact this use
   when contacting the DSKPP server.
   o  "MalformedRequest" indicates that the

           DSKPP server failed to parse
      the Client                         DSKPP client's request.
   o  "UnknownRequest" indicates that the Server
           ------------                         ------------
           R_C, SAL, KPML, [AD],
           [R_TRIGGER],
           [DeviceID], [KeyID]     --->

   The DSKPP client made sends a request
      that is unknown <KeyProvClientHello> message to the DSKPP
   server.
   o  "UnknownCriticalExtension" indicates that <KeyProvClientHello> MUST include client nonce, R_C, and a critical
   Security Attribute List (SAL), identifying which DSKPP
      extension (see below) used by versions,
   protocol variations (in this case "two-pass"), key container formats,
   key types, encryption and MAC algorithms that the client supports.
   Unlike 4-pass DSKPP, the 2-pass DSKPP client was not supported
      or recognized by uses the
   <KeyProvClientHello> message to declare the list of Key Protection
   Methods (KPML) it supports, providing required payload information in
   accordance with Section 3.2.2.  Optionally, the message MAY include
   client Authentication Data (AD), such as a MAC derived from an
   authentication code and R_C (refer to Section 3.3.2).  In addition,
   if a trigger message preceded <KeyProvClientHello>, then it passes
   the parameters received in <KeyProvTrigger> back to the DSKPP server.
   o  "UnsupportedVersion" indicates Server.
   In particular, it MUST include R_TRIGGER so that the DSKPP server can
   associate the client used a with the trigger message, and SHOULD include
   DeviceID and KeyID.

           DSKPP
      protocol version not supported by Client                         DSKPP Server
           ------------                         ------------
                                  <---  KCH, KC, E(K,K_PROV),
                                                     MAC, AD

   If Authentication Data (AD) was received, then the DSKPP server.  This error is
      only valid in server MUST
   authenticate the user in accordance with Section 3.3.2.  If
   authentication fails, then DSKPP server's first response message.
   o  "NoSupportedKeyTypes" indicates that server MUST abort.  Otherwise, the
   DSKPP client only
      suggested server generates a key types that K_PROV from which two keys, K_TOKEN and
   K_MAC, are not supported by derived.  (Alternatively, the key K_PROV may have been
   pre-generated as described in Section 1.1.1.  The DSKPP server.
      This error is only valid server
   selects a Key Protection Method (KPM) and applies it to K_PROV in
   accordance with Section 3.2.2.  The server then associates K_TOKEN
   with the DSKPP server's first response
      message.
   o  "NoSupportedEncryptionAlgorithms" indicates cryptographic module in a server-side data store.  The
   intent is that the DSKPP client
      only suggested encryption algorithms data store later will be used by some service that are not supported
   needs to verify or decrypt data produced by the
      DSKPP server.  This error is only valid in cryptographic module
   and the DSKPP server's
      first response message.  Note that key.

   Once the error will only occur if association has been made, the DSKPP server does not support any of the DSKPP client's
      suggested encryption algorithms.

   o  "NoSupportedMacAlgorithms" indicates that sends a
   confirmation message to the DSKPP client only
      suggested MAC algorithms called
   <KeyProvServerFinished>.  For two-pass DSKPP, the confirmation
   message MUST include a Key Container Header (KCH) that are not supported by contains the
   DSKPP
      server.  This error Server's ID and KPM.  The ServerID is only valid in used for authentication
   purposes, and the KPM informs the DSKPP server's first
      response message.  Note that client of the error security
   context in which it will only occur if operate.  In addition to the
      DSKPP server does not support any of KCH, the DSKPP client's suggested
      MAC algorithms.
   o  "NoProtocolVariants" indicates that
   confirmation message MUST include the DSKPP client only
      suggested a protocol variant (either 2-pass or 4-pass) Key Container (KC) that is not
      supported by holds
   the DSKPP server.  This error KeyID, K_PROV from which K_TOKEN and K_MAC are derived, and
   additional configuration information.  The default symmetric key
   container format is only valid based on the Portable Symmetric Key Container
   (PSKC) defined in [PSKC].  Alternative formats MAY include PKCS#12
   [PKCS-12] or PKCS#5 XML [PKCS-5-XML].  Finally, <ServerFinished> MUST
   include two MACs (MAC and AD) whose values are calculated with
   contribution from the client nonce, R_C, provided in the
      DSKPP server's first response
   <ClientHello> message.  Note that the error  The MAC values will
      only occur if allow the DSKPP cryptographic
   module to perform key confirmation and server does not support any of authentication before
   "commiting" the DSKPP
      client's suggested protocol variants.
   o  "NoSupportedKeyContainers" indicates that key (see Section 3.2.3 for more information).

   After receiving a <KeyProvServerFinished> message with Status =
   "Success", the DSKPP client only
      suggested key container formats that are not supported by the MUST verify both MAC values (MAC and AD).
   The DSKPP server.  This error is only valid in client MUST terminate the DSKPP server's
      first response message.  Note that the error will only occur session if
      the DSKPP server either MAC does
   not support verify, and MUST, in this case, also delete any of nonces, keys,
   and/or secrets associated with the DSKPP client's
      suggested key container formats.
   o  "AuthenticationDataMissing" indicates that failed run of the DSKPP client didn't
      provide authentication data that protocol.  If
   <KeyProvServerFinished> has Status = "Success" and the DSKPP server required.
   o  "AuthenticationDataInvalid" indicates that MACs were
   verified, then the DSKPP client
      supplied user or device authentication data that the DSKPP server
      failed to validate.
   o  "InitializationFailed" indicates that MUST extract the DSKPP server could not
      generate a valid key given data from the
   provided data.  When key container, and store data locally.  After this status
      code is received, the DSKPP client SHOULD try to restart DSKPP, as
   operation, it is MUST NOT be possible that a new run will succeed.
   o  "ProvisioningPeriodExpired" indicates that to overwrite the provisioning period
      set key unless
   knowledge of an authorizing key is proven through a MAC on a later
   <KeyProvServerFinished> message.

3.2.2.  Key Protection Profiles

   This section introduces three profiles of two-pass DSKPP for key
   protection.  Further profiles MAY be defined by external entities or
   through the DSKPP server has expired.  When IETF process.

3.2.2.1.  Key Transport Profile

   This profile initializes the status code cryptographic module with a symmetric
   key, K_TOKEN, through key transport and key derivation.  The key
   transport is
      received, carried out using a public key, K_CLIENT, whose private
   key part resides in the DSKPP client SHOULD report cryptographic module as the transport key.  A
   key initialization
      failure reason to the user K_PROV from which two keys, K_TOKEN and the user K_MAC are derived MUST register be
   transported.

   This profile MUST be identified with the
      DSKPP server to initialize a new key.

8.  One-Pass Protocol following URN:
   urn:ietf:params:xml:schema:keyprov:protocol#transport

   In this section, example messages are used to describe parameters,
   encoding and semantics in the two-pass version of DSKPP, the client MUST send a 1-pass DSKPP protocol. payload
   associated with this key protection method.  The examples are
   written using XML.  While they are syntactically correct, MAC payload MUST be of
   type ds:KeyInfoType ([XMLDSIG]), and
   cipher values only those choices of the ds:
   KeyInfoType that identify a public key are fictitious.

8.1.  XML Basics allowed.  The DSKPP XML schema can be found in Section 13.  Some DSKPP elements
   rely on ds:
   X509Certificate option of the parties being able ds:X509Data alternative is RECOMMENDED
   when the public key corresponding to compare received values the private key on the
   cryptographic module has been certified.

   The server payload associated with stored
   values.  Unless otherwise noted, all elements in this document that
   have the XML Schema "xs:string" type, or a type derived from it, key protection method MUST be compared using an exact binary comparison.  In particular,
   of type xenc:EncryptedKeyType ([XMLENC]), and only those encryption
   methods utilizing a public key that are supported by the DSKPP
   implementations MUST NOT depend on case-insensitive string
   comparisons, normalization or trimming client
   (as indicated in the <SupportedEncryptionAlgorithms> element of white space, or conversion the
   <KeyProvClientHello> message in the case of locale-specific formats such 2-pass DSKPP) are allowed
   as numbers.

   Implementations that compare values that are represented using
   different character encodings for the <xenc:EncryptionMethod> element.  Further, in the
   case of 2-pass DSKPP, the <ds:KeyInfo> element MUST use a comparison contain the same
   value (i.e. identify the same public key) as the <Payload> of the
   corresponding supported key protection method in the
   <KeyProvClientHello> message that
   returns triggered the response.  The
   <CarriedKeyName> element MAY be present, but MUST, when present,
   contain the same result value as converting both values to the Unicode
   character encoding, Normalization Form C [UNICODE], and then
   performing an exact binary comparison.

   No collation or sorting order for attributes or <KeyID> element values is
   defined.  Therefore, DSKPP implementations MUST NOT depend on
   specific sorting orders for values.

8.2.  Server to Client Only: of the
   <KeyProvServerFinished>

8.2.1.  Example message.  The Server sends a provisioned key to a Type attribute of the xenc:
   EncryptedKeyType MUST be present and MUST identify the type of the
   wrapped key.  The type MUST be one of the types supported by the
   DSKPP client with prior knowledge
   about (as reported in the client's capabilities:

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvServerFinished Version="1.0" SessionID="4114" Status="Success"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
    keyprov-dskpp-1.0.xsd">
  <KeyContainer>
    <KeyContainer Version="1.0">
      <pskc:EncryptionMethod
        Algorithm="http://www.w3.org/2001/05/xmlenc#rsa_1_5">
        <pskc:KeyInfo>
          <ds:X509Data>
            <ds:X509Certificate>miib</ds:X509Certificate>
          </ds:X509Data>
        </pskc:KeyInfo>
      </pskc:EncryptionMethod>
      <pskc:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
      <Device xmlns="urn:ietf:params:xml:ns:keyprov:1.0:container">
        <Key KeyAlgorithm="urn:ietf:params:xml:schema:keyprov:otpalg#HOTP"
          KeyId="SDU312345678">
          <Issuer>CredentialIssuer</Issuer>
          <Usage otp="true">
            <ResponseFormat format="DECIMAL" length="6"/>
          </Usage>
          <FriendlyName>MyFirstToken</FriendlyName>
          <Data Name="SECRET">
            <Value>
              7JHUyp3azOkqJENSsh6b2vxXzwGBYypzJxEr+ikQAa229KV/BgZhGA==
            </Value>
            <ValueDigest>
              i8j+kpbfKQsSlwmJYS99lQ==
            </ValueDigest>
          </Data>
          <Data Name="COUNTER">
            <Value>AAAAAAAAAAA=</Value>
          </Data>
          <Expiry>10/30/2009</Expiry>
        </Key>
      </Device>
    </KeyContainer>
  </KeyContainer>
  <Mac MacAlgorithm="urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes">
    miidfasde312asder394jw==
  </Mac>
  <AuthenticationData>
    <AuthenticationCodeMac>
      <Mac>4bRJf9xXd3KchKoTenHJiw==</Mac>
    </AuthenticationCodeMac>
  </AuthenticationData>
</dskpp:KeyProvServerFinished>

8.2.2.  Components <SupportedKeyTypes> of a <KeyProvServerFinished> Response

   This the preceding
   <KeyProvClientHello> message is in the case of 2-pass DSKPP).  The
   transported key MUST consist of two parts of equal length.  The first
   half constitutes K_MAC and the last message second half constitutes K_TOKEN.  The
   length of K_TOKEN (and hence also the DSKPP protocol run.  In a
   4-pass exchange, length of K_MAC) is determined
   by the type of K_TOKEN.

   DSKPP server sends servers and cryptographic modules supporting this message in response to a
   <KeyProvClientNonce> message, whereas in a 2-pass exchange, profile MUST
   support the DSKPP
   server sends this message http://www.w3.org/2001/04/xmlenc#rsa-1_5 key-wrapping
   mechanism defined in response to a <KeyProvClientHello>
   message.  In a 1-pass exchange, the DSKPP server sends only [XMLENC].

   When this profile is used, the MacAlgorithm attribute of the <Mac>
   element of the <KeyProvServerFinished> message to MUST be present and
   MUST identify the client. selected MAC algorithm.  The components selected MAC algorithm
   MUST be one of this message have the
   following meaning:

   o  Version: (inherited from MAC algorithms supported by the AbstractResponseType type) The DSKPP
      version used client (as
   indicated in this session.
   o  SessionID: (inherited from the AbstractResponseType type) The
      previously established identifier for this session.
   o  Status: (inherited from <SupportedMacAlgorithms> element of the AbstractResponseType type) Return code
   <KeyProvClientHello> message in the case of 2-pass DSKPP).  The MAC
   MUST be calculated as described in Section 3.2 for Two-Pass DSKPP.

   In addition, DSKPP servers MUST include the AuthenticationDataType
   element in their <KeyProvServerFinished> message.  If Status is not
      "Success", only messages whenever a
   successful protocol run will result in an existing K_TOKEN being
   replaced.

3.2.2.2.  Key Wrap Profile

   This profile initializes the Status, SessionID, cryptographic module with a symmetric
   key, K_TOKEN, through key wrap and key derivation.  The key wrap MUST
   be carried out using a (symmetric) key-wrapping key, K_SHARED, known
   in advance by both the cryptographic module and the DSKPP server.  A
   key K_PROV from which two keys, K_TOKEN and Version attributes will K_MAC are derived MUST be present (the presence of
   wrapped.

   This profile MUST be identified with the SessionID attribute is dependent
      on following URI:
   urn:ietf:params:xml:schema:keyprov:protocol#wrap

   In the type 2-pass version of reported error); otherwise, all DSKPP, the other elements client MUST be present as well.  In this latter case, the
      <KeyProvServerFinished> message can be seen as send a "Commit" message,
      instructing the cryptographic module to store the generated payload
   associated with this key protection method.  The payload MUST be of
   type ds:KeyInfoType ([XMLDSIG]), and associate only those choices of the given ds:
   KeyInfoType that identify a symmetric key identifier are allowed.  The ds:
   KeyName alternative is RECOMMENDED.

   The server payload associated with this key.
   o  <KeyContainer>: The key container containing protection method MUST be
   of type xenc:EncryptedKeyType ([XMLENC]), and only those encryption
   methods utilizing a symmetric key values
      (in that are supported by the case DSKPP
   client (as indicated in the <SupportedEncryptionAlgorithms> element
   of a 2- or 1-pass exchange) and configuration data.
      The default container format is based on the KeyContainerType type
      from PSKC, <KeyProvClientHello> message in the case of 2-pass DSKPP) are
   allowed as defined values for the <xenc:EncryptionMethod> element.  Further,
   in [PSKC].
   o  <Extensions>: A list the case of extensions chosen by 2-pass DSKPP, the DSKPP server.
      For this message, this version <ds:KeyInfo> element MUST contain
   the same value (i.e. identify the same symmetric key) as the
   <Payload> of DSKPP defines one extension, the
      ClientInfoType (see Section 10).
   o  <Mac>: To avoid a false "Commit" corresponding supported key protection method in the
   <KeyProvClientHello> message causing that triggered the cryptographic
      module to end up in an initialized state for which response.  The
   <CarriedKeyName> element MAY be present, and MUST, when present,
   contain the server does
      not know same value as the <KeyID> element of the stored key,
   <KeyProvServerFinished> messages message.  The Type attribute of the xenc:
   EncryptedKeyType MUST
      always be authenticated with a MAC. present and MUST identify the type of the
   wrapped key.  The MAC type MUST be made using one of the already established MAC algorithm.
   o  <AuthenticationData>: This OPTIONAL element contains data that
      allows types supported by the
   DSKPP client to authenticate the DSKPP server.  The MAC
      value is calculated with K_MAC' as specified (as reported in Section 4.5.3.
      When receiving a <KeyProvServerFinished> message with
      Status="Success" for which the MAC verifies, <SupportedKeyTypes> of the DSKPP client MUST
      associate preceding
   <KeyProvClientHello> message in the generated case of 2-pass DSKPP).  The
   wrapped key MUST consist of two parts of equal length.  The first
   half constitutes K_MAC and the second half constitutes K_TOKEN.  The
   length of K_TOKEN with (and hence also the provided key
      identifier length of K_MAC) is determined
   by the type of K_TOKEN.

   DSKPP servers and store cryptographic modules supporting this data permanently.  After profile MUST
   support the http://www.w3.org/2001/04/xmlenc#kw-aes128 key-wrapping
   mechanism defined in [XMLENC].

   When this operation,
      it profile is used, the MacAlgorithm attribute of the <Mac>
   element of the <KeyProvServerFinished> message MUST not be possible to overwrite present and
   MUST identify the key unless knowledge of
      an authorizing key is proven through a selected MAC on a later
      <KeyProvServerHello> (and <KeyProvServerFinished>) message. algorithm.  The DSKPP client selected MAC algorithm
   MUST verify be one of the MAC.  The DSKPP client MUST
      terminate MAC algorithms supported by the DSKPP session if the MAC does not verify, and MUST,
      in this case, also delete any nonces, keys, and/or secrets
      associated with client (as
   indicated in the failed run <SupportedMacAlgorithms> element of the DSKPP protocol.
      The MacType's MacAlgorithm attribute MUST, when present, identify
   <KeyProvClientHello> message in the negotiated case of 2-pass DSKPP).  The MAC algorithm.

9.  Trigger
   MUST be calculated as described in Section 3.2.

   In this section, addition, DSKPP servers MUST include the AuthenticationDataType
   element in their <KeyProvServerFinished> messages whenever a
   successful protocol run will result in an example existing K_TOKEN being
   replaced.

3.2.2.3.  Passphrase-Based Key Wrap Profile

   This profile is used to describe parameters, encoding a variation of the key wrap profile.  It initializes
   the cryptographic module with a symmetric key, K_TOKEN, through key
   wrap and semantics in key derivation, using a DSKPP Trigger message. passphrase-derived key-wrapping key,
   K_DERIVED.  The example passphrase is written
   using XML.

9.1.  XML Basics

   The DSKPP XML schema can be found known in Section 13.  Some advance by both the device
   user and the DSKPP elements
   rely on server.  To preserve the parties being able property of not exposing
   K_TOKEN to compare received values with stored
   values.  Unless otherwise noted, all elements in this document that
   have any other entity than the XML Schema "xs:string" type, or DSKPP server and the
   cryptographic module itself, the method SHOULD be employed only when
   the device contains facilities (e.g. a type derived keypad) for direct entry of
   the passphrase.  A key K_PROV from it, which two keys, K_TOKEN and K_MAC
   are derived MUST be compared using an exact binary comparison.  In particular, DSKPP
   implementations wrapped.

   This profile MUST NOT depend on case-insensitive string
   comparisons, normalization or trimming of white space, or conversion
   of locale-specific formats such as numbers.

   Implementations that compare values that are represented using
   different character encodings be identified with the following URI:
   urn:ietf:params:xml:schema:keyprov:protocol#passphrase-wrap

   In the 2-pass version of DSKPP, the client MUST use send a comparison method payload
   associated with this key protection method.  The payload MUST be of
   type ds:KeyInfoType ([XMLDSIG]).  The ds:KeyName option MUST be used
   and the key name MUST identify the passphrase that
   returns will be used by
   the same result as converting both values server to generate the Unicode
   character encoding, Normalization Form C [UNICODE], and then
   performing key-wrapping key.  As an exact binary comparison.

   No collation or sorting order for attributes example, the
   identifier could be a user identifier or element values is
   defined.  Therefore, DSKPP implementations MUST NOT depend on
   specific sorting orders for values.

9.2.  Example

<dskpp:KeyProvTrigger Version="1.0"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:1.0:protocol
    keyprov-dskpp-1.0.xsd">
  <InitializationTrigger>
    <DeviceIdentifierData>
      <DeviceId>
        <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
        <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
        <pskc:Model>U2</pskc:Model>
      </DeviceId>
    </DeviceIdentifierData>
    <KeyID>SE9UUDAwMDAwMDAx</KeyID>
    <TokenPlatformInfo KeyLocation="Hardware" AlgorithmLocation="Software"/>
    <TriggerNonce>112dsdfwf312asder394jw==</TriggerNonce>
    <DSKPPServerUrl>https://www.somekeyprovservice.com/</DSKPPServerUrl>
  </InitializationTrigger>
</dskpp:KeyProvTrigger>

9.3.  Components of a registration identifier
   issued by the <KeyProvTrigger> Message

   The DSKPP server MAY initialize to the user during a session preceding the DSKPP
   protocol by sending a
   <KeyProvTrigger> message.  This message MAY, e.g., run.

   The server payload associated with this key protection method MUST be sent in
   response to
   of type xenc:EncryptedKeyType ([XMLENC]), and only those encryption
   methods utilizing a user requesting passphrase to derive the key-wrapping key initialization in a browsing
   session.

   The <KeyProvTrigger> element is intended for that
   are supported by the DSKPP client and MAY
   inform (as indicated in the DSKPP client about
   <SupportedEncryptionAlgorithms> element of the identifier <KeyProvClientHello>
   message in the case of 2-pass DSKPP) are allowed as values for the device
   <xenc:EncryptionMethod> element.  Further, in the case of 2-pass
   DSKPP, the <ds:KeyInfo> element MUST contain the same value (i.e.
   identify the same passphrase) as the <Payload> of the corresponding
   supported key protection method in the <KeyProvClientHello> message
   that
   houses triggered the cryptographic module to response.  The <CarriedKeyName> element MAY be initialized,
   present, and optionally of MUST, when present, contain the identifier for same value as the key on that module.  The latter would apply to
   key renewal.  The trigger always contains a nonce to allow
   <KeyID> element of the DSKPP
   server to couple <KeyProvServerFinished> message.  The Type
   attribute of the trigger with a later DSKPP <KeyProvClientHello>
   request.  Finally, xenc:EncryptedKeyType MUST be present and MUST
   identify the trigger MAY contain a URL to use when
   contacting type of the DSKPP server. wrapped key.  The <xs:any> elements are for future
   extensibility.  Any provided <DeviceIdentifierData> or <KeyID> values type MUST be used one of the
   types supported by the DSKPP client (as reported in the subsequent
   <KeyProvClientHello> request.  The OPTIONAL <TokenPlatformInfo>
   element informs
   <SupportedKeyTypes> of the DSKPP client about preceding <KeyProvClientHello> message in
   the characteristics case of the
   intended cryptographic module platform, 2-pass DSKPP).  The wrapped key MUST consist of two parts
   of equal length.  The first half constitutes K_MAC and applies in the public-key
   variant second
   half constitutes K_TOKEN.  The length of DSKPP in situations when K_TOKEN (and hence also the client potentially needs to
   decide which one
   length of several modules to initialize.

10.  Extensibility

10.1.  The ClientInfoType Type

   present in a <KeyProvClientHello> or a <KeyProvClientNonce> message, K_MAC) is determined by the OPTIONAL ClientInfoType extension contains DSKPP client-specific
   information. type of K_TOKEN.

   DSKPP servers MUST support and cryptographic modules supporting this extension.  DSKPP
   servers profile MUST NOT attempt to interpret
   support the data it carries and, if
   received, MUST include it unmodified PBES2 password based encryption scheme defined in
   [PKCS-5] (and identified as
   http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2 in
   [PKCS-5-XML]), the PBKDF2 passphrase-based key derivation function
   also defined in [PKCS-5] (and identified as
   http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbkdf2 in
   [PKCS-5-XML]), and the current protocol run's
   next server response.  Servers need not retain the ClientInfoType's
   data after that response has been generated.

10.2.  The ServerInfoType Type http://www.w3.org/2001/04/xmlenc#kw-aes128
   key-wrapping mechanism defined in [XMLENC].

   When present, the OPTIONAL ServerInfoType extension contains DSKPP
   server-specific information.  This extension this profile is only valid in
   <KeyProvServerHello> messages for which Status = "Continue".  DSKPP
   clients used, the MacAlgorithm attribute of the <Mac>
   element of the <KeyProvServerFinished> message MUST support this extension.  DSKPP clients be present and
   MUST NOT attempt
   to interpret identify the data it carries and, if received, selected MAC algorithm.  The selected MAC algorithm
   MUST include it
   unmodified in be one of the current protocol run's next client request (i.e., MAC algorithms supported by the <KeyProvClientNonce> message). DSKPP clients need not retain client (as
   indicated in the
   ServerInfoType's data after that request has been generated.  This
   extension MAY be used, e.g., for state management <SupportedMacAlgorithms> element of the
   <KeyProvClientHello> message in the DSKPP
   server.

10.3. case of 2-pass DSKPP).  The KeyInitializationDataType Type

   This extension is used for 2- and 1-pass DSKPP exchange; it carries
   an identifier for the selected key initialization method as well MAC
   MUST be calculated as
   key initialization method-dependent payload data.

   Servers MAY described in Section 3.2.

   In addition, DSKPP servers MUST include this extension the AuthenticationDataType
   element in a their <KeyProvServerFinished>
   message that is being sent in response to messages whenever a received
   <KeyProvClientHello> message if and only if that <KeyProvClientHello>
   message selected TwoPassSupport as the ProtocolVariantType and
   successful protocol run will result in an existing K_TOKEN being
   replaced.

3.2.3.  MAC Calculations

3.2.3.1.  Key Confirmation

   In two-pass DSKPP, the client indicated support for MUST include a nonce R in the selected key initialization method.
   Servers
   <KeyProvClientHello> message.  Further, the DSKPP server MUST include this extension
   its identifier, ServerID, in a the <KeyProvServerFinished> message that is sent as part of a 1-pass DSKPP.

   The elements of this type have (via
   the following meaning:

   o  <KeyInitializationMethod>: A two-pass key initialization method
      supported by Key Container).  The MAC value in the DSKPP client.
   o  <Payload>: A payload associated with <KeyProvServerFinished>
   message MUST be computed on the key initialization
      method.  Since (ASCII) string "MAC 1 computation",
   the syntax is a shorthand for <xs:element
      name="Payload" type="xs:anyType"/>, any well-formed payloads can
      be carried in this element.

11.  Key Initialization Profiles of Two- server identifier ServerID, and One-Pass DSKPP

11.1.  Introduction R using a MAC key K_MAC.  This appendix introduces three profiles of DSKPP for
   key
   initialization.  They MAY all MUST be provided together with K_TOKEN to the cryptographic
   module.

   If DSKPP-PRF is used for two- as well as one-pass
   initialization the MAC algorithm, then the input parameter s
   MUST consist of cryptographic modules.  Further profiles MAY the concatenation of the (ASCII) string "MAC 1
   computation" and R, and the parameter dsLen MUST be
   defined by external entities or through set to the IETF process.

11.2.  Key Transport Profile

11.2.1.  Introduction

   This profile initializes length
   of R:

   dsLen = len(R)

   MAC = DSKPP-PRF (K_MAC, "MAC 1 computation" || ServerID || R, dsLen)

3.2.3.2.  Server Authorization

   A MAC MUST be present in the cryptographic module with <KeyProvServerFinished> message as proof
   that the DSKPP server is authorized to provide a symmetric
   key, K_TOKEN, through key transport and new key derivation. to the
   cryptographic module.  In 2-pass DSKPP, servers include this MAC
   value in the AuthenticationDataType element of
   <KeyProvServerFinished>.  The MAC value in the AuthenticationDataType
   element MUST be computed on the (ASCII) string "MAC 1 computation",
   the server identifier ServerID, and R, using the existing MAC key
   transport is carried out using a public key, K_CLIENT, whose private
   key part resides in
   K_MAC' (the MAC key that existed before this protocol run).  The MAC
   algorithm MUST be the cryptographic module same as the transport key.  A algorithm used for key K from which two keys, K_TOKEN and K_MAC are derived confirmation
   purposes.

   If DSKPP-PRF is used as the MAC algorithm, then the input parameter s
   MUST be
   transported.

11.2.2.  Identification

   This profile consist of the concatenation of the (ASCII) string "MAC 1
   computation" ServerID, and R. The parameter dsLen MUST be identified with the following URN:

   urn:ietf:params:xml:schema:keyprov:protocol#transport

11.2.3.  Payloads

   In set to at
   least 16 (i.e. the two-pass version length of DSKPP, the client MAC MUST send be at least 16 octets):

   dsLen >= 16

   MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || ServerID || R, dsLen)

3.3.  User Authentication

   The DSKPP server MUST ensure that a payload generated key is associated with this key initialization method.  The payload MUST
   the correct cryptographic module, and if applicable, the correct
   user.  If the user has not been authenticated by some out-of-band
   means, then the user SHOULD be authenticated within the DSKPP.  For a
   further discussion of type ds:KeyInfoType ([XMLDSIG]), this, and only those choices of threats related to man-in-the-middle
   attacks in this context, see Section 9.

   When relying on DSKPP for user authentication, the ds:
   KeyInfoType DSKPP server
   SHOULD explicitly:

   o  Bind the user to the device (see Section 3.3.1, below)

   o  Rely on client-provided Authentication Data (AD) to verify that identify a public
      legitimate user is behind the wheel (see Section 3.3.2, below)

   NOTE: Device authentication can be handled implicitly by either
   relying on the device certificate for wrapping the key are allowed.  The ds:
   X509Certificate option of in the two-
   pass DSKPP Key Wrap Profile (seeSection 3.2.2), or by coupling the ds:X509Data alternative is RECOMMENDED
   when
   device certificate with the public key Authentication Code (see below).

3.3.1.  Device Identifier

   The DSKPP server MAY be pre-configured with a unique device
   identifier corresponding to the private key on the a particular cryptographic module has been certified. module.  The
   DSKPP server payload associated with MAY then include this key initialization method
   MUST be of type xenc:EncryptedKeyType ([XMLENC]), and only those
   encryption methods utilizing a public key that are supported by the
   DSKPP client (as indicated identifier in the <SupportedEncryptionAlgorithms>
   element of the <KeyProvClientHello> message DSKPP
   initialization trigger, in the which case of 2-pass
   DSKPP, or as otherwise known the DSKPP client MUST include
   it in its message(s) to the case of 1-pass DSKPP) are allowed
   as values DSKPP server for authentication.  Note
   that it is also legitimate for a DSKPP client to initiate the <xenc:EncryptionMethod> element.  Further, DSKPP
   protocol run without having received an initialization message from a
   server, but in the this case of 2-pass DSKPP, the <ds:KeyInfo> element any provided device identifier MUST contain the same
   value (i.e. identify the same public key) as NOT be
   accepted by the <Payload> of DSKPP server unless the
   corresponding supported server has access to a unique
   key initialization method in for the
   <KeyProvClientHello> message identified device and that triggered the response.  The
   <CarriedKeyName> element MAY key will be present, but MUST, when present,
   contain the same value as used in the <KeyID> element of
   protocol.

3.3.2.  Authentication Data

   As described in the
   <KeyProvServerFinished> message.  The Type attribute of message flows above (see Section 3.1.1 and
   Section 3.2.1), the xenc:
   EncryptedKeyType MUST DSKPP client MAY include Authentication Data (AD)
   in its request(s).  Note that AD MAY be present and MUST identify omitted if client certificate
   authentication has been provided by the type of transport channel such as
   TLS.  Nonetheless, when AD is provided, the
   wrapped key.  The type DSKPP server MUST be one of verify
   the types supported by data before continuing with the protocol run.  The DSKPP client (as reported in the <SupportedKeyTypes> of the preceding
   <KeyProvClientHello> message in the case
   generates AD through derivation of 2-pass DSKPP, or an Authentication Code (AC) as
   otherwise known in the case of 1-pass DSKPP).  The transported key
   MUST consist of two parts
   follows (see Section 3.3.2.2 for details):

   AD = HMAC(AC, K)

   AC is a one-time use value that is a special form of equal length.  The first half
   constitutes K_MAC a shared secret
   between a user and the second half constitutes K_TOKEN.  The
   length of K_TOKEN (and hence also the length of K_MAC) is determined
   by the type of K_TOKEN. DSKPP servers and cryptographic modules supporting this profile server.  This secret MUST
   support be made
   available to the http://www.w3.org/2001/04/xmlenc#rsa-1_5 key-wrapping
   mechanism defined client before or during DSKPP initiation.  Two ways
   in [XMLENC].

   When which this profile is used, MAY be done are:

   a.  A key issuer may deliver an AC to the MacAlgorithm attribute of user or device in response
       to a key request, which the <Mac>
   element of user enters into an application
       hosted on their device.  For example, a user runs an application
       that is resident on their device, e.g., a mobile phone.  The
       application cannot proceed without a new symmetric key.  The user
       is redirected to an issuer's Web site from where the <KeyProvServerFinished> message MUST be present user
       requests a key.  The issuer's Web application processes the
       request, and
   MUST identify returns an AC, which then appears on the selected MAC algorithm. user's
       display.  The selected MAC algorithm
   MUST be one of user then invokes a symmetric key-based application
       hosted on the MAC algorithms supported by device, which asks the user to input the AC using a
       keypad.  The application invokes the DSKPP client (as
   indicated in client, providing it
       with the <SupportedMacAlgorithms> element of AC.

   b.  The provisioning server may send a trigger message,
       <KeyProvTrigger>, to the
   <KeyProvClientHello> message in DSKPP client, which and set the case value of 2-pass DSKPP, or as
   otherwise known in
       the case of 1-pass DSKPP).  The MAC trigger nonce, R_TRIGGER, to AC.  When this method is used, a
       transport providing privacy and integrity MUST be
   calculated as described in Section 4.4 for Two-Pass used to deliver
       the DSKPP and
   Section 4.5 for One-Pass DSKPP.

   In addition, initialization trigger from the DSKPP servers MUST include server to the AuthenticationDataType
   element in their <KeyProvServerFinished> messages whenever a
   successful protocol run will result in
       DSKPP client, e.g.  HTTPS.

   Note that when an existing K_TOKEN being
   replaced.

11.3.  Key Wrap Profile

11.3.1.  Introduction

   This profile initializes the cryptographic module with a issuer delegates symmetric
   key, K_TOKEN, through key wrap and key derivation.  The key wrap MUST
   be carried out using provisioning to a (symmetric) key-wrapping key, K_SHARED, known
   in advance by
   third party provisioning service provider, both the cryptographic module client authentication
   and issuer authentication are required by the DSKPP provisioning server.  A
   key K from which two keys, K_TOKEN and K_MAC are derived MUST be
   wrapped.

11.3.2.  Identification

   This profile MUST
   Client authentication to the issuer MAY be identified with in-band or out-of-band as
   described above.  The issuer acts as a proxy for the following URI:

   urn:ietf:params:xml:schema:keyprov:protocol#wrap

11.3.3.  Payloads

   In provisioning
   server.  The issuer authenticates to the 2-pass version provisioning service
   provider either using a certificate or a pre-established secret key.

   A description of DSKPP, the client MUST send AC and how it is used to derive AD is contained
   in the sub-sections below.

3.3.2.1.  Authentication Code Format

   At a payload
   associated with this key initialization method.  The payload minimum, the AC MUST be
   of type ds:KeyInfoType ([XMLDSIG]), and only those choices of contain the ds:
   KeyInfoType following parameters:

   identifier:  A globally unique identifier that identify a symmetric represents the user's
       key are allowed.  The ds:
   KeyName alternative is RECOMMENDED. request.  The server payload associated with this key initialization method
   MUST MAY be of type xenc:EncryptedKeyType ([XMLENC]), and only those
   encryption methods utilizing generated as a symmetric key sequence number.

   password:  A unique value that are supported SHOULD be generated by the DSKPP client (as indicated system as a
       random number to make AC more difficult to guess.

   checksum:  The checksum SHOULD be calculated from the remaining
       digits in the <SupportedEncryptionAlgorithms>
   element of AC.

   The Issuer MUST rely on a Tag-Length-Value (TLV) format to represent
   the <KeyProvClientHello> message in AC, such as:

      Tag = 0x01 = password
      Tag = 0x02 = identifier
      Tag = 0x03 = checksum

   where one (or two) byte(s) MAY be used to indicate the case L(ength) of 2-pass
   DSKPP, or as otherwise known in
   the case of 1-pass DSKPP) are allowed V(alue) field.

3.3.2.2.  MAC Calculation

   The Authentication Data is a MAC that is derived from AC as values follows
   (refer to Section 3.4 for the <xenc:EncryptionMethod> element.  Further, a description of DSKPP-PRF in the
   case general and
   Appendix C for a description of 2-pass DSKPP-PRF-AES):

   MAC = DSKPP-PRF-AES(K_AC, AC->Identifier||URL_S||R_C||[R_S], 16)

   In four-pass DSKPP, the <ds:KeyInfo> element MUST contain the same
   value (i.e. identify the same symmetric key) as cryptographic module uses R_C, R_S, and
   URL_S, to calculate the <Payload> of MAC.  In two-pass DSKPP, the
   corresponding supported key initialization method cryptographic
   module does not have access to R_S, therefore only R_C is used in the
   <KeyProvClientHello> message that triggered the response.  The
   <CarriedKeyName> element
   combination with URL_S to produce the MAC.  In either case, K_AC MAY
   be present, and MUST, when present,
   contain the same value derived from AC>password as the <KeyID> element follows [PKCS-5]:

   K_AC = PBKDF2(AC->password, R_C || [K], c, 16)

   K MAY be one of the
   <KeyProvServerFinished> message. following:

      K_CLIENT: The Type attribute of the xenc:
   EncryptedKeyType MUST be present device public key when a device certificate is
      available and MUST identify the type of the
   wrapped key. used for key transport in 2-pass

      K_SHARED: The type MUST be one of the types supported by shared key between the
   DSKPP client (as reported in the <SupportedKeyTypes> of and the preceding
   <KeyProvClientHello> message server when it
      is used for key wrap in the case of 2-pass DSKPP, two-pass or as
   otherwise known for R_C protection in the case of 1-pass DSKPP).  The wrapped four-
      pass

      K_DERIVED: When a passphrase-derived key MUST
   consist of two parts of equal length.  The first half constitutes
   K_MAC is used for key wrap in
      two-pass DSKPP.

   Finally, c is iteration count between 10 and 1000.

3.4.  The DSKPP One-Way Pseudorandom Function, DSKPP-PRF

3.4.1.  Introduction

   All of the second half constitutes K_TOKEN. protocol variations depend on DSKPP-PRF.  The general
   requirements on DSKPP-PRF are the same as on keyed hash functions: It
   MUST take an arbitrary length input, and be one-way and collision-
   free (for a definition of K_TOKEN
   (and hence also these terms, see, e.g., [FAQ]).  Further,
   the length DSKPP-PRF function MUST be capable of K_MAC) is determined by generating a variable-
   length output, and its output MUST be unpredictable even if other
   outputs for the type same key are known.

   It is assumed that any realization of
   K_TOKEN.

   DSKPP servers DSKPP-PRF takes three input
   parameters: A secret key k, some combination of variable data, and cryptographic modules supporting this profile MUST
   support the http://www.w3.org/2001/04/xmlenc#kw-aes128 key-wrapping
   mechanism defined in [XMLENC].

   When this profile is used,
   the MacAlgorithm attribute desired length of the <Mac>
   element output.  The combination of the <KeyProvServerFinished> message MUST variable data
   can, without loss of generalization, be present considered as a salt value
   (see PKCS#5 Version 2.0 [PKCS-5], Section 4), and
   MUST identify the selected MAC algorithm.  The selected MAC algorithm
   MUST be one this
   characterization of the MAC DSKPP-PRF SHOULD fit all actual PRF algorithms supported
   implemented by cryptographic modules.  From the DSKPP client (as
   indicated in the <SupportedMacAlgorithms> element point of view of this
   specification, DSKPP-PRF is a "black-box" function that, given the
   <KeyProvClientHello> message in
   inputs, generates a pseudorandom value.

   Separate specifications MAY define the case implementation of 2-pass DSKPP, or as
   otherwise known in the case DSKPP-PRF
   for various types of 1-pass DSKPP).  The MAC MUST be
   calculated as described cryptographic modules.  Appendix C contains two
   example realizations of DSKPP-PRF.

3.4.2.  Declaration

   DSKPP-PRF (k, s, dsLen)

   Input:

   k     secret key in Section 4.4.

   In addition, DSKPP servers MUST include octet string format
   s     octet string of varying length consisting of variable data
         distinguishing the AuthenticationDataType
   element in their <KeyProvServerFinished> messages whenever a
   successful protocol run will result in an existing K_TOKEN particular string being
   replaced.

11.4.  Passphrase-Based Key Wrap Profile

11.4.1.  Introduction

   This profile is a variation derived
   dsLen desired length of the output

   Output:

   DS    pseudorandom string, dsLen-octets long
   For the purposes of this document, the secret key wrap profile.  It initializes k MUST be at least
   16 octets long.

3.5.  Encryption of Pseudorandom Nonces Sent from the cryptographic module DSKPP Client

   DSKPP client random nonce(s) are either encrypted with a symmetric key, K_TOKEN, through key
   wrap and the public key derivation, using a passphrase-derived key-wrapping key,
   K_DERIVED.  The passphrase is known in advance
   provided by both the device
   user and the DSKPP server.  To preserve server or by a shared secret key.  For example,
   in the property case of not exposing
   K_TOKEN a public RSA key, an RSA encryption scheme from PKCS
   #1 [PKCS-1] MAY be used.

   In the case of a shared secret key, to any avoid dependence on other entity than
   algorithms, the DSKPP server and client MAY use the
   cryptographic module itself, DSKPP-PRF function described
   herein with the method shared secret key K_SHARED as input parameter K (in
   this case, K_SHARED SHOULD be employed only when
   the device contains facilities (e.g. a keypad) used solely for direct entry this purpose), the
   concatenation of the passphrase.  A key K from which two keys, K_TOKEN (ASCII) string "Encryption" and K_MAC are
   derived MUST be wrapped.

11.4.2.  Identification

   This profile MUST be identified with the following URI:

   urn:ietf:params:xml:schema:keyprov:protocol#passphrase-wrap

11.4.3.  Payloads

   In server's
   nonce R_S as input parameter s, and dsLen set to the 2-pass version length of DSKPP, the client MUST send R_C:

   dsLen = len(R_C)

   DS = DSKPP-PRF(K_SHARED, "Encryption" || R_S, dsLen)
   This will produce a payload
   associated pseudorandom string DS of length equal to R_C.
   Encryption of R_C MAY then be achieved by XOR-ing DS with this key initialization method. R_C:

   E(DS, R_C) = DS ^ R_C

   The payload MUST DSKPP server will then perform the reverse operation to extract
   R_C from E(DS, R_C).

4.  DSKPP Message Formats

   The message formats from the DSKPP XML schema, found in Section 7,
   are explained in this section.  Examples can be
   of type ds:KeyInfoType ([XMLDSIG]). found in Appendix A.
   The ds:KeyName option MUST XML format for DSKPP messages have been designed to be
   used and the key name MUST identify the passphrase
   extensible.  However, it is possible that the use of extensions will
   harm interoperability; therefore, any use of extensions SHOULD be used
   by the server to generate the key-wrapping key.  As an
   carefully considered.  For example, the
   identifier could be a user identifier or a registration identifier
   issued by the server to the user during if a session preceding particular implementation
   relies on the DSKPP
   protocol run.

   The server payload associated with this key initialization method
   MUST be presence of type xenc:EncryptedKeyType ([XMLENC]), and only those
   encryption methods utilizing a passphrase proprietary extension, then it may not be
   able to derive the key-wrapping
   key interoperate with independent implementations that are supported by the DSKPP client (as indicated in the
   <SupportedEncryptionAlgorithms> element have no
   knowledge of this extension.

4.1.  General XML Schema Requirements

   Some DSKPP elements rely on the <KeyProvClientHello>
   message parties being able to compare
   received values with stored values.  Unless otherwise noted, all
   elements in this document that have the case XML Schema "xs:string" type,
   or a type derived from it, MUST be compared using an exact binary
   comparison.  In particular, DSKPP implementations MUST NOT depend on
   case-insensitive string comparisons, normalization or trimming of 2-pass DSKPP,
   white space, or as otherwise known in the
   case conversion of 1-pass DSKPP) are allowed locale-specific formats such as
   numbers.

   Implementations that compare values for the <xenc:
   EncryptionMethod> element.  Further, in the case of 2-pass DSKPP, the
   <ds:KeyInfo> element that are represented using
   different character encodings MUST contain the same value (i.e. identify the
   same passphrase) as the <Payload> of the corresponding supported key
   initialization method in the <KeyProvClientHello> message use a comparison method that
   triggered the response.  The <CarriedKeyName> element MAY be present,
   and MUST, when present, contain
   returns the same value result as converting both values to the <KeyID> element
   of the <KeyProvServerFinished> message.  The Type attribute of the
   xenc:EncryptedKeyType MUST be present Unicode
   character encoding, Normalization Form C [UNICODE], and then
   performing an exact binary comparison.

   No collation or sorting order for attributes or element values is
   defined.  Therefore, DSKPP implementations MUST identify the type NOT depend on
   specific sorting orders for values.

4.2.  Components of the wrapped key. <KeyProvTrigger> Message

   The type MUST be one of the types supported by the DSKPP client (as reported in the <SupportedKeyTypes> of server MAY initialize the preceding
   <KeyProvClientHello> DSKPP protocol by sending a
   <KeyProvTrigger> message.  This message MAY, e.g., be sent in the case of 2-pass DSKPP, or as
   otherwise known in the case of 1-pass DSKPP).  The wrapped
   response to a user requesting key MUST
   consist of two parts of equal length.  The first half constitutes
   K_MAC and the second half constitutes K_TOKEN. initialization in a browsing
   session.

   <xs:element name="KeyProvTrigger" type="dskpp:KeyProvTriggerType">
   </xs:element>
   <xs:complexType name="KeyProvTriggerType">
     <xs:sequence>
       <xs:choice>
         <xs:element name="InitializationTrigger"
           type="dskpp:InitializationTriggerType" />
         <xs:any namespace="##other" processContents="strict" />
       </xs:choice>
     </xs:sequence>
     <xs:attribute name="Version" type="dskpp:VersionType" />
   </xs:complexType>

   <xs:complexType name="InitializationTriggerType">
     <xs:sequence>
       <xs:element minOccurs="0" name="DeviceIdentifierData"
         type="dskpp:DeviceIdentifierDataType" />
       <xs:element minOccurs="0" name="KeyID" type="xs:base64Binary" />
       <xs:element minOccurs="0" name="TokenPlatformInfo"
         type="dskpp:TokenPlatformInfoType" />
       <xs:element name="TriggerNonce" type="dskpp:NonceType" />
       <xs:element minOccurs="0" name="ServerUrl" type="xs:anyURI" />
       <xs:any minOccurs="0" namespace="##other"
         processContents="strict" />
     </xs:sequence>
   </xs:complexType>

   The length of K_TOKEN
   (and hence also the length of K_MAC) <KeyProvTrigger> element is determined by the type of
   K_TOKEN.

   DSKPP servers and cryptographic modules supporting this profile MUST
   support the PBES2 password based encryption scheme defined in
   [PKCS-5] (and identified as
   http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2 in
   [PKCS-5-XML]), intended for the PBKDF2 passphrase-based key derivation function
   also defined in [PKCS-5] (and identified as
   http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbkdf2 in
   [PKCS-5-XML]), DSKPP client and MAY
   inform the http://www.w3.org/2001/04/xmlenc#kw-aes128
   key-wrapping mechanism defined in [XMLENC].

   When this profile is used, DSKPP client about the MacAlgorithm attribute of identifier for the <Mac>
   element of device that
   houses the <KeyProvServerFinished> message MUST cryptographic module to be present initialized, and
   MUST identify optionally of
   the selected MAC algorithm. identifier for the key on that module.  The selected MAC algorithm latter would apply to
   key renewal.  The trigger always contains a nonce to allow the DSKPP
   server to couple the trigger with a later DSKPP <KeyProvClientHello>
   request.  Finally, the trigger MAY contain a URL to use when
   contacting the DSKPP server.  The <xs:any> elements are for future
   extensibility.  Any provided <DeviceIdentifierData> or <KeyID> values
   MUST be one of the MAC algorithms supported used by the DSKPP client (as
   indicated in the <SupportedMacAlgorithms> subsequent
   <KeyProvClientHello> request.  The OPTIONAL <TokenPlatformInfo>
   element of informs the
   <KeyProvClientHello> message in DSKPP client about the case characteristics of 2-pass DSKPP, or as
   otherwise known the
   intended cryptographic module platform, and applies in the case public-key
   variant of 1-pass DSKPP).  The MAC MUST be
   calculated as described in Section 4.4.

   In addition, DSKPP servers MUST include the AuthenticationDataType
   element in their <KeyProvServerFinished> messages whenever a
   successful protocol run will result in an existing K_TOKEN being
   replaced.

12.  Protocol Bindings

12.1.  General Requirements

   DSKPP assumes a reliable transport.

12.2.  HTTP/1.1 Binding for DSKPP

12.2.1.  Introduction

   This section presents a binding of the previous messages to HTTP/1.1
   [RFC2616].  Note that situations when the HTTP client normally will be different from potentially needs to
   decide which one of several modules to initialize.

4.3.  Components of the DSKPP client, i.e., <KeyProvClientHello> Request

   This message is the HTTP client will only exist to "proxy"
   DSKPP messages initial message sent from the DSKPP client to the
   DSKPP server.  Likewise,
   on the HTTP server side, the DSKPP server MAY receive DSKPP PDUs from
   a "front-end" HTTP server.

12.2.2.  Identification in both variants of DSKPP Messages the DSKPP.

   <xs:element name="KeyProvClientHello"
     type="dskpp:KeyProvClientHelloPDU">
   </xs:element>

   <xs:complexType name="KeyProvClientHelloPDU">
     <xs:complexContent mixed="false">
       <xs:extension base="dskpp:AbstractRequestType">
         <xs:sequence>
           <xs:element minOccurs="0" name="DeviceIdentifierData"
             type="dskpp:DeviceIdentifierDataType" />
           <xs:element minOccurs="0" name="KeyID"
             type="xs:base64Binary" />
           <xs:element minOccurs="0" name="ClientNonce"
             type="dskpp:NonceType" />
           <xs:element minOccurs="0" name="TriggerNonce"
             type="dskpp:NonceType" />
           <xs:element name="SupportedKeyTypes"
             type="dskpp:AlgorithmsType" />
           <xs:element name="SupportedEncryptionAlgorithms"
             type="dskpp:AlgorithmsType" />
           <xs:element name="SupportedMacAlgorithms"
             type="dskpp:AlgorithmsType" />
           <xs:element minOccurs="0" name="SupportedProtocolVariants"
             type="dskpp:ProtocolVariantsType" />
           <xs:element minOccurs="0" name="SupportedKeyContainers"
             type="dskpp:KeyContainersFormatType" />
           <xs:element minOccurs="0" name="AuthenticationData"
             type="dskpp:AuthenticationDataType" />
           <xs:element minOccurs="0" name="Extensions"
             type="dskpp:ExtensionsType" />
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   The MIME-type for all DSKPP messages MUST be

   application/vnd.ietf.keyprov.dskpp+xml

12.2.3.  HTTP Headers

   HTTP proxies MUST NOT cache responses carrying DSKPP messages.  For components of this reason, message have the following holds: meaning:

   o  When using HTTP/1.1, requesters SHOULD:
      *  Include a Cache-Control header field set to "no-cache, no-
         store".
      *  Include a Pragma header field set to "no-cache".  Version: (attribute inherited from the AbstractRequestType type)
      The highest version of this protocol the client supports.  Only
      version one ("1.0") is currently specified.
   o  When using HTTP/1.1, responders SHOULD:
      *  Include a Cache-Control header field set to "no-cache, no-must-
         revalidate, private".
      *  Include a Pragma header field set to "no-cache".
      *  NOT include a Validator, such  <DeviceIdentifierData>: An identifier for the cryptographic module
      as a Last-Modified defined in Section 3.3 above.  The identifier MUST only be
      present if such shared secrets exist or ETag
         header.
   There are no other restrictions on HTTP headers, besides if the
   requirement to set identifier was
      provided by the server in a <KeyProvTrigger> element (see
      Section 6.2.7).  In the latter case, it MUST have the Content-Type header same value according to
   Section 12.2.2.

12.2.4.  HTTP Operations

   Persistent connections
      as defined the identifier provided in HTTP/1.1 are assumed but not
   required.  DSKPP requests are mapped to HTTP POST operations.  DSKPP
   responses are mapped to HTTP responses.

12.2.5.  HTTP Status Codes

   A DSKPP HTTP responder that refuses to perform a message exchange
   with a DSKPP HTTP requester SHOULD return a 403 (Forbidden) response.
   In this case, element.

   o  <KeyID>: An identifier for the content of key that will be overwritten if the HTTP body
      protocol run is not significant.  In successful.  The identifier MUST only be present
      if the case of an HTTP error while processing a DSKPP request, key exists or if the identifier was provided by the HTTP server
      in a <KeyProvTrigger> element, in which case, it MUST return have the
      same value as the identifier provided in that element (see a 500 (Internal Server Error) response.
      (Section 4.2) and Section 6.2.7).
   o  <ClientNonce>: This type
   of error SHOULD be returned for HTTP-related errors detected before
   control is passed to the DSKPP processor, or nonce R, which, when present, MUST be
      used by the DSKPP processor
   reports an internal error (for example, the DSKPP XML namespace server when calculating MAC values (see below).  It is
   incorrect, or
      RECOMMENDED that clients include this element whenever the DSKPP schema cannot <KeyID>
      element is present.
   o  <TriggerNonce>: This OPTIONAL element MUST be located).  If present if and only
      if the type of a DSKPP request cannot be determined, run was initialized with a <KeyProvTrigger> message
      (see Section 6.2.7), and MUST, in that case, have the DSKPP responder same value
      as the <TriggerNonce> child of that message.  A server using
      nonces in this way MUST return a
   400 (Bad request) response.

   In these cases (i.e., when verify that the HTTP response code nonce is 4xx valid and that
      any device or 5xx), key identifier values provided in the
   content
      <KeyProvTrigger> message match the corresponding identifier values
      in the <KeyProvClientHello> message.
   o  <SupportedKeyTypes>: A sequence of URLs indicating the HTTP body is not significant.

   Redirection status codes (3xx) apply as usual.

   Whenever key types
      for which the HTTP POST cryptographic module is successfully invoked, willing to generate keys
      through DSKPP.
   o  <SupportedEncryptionAlgorithms>: A sequence of URLs indicating the
      encryption algorithms supported by the cryptographic module for
      the purposes of DSKPP.  The DSKPP HTTP
   responder MUST use client MAY indicate the 200 status code and provide same
      algorithm both as a suitable DSKPP
   message (possibly with DSKPP error information included) in supported key type and as an encryption
      algorithm.
   o  <SupportedMacAlgorithms>: A sequence of URLs indicating the HTTP
   body.

12.2.6.  HTTP Authentication

   No support MAC
      algorithms supported by the cryptographic module for HTTP/1.1 authentication is assumed.

12.2.7.  Initialization the purposes
      of DSKPP DSKPP.  The DSKPP server client MAY initialize indicate the DSKPP protocol by sending same algorithm both
      as an HTTP
   response with Content-Type set according to Section 12.2.2 encryption algorithm and
   response code set to 200 (OK). as a MAC algorithm (e.g.,
      http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes, which is defined
      in Appendix C).
   o  <SupportedProtocolVariants>: This message MAY, e.g., OPTIONAL element is used by the
      DSKPP client to indicate support for four-pass or two-pass DSKPP.
      If two-pass support is specified, then <KeyProvClientNonce> MUST
      be sent in
   response set to a user requesting key initialization nonce R in a browsing
   session.  The initialization the <KeyProvClientHello> message MAY carry data in its body.  If
   this unless
      <TriggerNonce> is already present.
   o  <SupportedKeyContainers>: This OPTIONAL element is the case, the data MUST be a valid instance sequence of a
   <KeyProvTrigger> element.

12.2.8.  Example Messages

   a.  Initialization from
      URLs indicating the key container formats supported by the DSKPP server:
       HTTP/1.1 200 OK

       Cache-Control: no-store
       Content-Type: application/vnd.ietf.keyprov.dskpp+xml
       Content-Length: <some value>
      client.  If this element is not provided, then the DSKPP initialization server
      MUST proceed with "http://www.ietf.org/keyprov/pskc#KeyContainer"
      (see [PSKC]).
   o  <AuthenticationData>: This OPTIONAL element contains data in XML form...

   b.  Initial request from that the
      DSKPP client:
       POST http://example.com/cgi-bin/DSKPP-server HTTP/1.1
       Cache-Control: no-store
       Pragma: no-cache
       Host: example.com
       Content-Type: application/vnd.ietf.keyprov.dskpp+xml
       Content-Length: <some value> client uses to authenticate the user or device to the DSKPP data
      server.  The element is set as specified in XML form (supported version, supported
       algorithms...)

   c.  Initial response from DSKPP server:
       HTTP/1.1 200 OK

       Cache-Control: no-store
       Content-Type: application/vnd.ietf.keyprov.dskpp+xml
       Content-Length: <some value>

       DSKPP data Section 3.3.
   o  <Extensions>: A sequence of extensions.  One extension is defined
      for this mesolsage in XML form (server random nonce, server public key,
       ...)

13.  DSKPP Schema

<?xml version="1.0" encoding="UTF-8"?>

 <xs:schema
   xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
   xmlns:pskc="urn:ietf:params:xml:ns:keyprov:1.0:container"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
   targetNamespace="urn:ietf:params:xml:ns:keyprov:1.0:protocol"
   elementFormDefault="unqualified" attributeFormDefault="unqualified"
   version="1.0">

   <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
     schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>

   <xs:import namespace="urn:ietf:params:xml:ns:keyprov:1.0:container"
     schemaLocation="keyprov-pskc-1.0.xsd"/>

   <!-- Basic types -->
   <xs:complexType name="AbstractRequestType" abstract="true">
     <xs:attribute name="Version" type="dskpp:VersionType" use="required"/>
   </xs:complexType>

   <xs:complexType name="AbstractResponseType" abstract="true">
     <xs:attribute name="Version" type="dskpp:VersionType" use="required"/>
     <xs:attribute name="SessionID" type="dskpp:IdentifierType"/>
     <xs:attribute name="Status" type="dskpp:StatusCode" use="required"/>
   </xs:complexType>

   <xs:simpleType name="VersionType">
     <xs:restriction base="xs:string">
       <xs:pattern value="\d{1,2}\.\d{1,3}"/>
     </xs:restriction>
   </xs:simpleType>

   <xs:simpleType name="IdentifierType">
     <xs:restriction base="xs:string">
       <xs:maxLength value="128"/>
     </xs:restriction>
   </xs:simpleType>

   <xs:simpleType name="StatusCode">
     <xs:restriction base="xs:string">
       <xs:enumeration value="Continue"/>
       <xs:enumeration value="Success"/>
       <xs:enumeration value="Abort"/>
       <xs:enumeration value="AccessDenied"/>
       <xs:enumeration value="MalformedRequest"/>
       <xs:enumeration value="UnknownRequest"/>
       <xs:enumeration value="UnknownCriticalExtension"/>
       <xs:enumeration value="UnsupportedVersion"/>
       <xs:enumeration value="NoSupportedKeyTypes"/>
       <xs:enumeration value="NoSupportedEncryptionAlgorithms"/>
       <xs:enumeration value="NoSupportedMacAlgorithms"/>
       <xs:enumeration value="NoProtocolVariants"/>
       <xs:enumeration value="NoSupportedKeyContainers"/>
       <xs:enumeration value="AuthenticationDataMissing"/>
       <xs:enumeration value="AuthenticationDataInvalid"/>
       <xs:enumeration value="InitializationFailed"/>
     </xs:restriction>
   </xs:simpleType> this version of DSKPP: the ClientInfoType
      (see Section 5).

   Some of the core elements of the message are described below.

4.3.1.  The DeviceIdentifierDataType Type

   The DeviceIdentifierDataType type is used to uniquely identify the
   device that houses the cryptographic module, e.g., a mobile phone.
   The device identifier allows the DSKPP server to find, e.g., a pre-
   shared transport key for 2-pass DSKPP and/or the correct shared
   secret for MAC'ing purposes.  The default DeviceIdentifierDataType is
   defined in [PSKC].

   <xs:complexType name="DeviceIdentifierDataType">
     <xs:choice>
       <xs:element name="DeviceId" type="pskc:DeviceIdType"/> type="pskc:DeviceIdType" />
       <xs:any namespace="##other" processContents="strict"/> processContents="strict" />
     </xs:choice>
   </xs:complexType>

   <xs:simpleType name="PlatformType">
     <xs:restriction base="xs:string">
       <xs:enumeration value="Hardware"/>
       <xs:enumeration value="Software"/>
       <xs:enumeration value="Unspecified"/>
     </xs:restriction>
   </xs:simpleType>

   <xs:complexType name="TokenPlatformInfoType">
     <xs:attribute name="KeyLocation" type="dskpp:PlatformType"/>
     <xs:attribute name="AlgorithmLocation" type="dskpp:PlatformType"/>
   </xs:complexType>

   <xs:simpleType name="NonceType">
     <xs:restriction base="xs:base64Binary">
       <xs:minLength value="16"/>
     </xs:restriction>
   </xs:simpleType>

   <xs:complexType name="AlgorithmsType">
     <xs:sequence maxOccurs="unbounded">
       <xs:element name="Algorithm" type="dskpp:AlgorithmType"/>
     </xs:sequence>
   </xs:complexType>

   <xs:simpleType name="AlgorithmType">
     <xs:restriction base="xs:anyURI"/>
   </xs:simpleType>

4.3.2.  The ProtocolVariantsType Type

   The ProtocolVariantsType type is OPTIONAL for a DSKPP client, who MAY
   use it to indicate the number of passes of the DSKPP protocol that it
   supports.  The ProtocolVariantsType MAY be used to indicate support
   for 4-pass or 2-pass DSKPP.  If the ProtocolVariantsType is not used,
   then the DSKPP server will proceed with ordinary 4-pass DSKPP.
   However, if it does not support 4-pass DSKPP, then the server MUST
   find a suitable two-pass variation or else the protocol run will
   fail.

   Selecting the "TwoPass" element signals client support for the 2-pass
   version of DSKPP, informs the server of supported two-pass key
   protection methods, and provides OPTIONAL payload data to the DSKPP
   server.  The payload is sent in an opportunistic fashion, and MAY be
   discarded by the DSKPP server if the server does not support thekey
   protection method with which the payload is associated.

   <xs:complexType name="ProtocolVariantsType">
     <xs:sequence>
       <xs:element minOccurs="0" name="FourPass" minOccurs="0"/> />
       <xs:element minOccurs="0" name="TwoPass" type="dskpp:TwoPassSupportType"
         minOccurs="0"/>
       <xs:element name="OnePass" minOccurs="0"/>
         type="dskpp:KeyProtectionDataType"/>
     </xs:sequence>
   </xs:complexType>

   <xs:complexType name="TwoPassSupportType"> name="KeyProtectionDataType">
   <xs:complexContent mixed="false">
     <xs:sequence maxOccurs="unbounded">
       <xs:element name="SupportedKeyInitializationMethod" name="SupportedKeyProtectionMethod" type="xs:anyURI"/>
       <xs:element name="Payload" minOccurs="0"/> type="dskpp:PayloadType"
     </xs:sequence>
     </xs:complexContent>
   </xs:complexType>

   The elements of this type have the following meaning:

   o  <SupportedKeyProtectionMethod>: A two-pass key protection method
      supported by the DSKPP client.  Multiple supported methods MAY be
      present, in which case they MUST be listed in order of precedence.
   o  <Payload>: An OPTIONAL payload associated with each supported key
      protection method.

   A DSKPP client that indicates support for two-pass DSKPP MUST also
   include the nonce R in its <KeyProvClientHello> message (this will
   enable the client to verify that the DSKPP server it is communicating
   with is alive).

4.3.3.  The KeyContainersFormatType Type

   The OPTIONAL KeyContainersFormatType type is a list of type-value
   pairs that a DSKPP client or server MAY use to define key container
   formats it supports.  Key container formats are identified through
   URLs, e.g., the PSKC KeyContainer URL
   "http://www.ietf.org/keyprov/pskc#KeyContainer" (see [PSKC]).

   <xs:complexType name="KeyContainersFormatType">
     <xs:sequence maxOccurs="unbounded">
       <xs:element name="KeyContainerFormat"
       type="dskpp:KeyContainerFormatType"/>
     </xs:sequence>

   </xs:complexType>
   <xs:simpleType name="KeyContainerFormatType">
     <xs:restriction base="xs:anyURI"/> base="xs:anyURI" />
   </xs:simpleType>

   <xs:complexType name="AuthenticationDataType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Authentication data can consist of either

4.3.4.  The AuthenticationDataType Type

   The OPTIONAL AuthenticationDataType type is used by DSKPP clients and
   server to carry authentication values in DSKPP messages.  The element
   MAY contain a MAC derived from an authentication code
         for authenticating as follows:

   a.  A DSKPP client MAY include a user of one-time use AuthenticationCode that
       was given by the protocol, or an X.509 Certificate issuer to the user for
         authenticating a device. When acquiring a symmetric
       key.  An AuthenticationCode MAY contain alphanumeric characters
       in addition to numeric digits depending on the device type and
       policy of the issuer.  For example, if the device certificate is used over a
         transport layer that is not secure, mobile
       phone, a code that the user enters on the keypad would typically
       be restricted to numeric digits for ease of use.  An
       authentication code MAY be sent to the DSKPP server as MAC data
       calculated according to section Section 3.3.2.
   b.  A DSKPP server MAY use the AuthenticationDataType element
       AuthenticationCodeMac to carry a MAC for authenticating itself to
       the Signature is calculated over client.  For example, when a nonce value specified in ds:Signature/Object. When used successful 2-pass DSKPP protocol
       run will result in
         conjunction with an existing key being replaced, then the KeyProvServerFinished PDU, it contains DSKPP
       server MUST include a MAC
         authenticating proving to the DSKPP client that the
       server to knows the client.
       </xs:documentation>
     </xs:annotation> value of the key it is about to replace.

   <xs:complexType name="AuthenticationDataType">
     <xs:sequence>
       <xs:element minOccurs="0" name="ClientID"
         type="dskpp:IdentifierType"
                   minOccurs="0"/>
       <xs:choice minOccurs="0"> />
       <xs:element name="AuthenticationCodeMac"
                       type="dskpp:AuthenticationCodeMacType"/>
           <xs:element name="DigitalSignature"
                       type="ds:SignatureType"/>
       </xs:choice>
         type="dskpp:AuthenticationCodeMacType" />
     </xs:sequence>
   </xs:complexType>
   <xs:complexType name="AuthenticationCodeMacType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         An authentication MAC calculated from an authentication code and
         optionally server information as well as nonce value if they are
         available.
       </xs:documentation>
     </xs:annotation>
     <xs:sequence>
       <xs:element minOccurs="0" name="Nonce" type="dskpp:NonceType" minOccurs="0"/> />
       <xs:element minOccurs="0" name="IterationCount" type="xs:int" minOccurs="0"/> />
       <xs:element name="Mac" type="dskpp:MacType"/>
     </xs:sequence>
   </xs:complexType>

   <xs:complexType name="MacType">
     <xs:simpleContent>
       <xs:extension base="xs:base64Binary">
         <xs:attribute name="MacAlgorithm" type="xs:anyURI"/>
       </xs:extension>
     </xs:simpleContent>
   </xs:complexType>

   <xs:complexType name="KeyContainerType">
     <xs:sequence>
       <xs:element name="ServerID" type="xs:anyURI" minOccurs="0"/>
       <xs:choice>
         <xs:element name="KeyContainer" type="pskc:KeyContainerType"/>
         <xs:any namespace="##other" processContents="strict"/>
       </xs:choice>
     </xs:sequence>
   </xs:complexType>

   <xs:complexType name="InitializationTriggerType">
     <xs:sequence>
       <xs:element name="DeviceIdentifierData"
         type="dskpp:DeviceIdentifierDataType" minOccurs="0"/>
       <xs:element name="KeyID" type="xs:base64Binary" minOccurs="0"/>
       <xs:element name="TokenPlatformInfo"
         type="dskpp:TokenPlatformInfoType" minOccurs="0"/>
       <xs:element name="TriggerNonce" type="dskpp:NonceType"/>
       <xs:element name="DSKPPServerUrl" type="xs:anyURI" minOccurs="0"/>
       <xs:any namespace="##other" processContents="strict"
         minOccurs="0"/>
     </xs:sequence>
   </xs:complexType>

   <!-- Extension types -->
   <xs:complexType name="ExtensionsType">
     <xs:sequence maxOccurs="unbounded">
       <xs:element name="Extension" type="dskpp:AbstractExtensionType"/>
     </xs:sequence>
   </xs:complexType>

   <xs:complexType name="AbstractExtensionType" abstract="true">
     <xs:attribute name="Critical" type="xs:boolean"/>
   </xs:complexType>

   <xs:complexType name="ClientInfoType">
     <xs:complexContent>
       <xs:extension base="dskpp:AbstractExtensionType">
         <xs:sequence>
           <xs:element name="Data"
             type="xs:base64Binary"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="ServerInfoType">
     <xs:complexContent>
       <xs:extension base="dskpp:AbstractExtensionType">
         <xs:sequence>
           <xs:element name="Data"
             type="xs:base64Binary"/> type="dskpp:MacType" />
     </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="PayloadType">
     <xs:choice>
       <xs:element name="Nonce" type="dskpp:NonceType"/>
       <xs:any namespace="##other" processContents="strict"/>
     </xs:choice>
   </xs:complexType>

   <xs:complexType name="KeyInitializationDataType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         This extension is only valid

   The elements of the AuthenticationDataType type have the following
   meaning:

   o  <ClientID>: A requester's identifier.  The value MAY be a user ID,
      a device ID, or a keyID associated with the requester's
      authentication value.  Ifa <KeyProvTrigger> message was provided
      by the server to initiate the DSKPP protocol run, <ClientID> can
      be omitted, as the DeviceID, KeyID, and/or nonce provided in KeyProvServerFinished PDUs. It
         contains key initialization data the
      <InitializationTriggerType> element ought to be sufficient to
      identify the requester.
   o  <AuthenticationCodeMac>: An authentication MAC and its presence results in additional
      information (e.g., MAC algorithm).  This MAC MAY be derived as
      follows:
      *  User Authentication: A DSKPP client MAY include a
         two-pass (or one-pass, if no KeyProvClientHello one-time use
         AuthenticationCode that was sent) DSKPP
         exchange.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="dskpp:AbstractExtensionType">
         <xs:sequence>
           <xs:element name="KeyInitializationMethod" type="xs:anyURI"/>
           <xs:element name="Payload" type="dskpp:PayloadType"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <!-- DSKPP PDUs -->

   <xs:element name="KeyProvTrigger" type="dskpp:KeyProvTriggerType"/>

   <xs:complexType name="KeyProvTriggerType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Message used given by the issuer to trigger the user for
         acquiring a symmetric key.  An AuthenticationCode MAY contain
         alphanumeric characters in addition to numeric digits depending
         on the device type and policy of the issuer.  For example, if
         the device is a mobile phone, a code that the user enters on
         the keypad would typically be restricted to initiate numeric digits for
         ease of use.  An authentication code MAY be sent to the DSKPP
         server as MAC data calculated as described in section
         Section 3.3.2.
      *  Server Authorization (two-pass DSKPP only): A DSKPP server MUST
         include a MAC in its <KeyProvServerFinished> message as proof
         that the DSKPP server is authorized to provide a new key to the
         cryptographic module.  For example, when a successful 2-pass
         DSKPP protocol run.
       </xs:documentation>
     </xs:annotation>
     <xs:sequence>
       <xs:choice>
         <xs:element name="InitializationTrigger"
           type="dskpp:InitializationTriggerType"/>
         <xs:any namespace="##other" processContents="strict"/>
       </xs:choice>
     </xs:sequence>
     <xs:attribute name="Version" type="dskpp:VersionType"/>
   </xs:complexType>

   <!-- KeyProvClientHello PDU -->
   <xs:element name="KeyProvClientHello" type="dskpp:KeyProvClientHelloPDU"/>

   <xs:complexType name="KeyProvClientHelloPDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Message run will result in an existing key being
         replaced, then the DSKPP server MUST include the
         AuthenticationDataType element's AuthenticationCodeMac in its
         <KeyProvServerFinished> message.  For more information, refer
         to Section 3.2.3.2.

4.4.  Components of the <KeyProvServerHello> Response (Used Only in
      Four-Pass DSKPP)

   In a four-pass exchange, this message is the first message sent from
   the DSKPP server to the DSKPP client (assuming a trigger message has
   not been sent to initiate the protocol, in which case, this message
   is the second message sent from the DSKPP server to initiate a the DSKPP session.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="dskpp:AbstractRequestType">
         <xs:sequence>
           <xs:element name="DeviceIdentifierData"
             type="dskpp:DeviceIdentifierDataType" minOccurs="0"/>
           <xs:element name="KeyID" type="xs:base64Binary"
             minOccurs="0"/>
           <xs:element name="ClientNonce" type="dskpp:NonceType"
             minOccurs="0"/>
   client).  It is sent upon reception of a <KeyProvClientHello>
   message.

   <xs:element name="TriggerNonce" type="dskpp:NonceType"
             minOccurs="0"/> name="KeyProvServerHello"
     type="dskpp:KeyProvServerHelloPDU">
   </xs:element>
   <xs:complexType name="KeyProvServerHelloPDU">
     <xs:complexContent mixed="false">
       <xs:extension base="dskpp:AbstractResponseType">
         <xs:sequence minOccurs="0">
           <xs:element name="SupportedKeyTypes"
             type="dskpp:AlgorithmsType"/> name="KeyType" type="dskpp:AlgorithmType" />
           <xs:element name="SupportedEncryptionAlgorithms"
             type="dskpp:AlgorithmsType"/> name="EncryptionAlgorithm"
             type="dskpp:AlgorithmType" />
           <xs:element name="SupportedMacAlgorithms"
             type="dskpp:AlgorithmsType"/> name="MacAlgorithm" type="dskpp:AlgorithmType" />
           <xs:element name="SupportedProtocolVariants"
             type="dskpp:ProtocolVariantsType" minOccurs="0"/> name="EncryptionKey" type="ds:KeyInfoType" />
           <xs:element name="SupportedKeyContainers"
             type="dskpp:KeyContainersFormatType" minOccurs="0"/> name="KeyContainerFormat"
             type="dskpp:KeyContainerFormatType" />
           <xs:element name="AuthenticationData"
             type="dskpp:AuthenticationDataType" minOccurs="0"/> name="Payload" type="dskpp:PayloadType" />
           <xs:element minOccurs="0" name="Extensions"
             type="dskpp:ExtensionsType"
             minOccurs="0"/> />
           <xs:element minOccurs="0" name="Mac" type="dskpp:MacType" />
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <!-- KeyProvServerHello PDU -->
   <xs:element name="KeyProvServerHello" type="dskpp:KeyProvServerHelloPDU"/>

   <xs:complexType name="KeyProvServerHelloPDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Message sent

   The components of this message have the following meaning:

   o  Version: (attribute inherited from the AbstractResponseType type)
      The version selected by the DSKPP server to server.  MAY be lower than the
      version indicated by the DSKPP client client, in response which case, local policy
      at the client MUST determine whether or not to continue the
      session.
   o  SessionID: (attribute inherited from the AbstractResponseType
      type) An identifier for this session.
   o  Status: (attribute inherited from the AbstractResponseType type)
      Return code for the <KeyProvClientHello>.  If Status is not
      "Continue", only the Status and Version attributes will be
      present; otherwise, all the other element MUST be present as well.

   o  <KeyType>: The type of the key to be generated.
   o  <EncryptionAlgorithm>: The encryption algorithm to use when
      protecting R_C.
   o  <MacAlgorithm>: The MAC algorithm to be used by the DSKPP server.
   o  <EncryptionKey>: Information about the key to use when encrypting
      R_C. It will either be the server's public key (the <ds:KeyValue>
      alternative of ds:KeyInfoType) or an identifier for a received KeyProvClientHello PDU.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="dskpp:AbstractResponseType">
         <xs:sequence minOccurs="0">
           <xs:element name="KeyType"
             type="dskpp:AlgorithmType"/>
           <xs:element name="EncryptionAlgorithm"
             type="dskpp:AlgorithmType"/>
           <xs:element name="MacAlgorithm"
             type="dskpp:AlgorithmType"/>
           <xs:element name="EncryptionKey"
             type="ds:KeyInfoType"/>
           <xs:element name="KeyContainerFormat"
             type="dskpp:KeyContainerFormatType"/>
           <xs:element name="Payload"
             type="dskpp:PayloadType"/>
           <xs:element name="Extensions"
             type="dskpp:ExtensionsType" minOccurs="0"/>
           <xs:element name="Mac" type="dskpp:MacType"
             minOccurs="0"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <!-- KeyProvClientNonce PDU -->
   <xs:element name="KeyProvClientNonce" type="dskpp:KeyProvClientNoncePDU"/>

   <xs:complexType name="KeyProvClientNoncePDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Second message sent from DSKPP client shared
      secret key (the <ds:KeyName> alternative of ds:KeyInfoType).
   o  <KeyContainerFormat>: The key container format type to be used by
      the DSKPP server.  The default setting relies on the
      KeyContainerType element defined in
      "urn:ietf:params:xml:schema:keyprov:container" [PSKC].
   o  <Payload>: The actual payload.  For this version of the protocol,
      only one payload is defined: the pseudorandom string R_S.
   o  <Extensions>: A list of server extensions.  Two extensions are
      defined for this message in a this version of DSKPP: the
      ClientInfoType and the ServerInfoType (see Section 5).
   o  <Mac>: The MAC MUST be present if the DSKPP session.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="dskpp:AbstractRequestType">
         <xs:sequence>
           <xs:element name="EncryptedNonce"
             type="xs:base64Binary"/>
           <xs:element name="AuthenticationData"
             type="dskpp:AuthenticationDataType" minOccurs="0"/>
           <xs:element name="Extensions"
             type="dskpp:ExtensionsType" minOccurs="0"/>
         </xs:sequence>
         <xs:attribute name="SessionID" type="dskpp:IdentifierType"
           use="required"/>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <!-- KeyProvServerFinished PDU -->
   <xs:element name="KeyProvServerFinished" type="dskpp:KeyProvServerFinishedPDU"/>

   <xs:complexType name="KeyProvServerFinishedPDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Final message sent from run will result in the
      replacement of an existing symmetric key with a new one (i.e., if
      the <KeyID> element was present in the <ClientHello message).  In
      this case, the DSKPP server MUST prove to DSKPP client the cryptographic module
      that it is authorized to replace it.

4.5.  Components of a <KeyProvClientNonce> Request (Used Only in Four-
      Pass DSKPP)

   In a four-pass DSKPP
         session. A MAC value serves for exchange, this message contains the nonce R_C
   that was chosen by the cryptographic module, and encrypted by the
   negotiated encryption key confirmation, and optional
         AuthenticationData servers for server authentication.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="dskpp:AbstractResponseType">
         <xs:sequence minOccurs="0">
           <xs:element name="KeyContainer"
             type="dskpp:KeyContainerType"/> encryption algorith
   <xs:element name="Extensions"
             type="dskpp:ExtensionsType" minOccurs="0"/> name="KeyProvClientNonce"
     type="dskpp:KeyProvClientNoncePDU">
   </xs:element>
   <xs:complexType name="KeyProvClientNoncePDU">
     <xs:complexContent mixed="false">
       <xs:extension base="dskpp:AbstractRequestType">
         <xs:sequence>
           <xs:element name="Mac"
             type="dskpp:MacType"/> name="EncryptedNonce" type="xs:base64Binary" />
           <xs:element minOccurs="0" name="AuthenticationData"
             type="dskpp:AuthenticationDataType" minOccurs="0"/> />
           <xs:element minOccurs="0" name="Extensions"
             type="dskpp:ExtensionsType" />
         </xs:sequence>
         <xs:attribute name="SessionID" type="dskpp:IdentifierType"
           use="required" />
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

 </xs:schema>

14.  Security Considerations

14.1.  General

   DSKPP is designed to protect generated key material

   The components of this message have the following meaning:

   o  Version: (inherited from exposure.
   No other entities than the DSKPP server and AbstractRequestType type) MUST be the cryptographic module
   will
      same version as in the <KeyProvServerHello> message.
   o  <SessionID>: (attribute inherited from the AbstractResponseType
      type) MUST have access to a the same value as the SessionID attribute in the
      received <KeyProvServerHello> message.
   o  <EncryptedNonce>: The nonce generated K_TOKEN if and encrypted by the
      cryptographic
   algorithms used are of sufficient strength and, on module.  The encryption MUST be made using the DSKPP client
   side, generation and
      selected encryption of R_C algorithm and identified key, and generation of K_TOKEN take
   place as specified
      in the cryptographic module.  This applies even if
   malicious software is present in the DSKPP client.  However, Section 3.4.
   o  <AuthenticationData>: The authentication data value MUST be set as
   discussed
      specified in the following, DSKPP does not protect against certain
   other threats resulting from man-in-the-middle attacks Section 3.3 and other
   forms Section 4.3.4.
   o  <Extensions>: A list of attacks.  DSKPP SHOULD, therefore, be run over a transport
   providing privacy and integrity, such as HTTP over Transport Layer
   Security (TLS) with a suitable ciphersuite, when such threats are a
   concern.  Note that TLS ciphersuites with anonymous key exchanges extensions.  Two extensions are
   not suitable in those situations.

14.2.  Active Attacks

14.2.1.  Introduction

   An active attacker MAY attempt to modify, delete, insert, replay, or
   reorder messages defined
      for a variety this message in this version of purposes including service denial DSKPP: the ClientInfoType and compromise of generated key material.  Section 14.2.2 through
      the ServerInfoType (see Section 14.2.7.

14.2.2.  Message Modifications

   Modifications to 5)

4.6.  Components of a <DSKPPTrigger> <KeyProvServerFinished> Response

   This message is the last message will either cause denial-
   of-service (modifications of any of the identifiers or DSKPP protocol run.  In a
   4-pass exchange, the nonce) or
   will cause DSKPP server sends this message in response to a
   <KeyProvClientNonce> message, whereas in a 2-pass exchange, the DSKPP client
   server sends this message in response to contact a <KeyProvClientHello>
   message.

   <xs:element name="KeyProvServerFinished"
     type="dskpp:KeyProvServerFinishedPDU">
   </xs:element>
   <xs:complexType name="KeyProvServerFinishedPDU">
     <xs:complexContent mixed="false">
       <xs:extension base="dskpp:AbstractResponseType">
         <xs:sequence minOccurs="0">
           <xs:element name="KeyContainer"
             type="dskpp:KeyContainerType" />
           <xs:element minOccurs="0" name="Extensions"
             type="dskpp:ExtensionsType" />
           <xs:element name="Mac" type="dskpp:MacType" />
           <xs:element minOccurs="0" name="AuthenticationData"
             type="dskpp:AuthenticationDataType" />
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   The components of this message have the wrong following meaning:

   o  Version: (inherited from the AbstractResponseType type) The DSKPP server.
      version used in this session.
   o  SessionID: (inherited from the AbstractResponseType type) The
   latter
      previously established identifier for this session.
   o  Status: (inherited from the AbstractResponseType type) Return code
      for the <KeyProvServerFinished> message.  If Status is in effect a man-in-the-middle attack not
      "Success", only the Status, SessionID, and Version attributes will
      be present (the presence of the SessionID attribute is discussed
   further in Section 14.2.7.

   An attacker may modify dependent
      on the type of reported error); otherwise, all the other elements
      MUST be present as well.  In this latter case, the
      <KeyProvServerFinished> message can be seen as a <KeyProvClientHello> message.  This means
   that "Commit" message,
      instructing the cryptographic module to store the attacker could indicate a different generated key or device than
      and associate the
   one intended by given key identifier with this key.
   o  <KeyContainer>: The key container containing symmetric key values
      (in the DSKPP client, case of a 2-pass exchange) and could also suggest other
   cryptographic algorithms than configuration data.  The
      default container format is based on the ones preferred KeyContainerType type
      from PSKC, as defined in [PSKC].
   o  <Extensions>: A list of extensions chosen by the DSKPP client,
   e.g., cryptographically weaker ones.  The attacker could also suggest
   earlier versions server.
      For this message, this version of the DSKPP protocol, in case these versions have
   been shown to have vulnerabilities.  These modifications could lead
   to an attacker succeeding in initializing or modifying another
   cryptographic module than the defines one intended (i.e., extension, the server
   assigning
      ClientInfoType (see Section 5).
   o  <Mac>: To avoid a false "Commit" message causing the generated key cryptographic
      module to end up in an initialized state for which the wrong module), or gaining access
   to a generated key through server does
      not know the use of weak cryptographic algorithms
   or protocol versions.  DSKPP implementations MAY protect against stored key, <KeyProvServerFinished> messages MUST
      always be authenticated with a MAC.  The MAC MUST be made using
      the
   latter by having strict policies about what versions and algorithms
   they support and accept. already established MAC algorithm.

4.7.  The former threat (assignment StatusCode Type

   The StatusCode type enumerates all possible return codes:

    <xs:simpleType name="StatusCode">
       <xs:restriction base="xs:string">
         <xs:enumeration value="Continue" />
         <xs:enumeration value="Success" />
         <xs:enumeration value="Abort" />
         <xs:enumeration value="AccessDenied" />
         <xs:enumeration value="MalformedRequest" />
         <xs:enumeration value="UnknownRequest" />
         <xs:enumeration value="UnknownCriticalExtension" />
         <xs:enumeration value="UnsupportedVersion" />
         <xs:enumeration value="NoSupportedKeyTypes" />
         <xs:enumeration value="NoSupportedEncryptionAlgorithms" />
         <xs:enumeration value="NoSupportedMacAlgorithms" />
         <xs:enumeration value="NoProtocolVariants" />
         <xs:enumeration value="NoSupportedKeyContainers" />
         <xs:enumeration value="AuthenticationDataMissing" />
         <xs:enumeration value="AuthenticationDataInvalid" />
         <xs:enumeration value="InitializationFailed" />
       </xs:restriction>
     </xs:simpleType>

   Upon transmission or receipt of a
   generated key to message for which the wrong module) Status
   attribute's value is not possible when "Success" or "Continue", the shared-
   key variant of DSKPP is employed (assuming existing shared keys are
   unique per cryptographic module), but default
   behavior, unless explicitly stated otherwise below, is possible in that both the public-key
   variant.  Therefore,
   DSKPP servers server and the DSKPP client MUST NOT accept unilaterally
   provided device identifiers in immediately terminate the public-key variant.  This is also
   indicated in
   DSKPP session.  DSKPP servers and DSKPP clients MUST delete any
   secret values generated as a result of failed runs of the DSKPP
   protocol.  Session identifiers MAY be retained from successful or
   failed protocol description.  In the shared-key variant,
   however, an attacker may runs for replay detection purposes, but such retained
   identifiers MUST NOT be able to provide the wrong identifier
   (possibly also leading to the incorrect user being associated with reused for subsequent runs of the generated key) if protocol.

   When possible, the attacker has real-time access DSKPP client SHOULD present an appropriate error
   message to the
   cryptographic module with the identified key.  In other words, the
   generated key is associated with the correct cryptographic module but user.

   These status codes are valid in all DSKPP Response messages unless
   explicitly stated otherwise:

   o  "Continue" indicates that the module DSKPP server is associated with the incorrect user.  See further
   Section 14.5 ready for a discussion
      subsequent request from the DSKPP client.  It cannot be sent in
      the server's final message.
   o  "Success" indicates successful completion of this threat and possible
   countermeasures.

   An attacker may also modify a <KeyProvServerHello> the DSKPP session.
      It can only be sent in the server's final message.  This
   means

   o  "Abort" indicates that the attacker could indicate different key types,
   algorithms, or protocol versions than the legitimate DSKPP server would,
   e.g., cryptographically weaker ones.  The attacker may also provide a
   different nonce than rejected the one sent by DSKPP
      client's request for unspecified reasons.
   o  "AccessDenied" indicates that the legitimate DSKPP client is not authorized
      to contact this DSKPP server.  Clients
   MAY protect against
   o  "MalformedRequest" indicates that the former through strict adherence DSKPP server failed to policies
   regarding permissible algorithms and protocol versions.  The latter
   (wrong nonce) will not constitute a security problem, as a generated
   key will not match parse
      the key generated on DSKPP client's request.
   o  "UnknownRequest" indicates that the legitimate server.  Also,
   whenever DSKPP client made a request
      that is unknown to the DSKPP run would result in server.
   o  "UnknownCriticalExtension" indicates that a critical DSKPP
      extension (see below) used by the replacement of an existing
   key, DSKPP client was not supported
      or recognized by the <Mac> element protects against modifications of R_S.

   Modifications of <KeyProvClientNonce> messages are also possible.  If
   an attacker modifies DSKPP server.
   o  "UnsupportedVersion" indicates that the SessionID attribute, then, in effect, DSKPP client used a
   switch to another session will occur at the server, assuming DSKPP
      protocol version not supported by the new
   SessionID DSKPP server.  This error is
      only valid at in the DSKPP server's first response message.
   o  "NoSupportedKeyTypes" indicates that time on the server.  It still will DSKPP client only
      suggested key types that are not
   allow the attacker to learn a generated K_TOKEN since R_C has been
   wrapped for supported by the legitimate DSKPP server.  Modifications of
      This error is only valid in the
   <EncryptedNonce> element, e.g., replacing it with a value for which DSKPP server's first response
      message.
   o  "NoSupportedEncryptionAlgorithms" indicates that the attacker knows an underlying R'C, will DSKPP client
      only suggested encryption algorithms that are not result supported by the
      DSKPP server.  This error is only valid in the DSKPP server's
      first response message.
   o  "NoSupportedMacAlgorithms" indicates that the DSKPP client
   changing its pre-DSKPP state, since only
      suggested MAC algorithms that are not supported by the server will be unable to
   provide a DSKPP
      server.  This error is only valid MAC in its final message to the client.  The server
   MAY, however, end up storing K'TOKEN rather than K_TOKEN.  If DSKPP server's first
      response message.
   o  "NoProtocolVariants" indicates that the
   cryptographic module has been associated with a particular user, then
   this could constitute a security problem.  For a further discussion
   about this threat, and DSKPP client only
      suggested a possible countermeasure, see Section 14.5
   below.  Note that use of Secure Socket Layer (SSL) protocol variation (either 2-pass or TLS does 4-pass) that is
      not
   protect against this attack if the attacker has access to supported by the DSKPP
   client (e.g., through malicious software, "trojans").

   Finally, attackers may also modify server.  This error is only valid in
      the <KeyProvServerFinished> DSKPP server's first response message.  Replacing
   o  "NoSupportedKeyContainers" indicates that the <Mac> element will DSKPP client only result
      suggested key container formats that are not supported by the
      DSKPP server.  This error is only valid in denial-of-
   service.  Replacement of any other element may cause the DSKPP server's
      first response message.
   o  "AuthenticationDataMissing" indicates that the DSKPP client didn't
      provide authentication data that the DSKPP server required.
   o  "AuthenticationDataInvalid" indicates that the DSKPP client
   to associate, e.g.,
      supplied user authentication data that the wrong service with DSKPP server failed to
      validate.
   o  "InitializationFailed" indicates that the generated key. DSKPP
   SHOULD be run over server could not
      generate a transport providing privacy and integrity when valid key given the provided data.  When this status
      code is a concern.

14.2.3.  Message Deletion

   Message deletion will not cause any other harm than denial-of-
   service, since a cryptographic module MUST NOT change its state
   (i.e., "commit" received, the DSKPP client SHOULD try to a generated key) until restart DSKPP, as
      it receives is possible that a new run will succeed.
   o  "ProvisioningPeriodExpired" indicates that the final
   message from provisioning period
      set by the DSKPP server and successfully has processed that
   message, including validation of its MAC.  A deleted
   <KeyProvServerFinished> message will not cause the server to end up
   in an inconsistent state vis-a-vis the cryptographic module if expired.  When the
   server implements status code is
      received, the suggestions in Section 14.5.

14.2.4.  Message Insertion

   An active attacker may initiate a DSKPP run at any time, and suggest
   any device identifier. DSKPP server implementations MAY receive some
   protection against inadvertently initializing a key or inadvertently
   replacing an existing key or assigning a client SHOULD report the reason for key
      initialization failure to a cryptographic
   module by initializing the DSKPP run by use of user and the <KeyProvTrigger>.
   The <TriggerNonce> element allows user MUST register with
      the DSKPP server to associate initialize a DSKPP
   protocol run with, e.g., an earlier user-authenticated session. new key.

5.  Extensibility

5.1.  The
   security of ClientInfoType Type

   Present in a <KeyProvClientHello> or a <KeyProvClientNonce> message,
   the OPTIONAL ClientInfoType extension contains DSKPP client-specific
   information.  DSKPP servers MUST support this method, therefore, depends on the ability extension.  DSKPP
   servers MUST NOT attempt to protect interpret the <TriggerNonce> element data it carries and, if
   received, MUST include it unmodified in the current protocol run's
   next server response.  Servers need not retain the ClientInfoType's
   data after that response has been generated.

5.2.  The ServerInfoType Type

   When present, the OPTIONAL ServerInfoType extension contains DSKPP initialization message.  If
   an eavesdropper
   server-specific information.  This extension is able to capture this message, he may race the
   legitimate user only valid in
   <KeyProvServerHello> messages for a key initialization. which Status = "Continue".  DSKPP over a transport
   providing privacy and integrity, coupled with
   clients MUST support this extension.  DSKPP clients MUST NOT attempt
   to interpret the recommendations data it carries and, if received, MUST include it
   unmodified in
   Section 14.5, is RECOMMENDED when this is a concern.

   Insertion of other messages into an existing the current protocol run is seen as
   equivalent to modification of legitimately sent messages.

14.2.5.  Message Replay

   During 4-pass DSKPP, attempts to replay a previously recorded run's next client request (i.e.,
   the <KeyProvClientNonce> message).  DSKPP
   message will be detected, as clients need not retain the use of nonces ensures
   ServerInfoType's data after that both
   parties are live.  For example, request has been generated.  This
   extension MAY be used, e.g., for state management in the DSKPP
   server.

6.  Protocol Bindings

6.1.  General Requirements

   DSKPP assumes a reliable transport.

6.2.  HTTP/1.1 Binding for DSKPP client knows that

6.2.1.  Introduction

   This section presents a server it
   is communicating with is "live" since binding of the server MUST create a MAC on
   information sent by previous messages to HTTP/1.1
   [RFC2616].  Note that the HTTP client normally will be different from
   the client.

   The same is true for 2-pass DSKPP thanks to client, i.e., the requirement that HTTP client will only exist to "proxy"
   DSKPP messages from the DSKPP client sends R in to the <KeyProvClientHello> message and that DSKPP server.  Likewise,
   on the HTTP server includes R in side, the MAC computation.

   In 1-pass DSKPP clients that record the latest I used by a particular server (as identified by ID_S) will be able to detect replays.

14.2.6.  Message Reordering

   An attacker may attempt to re-order 4-pass MAY receive DSKPP PDUs from
   a "front-end" HTTP server.

6.2.2.  Identification of DSKPP Messages

   The MIME-type for all DSKPP messages but this
   will MUST be detected, as each message is of a unique type.  Note: Message
   re-ordering attacks cannot occur in 2- and 1-pass

   application/vnd.ietf.keyprov.dskpp+xml

6.2.3.  HTTP Headers

   HTTP proxies MUST NOT cache responses carrying DSKPP since each
   party sends at most one message each.

14.2.7.  Man-in-the-Middle

   In addition messages.  For
   this reason, the following holds:
   o  When using HTTP/1.1, requesters SHOULD:
      *  Include a Cache-Control header field set to other active attacks, an attacker posing as "no-cache, no-
         store".
      *  Include a man in
   the middle may be able Pragma header field set to provide his own public key "no-cache".
   o  When using HTTP/1.1, responders SHOULD:
      *  Include a Cache-Control header field set to the DSKPP
   client.  This threat and countermeasures "no-cache, no-must-
         revalidate, private".
      *  Include a Pragma header field set to it are discussed in
   Section 4.3.  An attacker posing "no-cache".
      *  NOT include a Validator, such as a man-in-the-middle may also be
   acting Last-Modified or ETag
         header.
   There are no other restrictions on HTTP headers, besides the
   requirement to set the Content-Type header value according to
   Section 6.2.2.

6.2.4.  HTTP Operations

   Persistent connections as a proxy and, hence, may defined in HTTP/1.1 are assumed but not interfere with
   required.  DSKPP runs but
   still learn valuable information; see Section 14.3.

14.3.  Passive Attacks

   Passive attackers may eavesdrop on requests are mapped to HTTP POST operations.  DSKPP runs
   responses are mapped to learn information HTTP responses.

6.2.5.  HTTP Status Codes

   A DSKPP HTTP responder that later on may be used refuses to impersonate users, mount active attacks,
   etc.

   If perform a message exchange
   with a DSKPP HTTP requester SHOULD return a 403 (Forbidden) response.
   In this case, the content of the HTTP body is not run over a transport providing privacy, significant.  In
   the case of an HTTP error while processing a passive
   attacker may learn:
   o  What cryptographic modules DSKPP request, the HTTP
   server MUST return a particular user is in possession of;
   o  The identifiers 500 (Internal Server Error) response.  This type
   of keys on those cryptographic modules and other
      attributes pertaining error SHOULD be returned for HTTP-related errors detected before
   control is passed to those keys, e.g., the lifetime of DSKPP processor, or when the
      keys; and
   o DSKPP versions and cryptographic algorithms supported by processor
   reports an internal error (for example, the DSKPP XML namespace is
   incorrect, or the DSKPP schema cannot be located).  If the type of a
      particular
   DSKPP client request cannot be determined, the DSKPP responder MUST return a
   400 (Bad request) response.

   In these cases (i.e., when the HTTP response code is 4xx or server. 5xx), the
   content of the HTTP body is not significant.

   Redirection status codes (3xx) apply as usual.

   Whenever the above HTTP POST is a concern, successfully invoked, the DSKPP SHOULD be run over a transport
   providing privacy.  If man-in-the-middle attacks for HTTP
   responder MUST use the purposes
   described above are 200 status code and provide a concern, the transport SHOULD also offer
   server-side authentication.

14.4.  Cryptographic Attacks

   An attacker suitable DSKPP
   message (possibly with unlimited access to an initialized cryptographic
   module may use DSKPP error information included) in the module as an "oracle" to pre-compute values that
   later on may be used to impersonate HTTP
   body.

6.2.6.  HTTP Authentication

   No support for HTTP/1.1 authentication is assumed.

6.2.7.  Initialization of DSKPP

   The DSKPP server MAY initialize the DSKPP server.  Section 5.2
   and protocol by sending an HTTP
   response with Content-Type set according to Section 4 contain discussions of this threat 6.2.2 and steps
   RECOMMENDED
   response code set to protect against it.

14.5.  Attacks on the Interaction between DSKPP and User Authentication

   If keys generated in DSKPP will 200 (OK).  This message MAY, e.g., be associated with sent in
   response to a particular user
   at the DSKPP server (or requesting key initialization in a server trusted by, and communicating with browsing
   session.  The initialization message MAY carry data in its body.  If
   this is the case, the data MUST be a valid instance of a
   <KeyProvTrigger> element.

6.2.8.  Example Messages

   a.  Initialization from DSKPP server:
       HTTP/1.1 200 OK

       Cache-Control: no-store
       Content-Type: application/vnd.ietf.keyprov.dskpp+xml
       Content-Length: <some value>

       DSKPP initialization data in XML form...

   b.  Initial request from DSKPP client:
       POST http://example.com/cgi-bin/DSKPP-server HTTP/1.1
       Cache-Control: no-store
       Pragma: no-cache
       Host: example.com
       Content-Type: application/vnd.ietf.keyprov.dskpp+xml
       Content-Length: <some value>

       DSKPP data in XML form (supported version, supported
       algorithms...)

   c.  Initial response from DSKPP server:
       HTTP/1.1 200 OK

       Cache-Control: no-store
       Content-Type: application/vnd.ietf.keyprov.dskpp+xml
       Content-Length: <some value>

       DSKPP server), then data in order to protect against threats where an
   attacker replaces a client-provided encrypted R_C with his own R'C
   (regardless of whether the public-key variant or the shared-secret
   variant of DSKPP is employed to encrypt the client nonce), the XML form (server random nonce, server
   SHOULD not commit to associate a generated K_TOKEN with the given
   cryptographic module until the user simultaneously has proven both
   possession of the device that hosts the cryptographic module
   containing K_TOKEN and some out-of-band provided authenticating
   information (e.g., a temporary password).  For example, if the
   cryptographic module public key,
       ...)

7.  DSKPP Schema

<?xml version="1.0" encoding="utf-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  elementFormDefault="qualified" attributeFormDefault="unqualified"
  targetNamespace="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
  version="1.0">

  <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
    schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/
    xmldsig-core-schema.xsd"/>

  <xs:import namespace="urn:ietf:params:xml:ns:keyprov:container:1.0"
    schemaLocation="keyprov-pskc-1.0.xsd"/>

  <xs:complexType name="AbstractRequestType" abstract="true">
    <xs:annotation>
      <xs:documentation> Basic types </xs:documentation>
    </xs:annotation>
    <xs:attribute name="Version" type="dskpp:VersionType"
      use="required"/>
  </xs:complexType>

  <xs:complexType name="AbstractResponseType" abstract="true">
    <xs:annotation>
      <xs:documentation> Basic types </xs:documentation>
    </xs:annotation>
    <xs:attribute name="Version" type="dskpp:VersionType"
      use="required"/>
    <xs:attribute name="SessionID" type="dskpp:IdentifierType" />
    <xs:attribute name="Status" type="dskpp:StatusCode" use="required"/>
  </xs:complexType>

  <xs:simpleType name="VersionType">
    <xs:restriction base="xs:string">
      <xs:pattern value="\d{1,2}\.\d{1,3}" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="IdentifierType">
    <xs:restriction base="xs:string">
      <xs:maxLength value="128" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StatusCode">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Continue" />
      <xs:enumeration value="Success" />
      <xs:enumeration value="Abort" />
      <xs:enumeration value="AccessDenied" />
      <xs:enumeration value="MalformedRequest" />
      <xs:enumeration value="UnknownRequest" />
      <xs:enumeration value="UnknownCriticalExtension" />
      <xs:enumeration value="UnsupportedVersion" />
      <xs:enumeration value="NoSupportedKeyTypes" />
      <xs:enumeration value="NoSupportedEncryptionAlgorithms" />
      <xs:enumeration value="NoSupportedMacAlgorithms" />
      <xs:enumeration value="NoProtocolVariants" />
      <xs:enumeration value="NoSupportedKeyContainers" />
      <xs:enumeration value="AuthenticationDataMissing" />
      <xs:enumeration value="AuthenticationDataInvalid" />
      <xs:enumeration value="InitializationFailed" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="DeviceIdentifierDataType">
    <xs:choice>
      <xs:element name="DeviceId" type="pskc:DeviceIdType" />
      <xs:any namespace="##other" processContents="strict" />
    </xs:choice>
  </xs:complexType>

  <xs:simpleType name="PlatformType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Hardware" />
      <xs:enumeration value="Software" />
      <xs:enumeration value="Unspecified" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="TokenPlatformInfoType">
    <xs:attribute name="KeyLocation" type="dskpp:PlatformType"/>
    <xs:attribute name="AlgorithmLocation" type="dskpp:PlatformType"/>
  </xs:complexType>

  <xs:simpleType name="NonceType">
    <xs:restriction base="xs:base64Binary">
      <xs:minLength value="16" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="AlgorithmsType">
    <xs:sequence maxOccurs="unbounded">
      <xs:element name="Algorithm" type="dskpp:AlgorithmType" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="AlgorithmType">
    <xs:restriction base="xs:anyURI" />
  </xs:simpleType>

  <xs:complexType name="ProtocolVariantsType">
    <xs:sequence>
      <xs:element minOccurs="0" name="FourPass" />
      <xs:element minOccurs="0" name="TwoPass"
        type="dskpp:KeyProtectionDataType"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="KeyProtectionDataType">
    <xs:annotation>
      <xs:documentation xml:lang="en">
         This element is only valid for two-pass DSKPP.
       </xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
        <xs:sequence maxOccurs="unbounded">
          <xs:element name="SupportedKeyProtectionMethod" type="xs:anyURI"/>
          <xs:element name="Payload" type="dskpp:PayloadType" />
        </xs:sequence>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="PayloadType">
    <xs:choice>
      <xs:element name="Nonce" type="dskpp:NonceType" />
      <xs:any namespace="##other" processContents="strict" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="KeyContainersFormatType">
    <xs:sequence maxOccurs="unbounded">
      <xs:element name="KeyContainerFormat"
      type="dskpp:KeyContainerFormatType"/>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="KeyContainerFormatType">
    <xs:restriction base="xs:anyURI" />
  </xs:simpleType>
  <xs:complexType name="AuthenticationDataType">
    <xs:annotation>
      <xs:documentation xml:lang="en">
         Authentication data contains a one-time password token, the user could be
   required to authenticate with both a one-time password generated by
   the cryptographic module and MAC.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" name="ClientID"
        type="dskpp:IdentifierType" />
      <xs:element name="AuthenticationCodeMac"
        type="dskpp:AuthenticationCodeMacType" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="AuthenticationCodeMacType">
    <xs:annotation>
      <xs:documentation xml:lang="en">
         An authentication MAC calculated from an out-of-band provided temporary PIN in
   order to have the authentication code and
         optionally server "commit" to the generated OTP information as well as nonce value for the
   given user.  Preferably, the user SHOULD perform this operation from
   another host than the one if they are
         available.
       </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" name="Nonce" type="dskpp:NonceType" />
      <xs:element minOccurs="0" name="IterationCount" type="xs:int" />
      <xs:element name="Mac" type="dskpp:MacType" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="MacType">
    <xs:simpleContent>
      <xs:extension base="xs:base64Binary">
        <xs:attribute name="MacAlgorithm" type="xs:anyURI" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="KeyContainerType">
    <xs:sequence>
      <xs:element minOccurs="0" name="ServerID" type="xs:anyURI" />
      <xs:element minOccurs="0" name="KeyProtectionMethod" type="xs:anyURI" />
      <xs:choice>
        <xs:element name="KeyContainer" type="pskc:KeyContainerType" />
        <xs:any namespace="##other" processContents="strict" />
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="InitializationTriggerType">
    <xs:sequence>
      <xs:element minOccurs="0" name="DeviceIdentifierData"
        type="dskpp:DeviceIdentifierDataType" />
      <xs:element minOccurs="0" name="KeyID" type="xs:base64Binary" />
      <xs:element minOccurs="0" name="TokenPlatformInfo"
        type="dskpp:TokenPlatformInfoType" />
      <xs:element name="TriggerNonce" type="dskpp:NonceType" />
      <xs:element minOccurs="0" name="ServerUrl" type="xs:anyURI" />
      <xs:any minOccurs="0" namespace="##other"
        processContents="strict" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ExtensionsType">
    <xs:annotation>
      <xs:documentation> Extension types </xs:documentation>
    </xs:annotation>
    <xs:sequence maxOccurs="unbounded">
      <xs:element name="Extension" type="dskpp:AbstractExtensionType" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="AbstractExtensionType" abstract="true">
    <xs:attribute name="Critical" type="xs:boolean" />
  </xs:complexType>

  <xs:complexType name="ClientInfoType">
    <xs:complexContent mixed="false">
      <xs:extension base="dskpp:AbstractExtensionType">
        <xs:sequence>
          <xs:element name="Data" type="xs:base64Binary" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="ServerInfoType">
    <xs:complexContent mixed="false">
      <xs:extension base="dskpp:AbstractExtensionType">
        <xs:sequence>
          <xs:element name="Data" type="xs:base64Binary" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="KeyProvTrigger" type="dskpp:KeyProvTriggerType">
    <xs:annotation>
      <xs:documentation> DSKPP PDUs </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="KeyProvTriggerType">
    <xs:annotation>
      <xs:documentation xml:lang="en">
         Message used to initialize keys on the
   cryptographic module, in order to minimize the risk of malicious
   software on the client interfering with the process.

   Note: This scenario, wherein the attacker replaces a client-provided
   R_C with his own R'C, does not apply to 2- and 1-pass DSKPP as trigger the
   client does not provide any entropy to K_TOKEN.  The attack as such
   (and its countermeasures) still applies to 2- and 1-pass DSKPP,
   however, as it essentially is a man-in-the-middle attack.

   Another threat arises when an attacker is able device to trick initiate a user to
   authenticate to the attacker rather than to the legitimate service
   before the
         DSKPP protocol run.  If successful, the attacker will then
   be able to impersonate the user towards the legitimate service, and
   subsequently receive a valid DSKPP trigger.  If the public-key
   variant of DSKPP is used, this may result in the attacker being able
   to (after a successful DSKPP protocol run) impersonate the user.
   Ordinary precautions MUST, therefore, be in place to ensure that
   users authenticate only to legitimate services.

14.6.  Additional Considerations Specific to 2- and 1-pass DSKPP

14.6.1.  Client Contributions to K_TOKEN Entropy

   In 4-pass DSKPP, both the client and the server provide randomizing
   material to K_TOKEN , in a manner that allows both parties to verify
   that they did contribute
       </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice>
        <xs:element name="InitializationTrigger"
          type="dskpp:InitializationTriggerType" />
        <xs:any namespace="##other" processContents="strict" />
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="Version" type="dskpp:VersionType" />
  </xs:complexType>

  <xs:element name="KeyProvClientHello"
    type="dskpp:KeyProvClientHelloPDU">
    <xs:annotation>
      <xs:documentation> KeyProvClientHello PDU </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="KeyProvClientHelloPDU">
    <xs:annotation>
      <xs:documentation xml:lang="en">
         Message sent from DSKPP client to the resulting key.  In the 1- and 2-pass DSKPP versions defined herein, only the server contributes to the
   entropy of K_TOKEN.  This means that initiate a broken or compromised
   (pseudo-)random number generator in the
         DSKPP session.
       </xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="dskpp:AbstractRequestType">
        <xs:sequence>
          <xs:element minOccurs="0" name="DeviceIdentifierData"
            type="dskpp:DeviceIdentifierDataType" />
          <xs:element minOccurs="0" name="KeyID"
            type="xs:base64Binary" />
          <xs:element minOccurs="0" name="ClientNonce"
            type="dskpp:NonceType" />
          <xs:element minOccurs="0" name="TriggerNonce"
            type="dskpp:NonceType" />
          <xs:element name="SupportedKeyTypes"
            type="dskpp:AlgorithmsType" />
          <xs:element name="SupportedEncryptionAlgorithms"
            type="dskpp:AlgorithmsType" />
          <xs:element name="SupportedMacAlgorithms"
            type="dskpp:AlgorithmsType" />
          <xs:element minOccurs="0" name="SupportedProtocolVariants"
            type="dskpp:ProtocolVariantsType" />
          <xs:element minOccurs="0" name="SupportedKeyContainers"
            type="dskpp:KeyContainersFormatType" />
          <xs:element minOccurs="0" name="AuthenticationData"
            type="dskpp:AuthenticationDataType" />
          <xs:element minOccurs="0" name="Extensions"
            type="dskpp:ExtensionsType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="KeyProvServerHello"
    type="dskpp:KeyProvServerHelloPDU">
    <xs:annotation>
      <xs:documentation> KeyProvServerHello PDU </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="KeyProvServerHelloPDU">
    <xs:annotation>
      <xs:documentation xml:lang="en">
         Response message sent from DSKPP server may cause more damage
   than it would to DSKPP client
         in the 4-pass variant.  Server implementations SHOULD
   therefore take extreme care four-pass DSKPP.
       </xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="dskpp:AbstractResponseType">
        <xs:sequence minOccurs="0">
          <xs:element name="KeyType" type="dskpp:AlgorithmType" />
          <xs:element name="EncryptionAlgorithm"
            type="dskpp:AlgorithmType" />
          <xs:element name="MacAlgorithm" type="dskpp:AlgorithmType" />
          <xs:element name="EncryptionKey" type="ds:KeyInfoType" />
          <xs:element name="KeyContainerFormat"
            type="dskpp:KeyContainerFormatType" />
          <xs:element name="Payload" type="dskpp:PayloadType" />
          <xs:element minOccurs="0" name="Extensions"
            type="dskpp:ExtensionsType" />
          <xs:element minOccurs="0" name="Mac" type="dskpp:MacType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="KeyProvClientNonce"
    type="dskpp:KeyProvClientNoncePDU">
    <xs:annotation>
      <xs:documentation> KeyProvClientNonce PDU </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="KeyProvClientNoncePDU">
    <xs:annotation>
      <xs:documentation xml:lang="en">
         Response message sent from DSKPP client to ensure that this situation does not
   occur.

14.6.2.  Key Confirmation

   4-pass
         DSKPP servers provide key confirmation through the MAC on R_C server in the <KeyProvServerFinished> message.  In the 1- and 2-pass a four-pass DSKPP
   variants described herein, key confirmation is provided by the MAC
   including I (in the 1-pass case) or R (2-pass case), using K_MAC.

14.6.3.  Server Authentication session.
       </xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="dskpp:AbstractRequestType">
        <xs:sequence>
          <xs:element name="EncryptedNonce" type="xs:base64Binary" />
          <xs:element minOccurs="0" name="AuthenticationData"
            type="dskpp:AuthenticationDataType" />
          <xs:element minOccurs="0" name="Extensions"
            type="dskpp:ExtensionsType" />
        </xs:sequence>
        <xs:attribute name="SessionID" type="dskpp:IdentifierType"
          use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="KeyProvServerFinished"
    type="dskpp:KeyProvServerFinishedPDU">
    <xs:annotation>
      <xs:documentation> KeyProvServerFinished PDU </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="KeyProvServerFinishedPDU">
    <xs:annotation>
      <xs:documentation xml:lang="en">
         Final message sent from DSKPP servers MUST authenticate themselves whenever a successful server to DSKPP 1- or 2-pass protocol run would result client in an existing K_TOKEN
   being replaced by a K_TOKEN', or else a denial-of-service attack
   where an unauthorized DSKPP server replaces a K_TOKEN with another
   key would be possible.  In 1- and 2-pass DSKPP, servers authenticate
   by including the AuthenticationDataType extension containing a
         session. A MAC as
   described in Section 4.4 value serves for Two-Pass DSKPP key confirmation, and Section 4.5 optional
         AuthenticationData serves for One-
   Pass DSKPP.

14.6.4.  Client Authentication

   A DSKPP server MUST authenticate a client authentication.
       </xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="dskpp:AbstractResponseType">
        <xs:sequence minOccurs="0">
          <xs:element name="KeyContainer"
            type="dskpp:KeyContainerType" />
          <xs:element minOccurs="0" name="Extensions"
            type="dskpp:ExtensionsType" />
          <xs:element name="Mac" type="dskpp:MacType" />
          <xs:element minOccurs="0" name="AuthenticationData"
            type="dskpp:AuthenticationDataType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

8.  Conformance Requirements

   In order to ensure assure that K_TOKEN is
   delivered to all implementations of DSKPP can
   interoperate, there are the intended device.  The following measures SHOULD be
   considered:
   o  When a device certificate is used "MUST support" requirements"

   The conformance requirements for client authentication, the DSKPP server consist of the
   following:

   a.  MUST implement the four-pass variant of the protocol
       (Section 3.1)
   b.  MUST implement the two-pass variant of the protocol (Section 3.2)
   c.  MUST support user authentication (Section 3.3)
   d.  MUST support the Key Transport, Key Wrap, and Passphrase-Based
       Key Wrap Protection Profiles (Section 3.2.2)
   e.  MUST support the DSKPP-PRF-AES DSKPP-PRF realization (Appendix C)
   f.  MUST support the DSKPP-PRF-SHA256 DSKPP-PRF realization
       (Appendix C)
   g.  MAY support the RSA Encryption Scheme ([PKCS-1])
   h.  MAY support DSKPP-PRF with XOR (Section 3.5)
   i.  SHOULD follow standard certificate verification
      processes to ensure that it is a trusted device.
   o  When an Authentication Code is used support integration with PKCS #11 in four-pass DSKPP
       (Appendix B)

   The conformance requirements for the DSKPP client authentication, a
      password dictionary attack on consist of the authentication data is possible.
   o  The length
   following:

   a.  MUST implement the four-pass variant of the Authentication Code when used over a non-secure
      channel protocol
       (Section 3.1)
   b.  MUST implement the two-pass variant of the protocol (Section 3.2)
   c.  MUST support user authentication (Section 3.3)
   d.  MUST support the Key Transport, Key Wrap, and Passphrase-Based
       Key Wrap Protection Profiles (Section 3.2.2)
   e.  MUST support the DSKPP-PRF-AES DSKPP-PRF realization (Appendix C)
   f.  MUST support the DSKPP-PRF-SHA256 DSKPP-PRF realization
       (Appendix C)
   g.  MAY support the RSA Encryption Scheme ([PKCS-1])
   h.  MAY support DSKPP-PRF with XOR (Section 3.5)
   i.  SHOULD be longer than what support integration with PKCS #11 in four-pass DSKPP
       (Appendix B)

   Of course, DSKPP is used over a secure channel.
      When security protocol, and one of its major
   functions is to allow only authorized parties to successfully
   initialize a device, e.g., some mobile phones cryptographic module with small screens, cannot
      handle a long Authentication Code in new symmetric key.
   Therefore, a user-friendly manner, DSKPP
      SHOULD rely on particular implementation may be configured with any of
   a secure channel for communication.
   o  In the case number of restrictions concerning algorithms and trusted
   authorities that a non-secure channel has to be used, the
      Authentication Code SHOULD be sent will prevent universal interoperability.

9.  Security Considerations

9.1.  General

   DSKPP is designed to protect generated key material from exposure.
   No other entities than the DSKPP server MAC's as
      specified in Section 5.3.  The Authentication Code and nonce value
      MUST be strong enough to prevent offline brute-force recovery of
      the Authentication Code from the HMAC data.  Given that the nonce
      value is sent in plaintext format over cryptographic module
   will have access to a non-secure transport, generated K_TOKEN if the cryptographic strength
   algorithms used are of the AuthenticationData depends more sufficient strength and, on the quality DSKPP client
   side, generation and encryption of R_C and generation of K_TOKEN take
   place as specified in the AuthenticationCode.
   o  When the AuthenticationCode cryptographic module.  This applies even if
   malicious software is sent from present in the DSKPP server to the
      device client.  However, as
   discussed in a the following, DSKPP initialization trigger message, an eavesdropper
      may does not protect against certain
   other threats resulting from man-in-the-middle attacks and other
   forms of attacks.  DSKPP SHOULD, therefore, be able to capture this message run over a transport
   providing privacy and race the legitimate user integrity, such as HTTP over Transport Layer
   Security (TLS) with a suitable ciphersuite, when such threats are a
   concern.  Note that TLS ciphersuites with anonymous key exchanges are
   not suitable in those situations.

9.2.  Active Attacks

9.2.1.  Introduction

   An active attacker MAY attempt to modify, delete, insert, replay, or
   reorder messages for a variety of purposes including service denial
   and compromise of generated key initialization.  To prevent this, the transport layer
      used material.  Section 9.2.2 through
   Section 9.2.7.

9.2.2.  Message Modifications

   Modifications to send a <DSKPPTrigger> message will either cause denial-
   of-service (modifications of any of the DSKPP trigger MUST provide privacy and integrity
      e.g. secure browser session.

14.6.5.  Key Protection in identifiers or the Passphrase Profile

   The passphrase-based key wrap profile uses nonce) or
   will cause the PBKDF2 function from
   [PKCS-5] DSKPP client to generate an encryption key from contact the wrong DSKPP server.  The
   latter is in effect a passphrase man-in-the-middle attack and salt
   string.  The derived key, K_DERIVED is used discussed
   further in Section 9.2.7.

   An attacker may modify a <KeyProvClientHello> message.  This means
   that the attacker could indicate a different key or device than the
   one intended by the server to encrypt
   K_TOKEN DSKPP client, and could also suggest other
   cryptographic algorithms than the ones preferred by the cryptographic module to decrypt DSKPP client,
   e.g., cryptographically weaker ones.  The attacker could also suggest
   earlier versions of the newly
   delivered K_TOKEN.  It is important DSKPP protocol, in case these versions have
   been shown to note that passphrase-based
   encryption is generally limited have vulnerabilities.  These modifications could lead
   to an attacker succeeding in initializing or modifying another
   cryptographic module than the security that it provides
   despite one intended (i.e., the use of salt and iteration count in PBKDF2 server
   assigning the generated key to increase the
   complexity of attack.  Implementations SHOULD therefore take
   additional measures wrong module), or gaining access
   to strengthen a generated key through the security use of weak cryptographic algorithms
   or protocol versions.  DSKPP implementations MAY protect against the passphrase-
   based key wrap profile.  The following measures SHOULD be considered
   where applicable:

   o  The passphrase SHOULD be selected well,
   latter by having strict policies about what versions and usage guidelines such
      as the ones in [NIST-PWD] SHOULD be taken into account.
   o  A different passphrase SHOULD be used for every key initialization
      wherever possible (the use algorithms
   they support and accept.  The former threat (assignment of a global passphrase for a batch
   generated key to the wrong module) is not possible when the shared-
   key variant of DSKPP is employed (assuming existing shared keys are
   unique per cryptographic modules SHOULD be avoided, for example).  One way to
      achieve this module), but is possible in the public-key
   variation.  Therefore, DSKPP servers MUST NOT accept unilaterally
   provided device identifiers in the public-key variation.  This is to use randomly-generated passphrases.
   o  The passphrase SHOULD be protected well if stored on
   also indicated in the server
      and/or on protocol description.  In the cryptographic module and SHOULD shared-key
   variation, however, an attacker may be delivered able to provide the
      device's user using secure methods.
   o  User pre-authentication SHOULD be implemented to ensure that
      K_TOKEN is not delivered to a rogue recipient.
   o  The iteration count in PBKDF2 SHOULD be high wrong
   identifier (possibly also leading to impose more work
      for an the incorrect user being
   associated with the generated key) if the attacker using brute-force methods (see [PKCS-5] for
      recommendations).  However, it MUST be noted that has real-time
   access to the higher cryptographic module with the
      count, identified key.  In other
   words, the more work generated key is required on associated with the legitimate correct cryptographic
   module to decrypt but the newly delivered K_TOKEN.  Servers MAY use
      relatively low iteration counts to accommodate devices module is associated with
      limited processing power such as some PDA and cell phones when
      other security measures are implemented and the security incorrect user.  See
   further Section 9.5 for a discussion of the
      passphrase-based key wrap method is not weakened.
   o  Transport level security (e.g.  TLS) SHOULD be used where this threat and possible
      to protect
   countermeasures.

   An attacker may also modify a 2-pass <KeyProvServerHello> message.  This
   means that the attacker could indicate different key types,
   algorithms, or 1-pass protocol run.  Transport level versions than the legitimate server would,
   e.g., cryptographically weaker ones.  The attacker may also provide a
   different nonce than the one sent by the legitimate server.  Clients
   MAY protect against the former through strict adherence to policies
   regarding permissible algorithms and protocol versions.  The latter
   (wrong nonce) will not constitute a security provides problem, as a second layer of protection for generated
   key will not match the newly key generated K_TOKEN.

15.  Internationalization Considerations

   The on the legitimate server.  Also,
   whenever the DSKPP protocol is mostly meant for machine-to-machine
   communications; as such, most run would result in the replacement of its elements an existing
   key, the <Mac> element protects against modifications of R_S.

   Modifications of <KeyProvClientNonce> messages are tokens not meant
   for direct human consumption. also possible.  If these tokens are presented to
   an attacker modifies the
   end user, some localization may need to occur.  DSKPP exchanges
   information using XML.  All XML processors are required SessionID attribute, then, in effect, a
   switch to understand
   UTF-8 and UTF-16 encoding, and therefore all DSKPP clients and
   servers MUST understand UTF-8 and UTF-16 encoded XML.  Additionally,
   DSKPP servers and clients MUST NOT encode XML with encodings other
   than UTF-8 or UTF-16.

16.  IANA Considerations

   This document calls for registration of another session will occur at the server, assuming the new URNs within
   SessionID is valid at that time on the IETF sub-
   namespace per RFC3553 [RFC3553].  The following URNs are RECOMMENDED:
   o  DSKPP XML schema: "urn:ietf:params:xml:schema:keyprov:protocol"
   o  DSKPP XML namespace: "urn:ietf:params:xml:ns:keyprov:protocol"

17.  Intellectual Property Considerations

   RSA and RSA Security are registered trademarks or trademarks of RSA
   Security Inc. in server.  It still will not
   allow the United States and/or other countries.  The names
   of other products and services mentioned may be attacker to learn a generated K_TOKEN since R_C has been
   wrapped for the trademarks legitimate server.  Modifications of
   their respective owners.

18.  Contributors

   This work is based on information contained in [RFC4758], authored by
   Magnus Nystrom, the
   <EncryptedNonce> element, e.g., replacing it with enhancements (esp.  Client Authentication, and
   support a value for multiple key container formats) from which
   the attacker knows an individual
   Internet-Draft co-authored by Mingliang Pei and Salah Machani.

   We would like to thank Shuh Chang for contributing underlying R'C, will not result in the DSKPP object
   model, and Philip Hoyer for his work client
   changing its pre-DSKPP state, since the server will be unable to
   provide a valid MAC in aligning DSKPP and PSKC
   schemas.

   We would also like its final message to thank Hannes Tschofenig for his draft reviews,
   feedback, the client.  The server
   MAY, however, end up storing K'TOKEN rather than K_TOKEN.  If the
   cryptographic module has been associated with a particular user, then
   this could constitute a security problem.  For a further discussion
   about this threat, and text contributions.

19.  Acknowledgements

   We would like a possible countermeasure, see Section 9.5
   below.  Note that use of TLS does not protect against this attack if
   the attacker has access to thank the following for detailed review of previous DSKPP document versions:

   o  Dr. Ulrike Meyer (Review June 2007)
   o  Niklas Neumann (Review June 2007)

   o  Shuh Chang (Review June 2007)

   o  Hannes Tschofenig (Review June 2007 and again in August 2007)

   o  Sean Turner (Review August 2007)

   o  John Linn (Review August 2007)

   o  Philip Hoyer (Review September 2007)

   We would client (e.g., through malicious
   software, "trojans").

   Finally, attackers may also like to thank modify the following for their input to selected
   design aspects <KeyProvServerFinished>
   message.  Replacing the <Mac> element will only result in denial-of-
   service.  Replacement of any other element may cause the DSKPP protocol:

   o  Anders Rundgren (Key Container Format and Client Authentication
      Data)

   o  Hannes Tschofenig (HTTP Binding)

   o  Phillip Hallam-Baker (Registry for Algorithms)

   Finally, we would like client
   to thank Robert Griffin for opening
   communication channels for us associate, e.g., the wrong service with the IEEE P1619.3 Key Management
   Group, generated key.  DSKPP
   SHOULD be run over a transport providing privacy and facilitating our groups in staying informed of potential
   areas (esp. key provisioning integrity when
   this is a concern.

9.2.3.  Message Deletion

   Message deletion will not cause any other harm than denial-of-
   service, since a cryptographic module MUST NOT change its state
   (i.e., "commit" to a generated key) until it receives the final
   message from the DSKPP server and global key identifiers of
   collaboration) successfully has processed that
   message, including validation of collaboration.

20.  References

20.1.  Normative references

   [UNICODE]  Davis, M. and M. Duerst, "Unicode Normalization Forms",
              March 2001,
              <http://www.unicode.org/unicode/reports/tr15/
              tr15-21.html>.

   [XMLDSIG]  W3C, "XML Signature Syntax and Processing",
              W3C Recommendation, February 2002,
              <http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/>.

   [XMLENC]   W3C, "XML Encryption Syntax and Processing",
              W3C Recommendation, December 2002,
              <http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/>.

20.2.  Informative references

   [CT-KIP-P11]
              RSA Laboratories, "PKCS #11 Mechanisms for its MAC.  A deleted
   <KeyProvServerFinished> message will not cause the
              Cryptographic Token Key Initialization Protocol", PKCS #11
              Version 2.20 Amd.2, December 2005,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [FAQ]      RSA Laboratories, "Frequently Asked Questions About
              Today's Cryptography",  Version 4.1, 2000.

   [FIPS180-SHA]
              National Institute of Standards server to end up
   in an inconsistent state vis-a-vis the cryptographic module if the
   server implements the suggestions in Section 9.5.

9.2.4.  Message Insertion

   An active attacker may initiate a DSKPP run at any time, and Technology, "Secure
              Hash Standard", FIPS 180-2, February 2004, <http://
              csrc.nist.gov/publications/fips/fips180-2/
              fips180-2withchangenotice.pdf>.

   [FIPS197-AES]
              National Institute suggest
   any device identifier.  DSKPP server implementations MAY receive some
   protection against inadvertently initializing a key or inadvertently
   replacing an existing key or assigning a key to a cryptographic
   module by initializing the DSKPP run by use of Standards and Technology,
              "Specification for the Advanced Encryption Standard
              (AES)", FIPS 197, November 2001, <http://csrc.nist.gov/
              publications/fips/fips197/fips-197.pdf>.

   [FSE2003]  Iwata, T. and K. Kurosawa, "OMAC: One-Key CBC MAC. In Fast
              Software Encryption", FSE 2003, Springer-Verlag , 2003,
              <http://crypt.cis.ibaraki.ac.jp/omac/docs/omac.pdf>.

   [NIST-PWD]
              National Institute <KeyProvTrigger>.
   The <TriggerNonce> element allows the server to associate a DSKPP
   protocol run with, e.g., an earlier user-authenticated session.  The
   security of Standards and Technology, "Password
              Usage", FIPS 112, May 1985,
              <http://www.itl.nist.gov/fipspubs/fip112.htm>.

   [OATH]     "Initiative for Open AuTHentication", 2005,
              <http://www.openauthentication.org>.

   [PKCS-1]   RSA Laboratories, "RSA Cryptography Standard", PKCS #1
              Version 2.1, June 2002,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [PKCS-11]  RSA Laboratories, "Cryptographic Token Interface
              Standard", PKCS #11 Version 2.20, June 2004,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [PKCS-12]  "Personal Information Exchange Syntax Standard", PKCS #12
              Version 1.0, 2005,
              <ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/
              pkcs-12v1.pdf>.

   [PKCS-5]   RSA Laboratories, "Password-Based Cryptography Standard",
              PKCS #5 Version 2.0, March 1999,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [PKCS-5-XML]
              RSA Laboratories, "XML Schema for PKCS #5 Version 2.0",
              PKCS #5 Version 2.0 Amd.1 (FINAL DRAFT), October 2006,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [PSKC]     "Portable Symmetric Key Container", 2005, <http://
              www.ietf.org/internet-drafts/
              draft-hoyer-keyprov-portable-symmetric-key-container-
              00.txt>.

   [RFC2104]  Krawzcyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
              Hashing this method, therefore, depends on the ability to protect
   the <TriggerNonce> element in the DSKPP initialization message.  If
   an eavesdropper is able to capture this message, he may race the
   legitimate user for a key initialization.  DSKPP over a transport
   providing privacy and integrity, coupled with the recommendations in
   Section 9.5, is RECOMMENDED when this is a concern.

   Insertion of other messages into an existing protocol run is seen as
   equivalent to modification of legitimately sent messages.

9.2.5.  Message Authentication", RFC 2104,
              February 1997.

   [RFC2119]  "Key words for Replay

   During 4-pass DSKPP, attempts to replay a previously recorded DSKPP
   message will be detected, as the use of nonces ensures that both
   parties are live.  For example, a DSKPP client knows that a server it
   is communicating with is "live" since the server MUST create a MAC on
   information sent by the client.

   The same is true for 2-pass DSKPP thanks to the requirement that the
   client sends R in RFCs the <KeyProvClientHello> message and that the
   server includes R in the MAC computation.

9.2.6.  Message Reordering

   An attacker may attempt to re-order 4-pass DSKPP messages but this
   will be detected, as each message is of a unique type.  Note: Message
   re-ordering attacks cannot occur in 2-pass DSKPP since each party
   sends at most one message each.

9.2.7.  Man-in-the-Middle

   In addition to other active attacks, an attacker posing as a man in
   the middle may be able to provide his own public key to the DSKPP
   client.  This threat and countermeasures to it are discussed in
   Section 3.1.  An attacker posing as a man-in-the-middle may also be
   acting as a proxy and, hence, may not interfere with DSKPP runs but
   still learn valuable information; see Section 9.3.

9.3.  Passive Attacks

   Passive attackers may eavesdrop on DSKPP runs to Indicate Requirement
              Levels", BCP 14, RFC 2119, March 1997,
              <http://www.ietf.org/rfc/rfc2119.txt>.

   [RFC2616]  Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
              Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
              Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999,
              <http://www.ietf.org/rfc/rfc2616.txt>.

   [RFC3280]  Housley, R., Polk, W., Ford, W., learn information
   that later on may be used to impersonate users, mount active attacks,
   etc.

   If DSKPP is not run over a transport providing privacy, a passive
   attacker may learn:
   o  What cryptographic modules a particular user is in possession of;
   o  The identifiers of keys on those cryptographic modules and D. Solo, "Internet
              X.509 Public Key Infrastructure Certificate other
      attributes pertaining to those keys, e.g., the lifetime of the
      keys; and
              Certificate Revocation List (CRL) Profile", RFC 3280,
              April 2002.

   [RFC3553]  Mealling, M., Masinter, L., Hardie, T.,
   o  DSKPP versions and G. Klyne, "An
              IETF URN Sub-namespace cryptographic algorithms supported by a
      particular DSKPP client or server.
   Whenever the above is a concern, DSKPP SHOULD be run over a transport
   providing privacy.  If man-in-the-middle attacks for Registered Protocol
              Parameters", RFC 3553, BCP 73, June 2003.

   [RFC4758]  RSA, The Security Division the purposes
   described above are a concern, the transport SHOULD also offer
   server-side authentication.

9.4.  Cryptographic Attacks

   An attacker with unlimited access to an initialized cryptographic
   module may use the module as an "oracle" to pre-compute values that
   later on may be used to impersonate the DSKPP server.  Section 3.5
   and Section 3 contain discussions of EMC, "Cryptographic Token
              Key Initialization Protocol (CT-KIP)", November 2006,
              <http://www.ietf.org/rfc/rfc4758.txt>.

Appendix A.  Integration this threat and steps
   RECOMMENDED to protect against it.

9.5.  Attacks on the Interaction between DSKPP and User Authentication

   If keys generated in DSKPP will be associated with PKCS #11

   A a particular user
   at the DSKPP client that needs server (or a server trusted by, and communicating with
   the DSKPP server), then in order to communicate protect against threats where an
   attacker replaces a client-provided encrypted R_C with his own R'C
   (regardless of whether the public-key variation or the shared-secret
   variation of DSKPP is employed to encrypt the client nonce), the
   server SHOULD not commit to associate a connected generated K_TOKEN with the
   given cryptographic module to perform until the user simultaneously has proven
   both possession of the device that hosts the cryptographic module
   containing K_TOKEN and some out-of-band provided authenticating
   information (e.g., a DSKPP exchange MAY use PKCS #11
   [PKCS-11]as temporary password).  For example, if the
   cryptographic module is a programming interface.

A.1.  The 4-pass Variant

   When performing 4-pass DSKPP one-time password token, the user could be
   required to authenticate with both a one-time password generated by
   the cryptographic module using and an out-of-band provided temporary PIN in
   order to have the
   PKCS #11 programming interface, server "commit" to the procedure described generated OTP value for the
   given user.  Preferably, the user SHOULD perform this operation from
   another host than the one used to initialize keys on the
   cryptographic module, in
   [CT-KIP-P11], Appendix B, is RECOMMENDED.

A.2. order to minimize the risk of malicious
   software on the client interfering with the process.

   Note: This scenario, wherein the attacker replaces a client-provided
   R_C with his own R'C, does not apply to 2-pass DSKPP as the client
   does not provide any entropy to K_TOKEN.  The 2-pass Variant

   A suggested procedure attack as such (and its
   countermeasures) still applies to perform 2-pass DSKPP with DSKPP, however, as it
   essentially is a cryptographic
   module through the PKCS #11 interface using the mechanisms defined in
   [CT-KIP-P11] man-in-the-middle attack.

   Another threat arises when an attacker is as follows:

   a.  On the client side,
       1.  The client selects able to trick a suitable slot and token (e.g. through
           use of user to
   authenticate to the <DeviceIdentifier> or attacker rather than to the <PlatformInfo> element
           of legitimate service
   before the DSKPP trigger message).
       2.  A nonce R is generated, e.g. by calling C_SeedRandom and
           C_GenerateRandom.
       3.  The client sends its first message protocol run.  If successful, the attacker will then
   be able to impersonate the server, including user towards the nonce R.
   b.  On legitimate service, and
   subsequently receive a valid DSKPP trigger.  If the server side,
       1.  A generic key K = K_TOKEN | K _MAC (where '|' denotes
           concatenation) public-key
   variant of DSKPP is generated, e.g. by calling C_GenerateKey
           (using key type CKK_GENERIC_SECRET).  The template for K MUST
           allow it used, this may result in the attacker being able
   to (after a successful DSKPP protocol run) impersonate the user.
   Ordinary precautions MUST, therefore, be exported (but only in wrapped form, i.e.
           CKA_SENSITIVE MUST be set place to CK_TRUE and CKA_EXTRACTABLE MUST
           also be set ensure that
   users authenticate only to CK_TRUE), legitimate services.

9.6.  Additional Considerations

9.6.1.  Client Contributions to K_TOKEN Entropy

   In 4-pass DSKPP, both the client and also the server provide randomizing
   material to be used for further key
           derivation.  From K, a token key K_TOKEN of suitable type is
           derived by calling C_DeriveKey using , in a manner that allows both parties to verify
   that they did contribute to the PKCS #11 mechanism
           CKM_EXTRACT_KEY_FROM_KEY and setting resulting key.  In the CK_EXTRACT_PARAMS 2-pass DSKPP
   version defined herein, only the server contributes to the first bit entropy of
   K_TOKEN.  This means that a broken or compromised (pseudo-)random
   number generator in the generic secret key (i.e. set server may cause more damage than it would in
   the 4-pass variation.  Server implementations SHOULD therefore take
   extreme care to 0).
           Likewise, a ensure that this situation does not occur.

9.6.2.  Key Confirmation

   4-pass DSKPP servers provide key confirmation through the MAC on R_C
   in the <KeyProvServerFinished> message.  In the 2-pass DSKPP
   variation described herein, key K_MAC confirmation is derived from K provided by calling
           C_DeriveKey using the CKM_EXTRACT_KEY_FROM_KEY mechanism,
           this time setting CK_EXTRACT_PARAMS to the length of K (in
           bits) divided MAC
   including R, using K_MAC.

9.6.3.  Server Authentication

   DSKPP servers MUST authenticate themselves whenever a successful
   DSKPP 2-pass protocol run would result in an existing K_TOKEN being
   replaced by two.
       2.  The a K_TOKEN', or else a denial-of-service attack where an
   unauthorized DSKPP server wraps K replaces a K_TOKEN with either the token's public another key
           K_CLIENT, would
   be possible.  In 2-pass DSKPP, servers authenticate by including the shared secret key K_SHARED, or
   AuthenticationDataType extension containing a MAC as described in
   Section 3.2 for Two-Pass DSKPP.

9.6.4.  User Authentication

   A DSKPP server MUST authenticate a client to ensure that K_TOKEN is
   delivered to the derived
           shared secret key K_DERIVED by using C_WrapKey.  If use intended device.  The following measures SHOULD be
   considered:
   o  When an Authentication Code is used for client authentication, a
      password dictionary attack on the authentication data is possible.
   o  The length of the DSKPP key wrap algorithm has been negotiated then the
           CKM_KIP_WRAP mechanism MUST Authentication Code when used over a non-secure
      channel SHOULD be longer than what is used to wrap K. over a secure channel.
      When calling
           C_WrapKey, the hKey a device, e.g., some mobile phones with small screens, cannot
      handle a long Authentication Code in a user-friendly manner, DSKPP
      SHOULD rely on a secure channel for communication.
   o  In the CK_KIP_PARAMS structure
           MUST case that a non-secure channel has to be set used, the
      Authentication Code SHOULD be sent to NULL_PTR.  The pSeed parameter in the
           CK_KIP_PARAMS structure server MAC'd as
      specified in Section 3.3.  The Authentication Code and nonce value
      MUST point be strong enough to prevent offline brute-force recovery of
      the Authentication Code from the HMAC data.  Given that the nonce R provided by
      value is sent in plaintext format over a non-secure transport, the DSKPP client, and
      cryptographic strength of the ulSeedLen parameter MUST indicate AuthenticationData depends more on
      the length quality of R. The hWrappingKey parameter in the call AuthenticationCode.
   o  When the AuthenticationCode is sent from the DSKPP server to
           C_WrapKey MUST the
      device in a DSKPP initialization trigger message, an eavesdropper
      may be set to refer able to capture this message and race the wrapping key.

       3.  Next, legitimate user
      for a key initialization.  To prevent this, the server needs transport layer
      used to calculate a MAC using K_MAC.  If
           use of send the DSKPP MAC algorithm has been negotiated, then trigger MUST provide privacy and integrity
      e.g. secure browser session.

9.6.5.  Key Protection in the
           MAC Two-Pass Passphrase Profile

   The passphrase-based key wrap profile uses the PBKDF2 function from
   [PKCS-5] to generate an encryption key from a passphrase and salt
   string.  The derived key, K_DERIVED is calculated used by calling C_SignInit with the CKM_KIP_MAC
           mechanism followed server to encrypt
   K_TOKEN and by a call the cryptographic module to C_Sign.  In decrypt the call newly
   delivered K_TOKEN.  It is important to
           C_SignInit, K_MAC MUST be note that passphrase-based
   encryption is generally limited in the signature key, security that it provides
   despite the hKey
           parameter use of salt and iteration count in PBKDF2 to increase the CK_KIP_PARAMS structure MUST be set
   complexity of attack.  Implementations SHOULD therefore take
   additional measures to
           NULL_PTR, strengthen the pSeed parameter security of the CT_KIP_PARAMS structure
           MUST passphrase-
   based key wrap profile.  The following measures SHOULD be set to NULL_PTR, considered
   where applicable:

   o  The passphrase SHOULD be selected well, and usage guidelines such
      as the ulSeedLen parameter MUST ones in [NIST-PWD] SHOULD be
           set taken into account.
   o  A different passphrase SHOULD be used for every key initialization
      wherever possible (the use of a global passphrase for a batch of
      cryptographic modules SHOULD be avoided, for example).  One way to zero.  In
      achieve this is to use randomly-generated passphrases.
   o  The passphrase SHOULD be protected well if stored on the call server
      and/or on the cryptographic module and SHOULD be delivered to C_Sign, the pData parameter MUST
      device's user using secure methods.
   o  User pre-authentication SHOULD be set implemented to ensure that
      K_TOKEN is not delivered to a rogue recipient.
   o  The iteration count in PBKDF2 SHOULD be high to impose more work
      for an attacker using brute-force methods (see [PKCS-5] for
      recommendations).  However, it MUST be noted that the higher the
      count, the more work is required on the concatenation of legitimate cryptographic
      module to decrypt the string ID_S newly delivered K_TOKEN.  Servers MAY use
      relatively low iteration counts to accommodate devices with
      limited processing power such as some PDA and the nonce
           R, cell phones when
      other security measures are implemented and the ulDataLen parameter MUST security of the
      passphrase-based key wrap method is not weakened.
   o  Transport level security (e.g.  TLS) SHOULD be set used where possible
      to the length protect a 2-pass protocol run.  Transport level security
      provides a second layer of protection for the concatenated string. newly generated
      K_TOKEN.

10.  Internationalization Considerations

   The desired length DSKPP protocol is mostly meant for machine-to-machine
   communications; as such, most of its elements are tokens not meant
   for direct human consumption.  If these tokens are presented to the MAC
   end user, some localization may need to occur.  DSKPP exchanges
   information using XML.  All XML processors are required to understand
   UTF-8 and UTF-16 encoding, and therefore all DSKPP clients and
   servers MUST
           be specified through the pulSignatureLen parameter understand UTF-8 and UTF-16 encoded XML.  Additionally,
   DSKPP servers and clients MUST
           be set to the length NOT encode XML with encodings other
   than UTF-8 or UTF-16.

11.  IANA Considerations

   This document calls for registration of R.
       4.  If the server also needs to authenticate its message (due to
           an existing K_TOKEN being replaced), new URNs within the server MUST
           calculate a second MAC.  Again, if use IETF sub-
   namespace per RFC3553 [RFC3553].  The following URNs are RECOMMENDED:
   o  DSKPP XML schema: "urn:ietf:params:xml:schema:keyprov:protocol"
   o  DSKPP XML namespace: "urn:ietf:params:xml:ns:keyprov:protocol"

12.  Intellectual Property Considerations

   RSA and RSA Security are registered trademarks or trademarks of RSA
   Security Inc. in the DSKPP MAC
           algorithm has been negotiated, then United States and/or other countries.  The names
   of other products and services mentioned may be the MAC trademarks of
   their respective owners.

13.  Contributors

   This work is calculated based on information contained in [RFC4758], authored by
           calling C_SignInit
   Magnus Nystrom, with the CKM_KIP_MAC mechanism followed enhancements (esp.  Client Authentication, and
   support for multiple key container formats) from an individual
   Internet-Draft co-authored by
           a call to C_Sign.  In this call Mingliang Pei and Salah Machani.

   We would like to C_SignInit, thank Shuh Chang for contributing the K_MAC
           existing before this DSKPP protocol run MUST be the signature
           key, the hKey parameter object
   model, and Philip Hoyer for his work in the CK_KIP_PARAMS structure MUST
           be set aligning DSKPP and PSKC
   schemas.

   We would also like to NULL, thank Hannes Tschofenig for his draft reviews,
   feedback, and text contributions.

14.  Acknowledgements

   We would like to thank the pSeed parameter following for review of the CT_KIP_PARAMS
           structure MUST be set to NULL_PTR, previous DSKPP
   document versions:

   o  Lakshminath Dondeti (Review December 2007)

   o  Dr. Ulrike Meyer (Review June 2007)

   o  Niklas Neumann (Review June 2007)

   o  Shuh Chang (Review June 2007)

   o  Hannes Tschofenig (Review June 2007 and the ulSeeidLen
           parameter MUST be set again in August 2007)

   o  Sean Turner (Review August 2007)

   o  John Linn (Review August 2007)

   o  Philip Hoyer (Review September 2007)

   We would also like to zero.  In thank the call following for their input to C_Sign, selected
   design aspects of the
           pData parameter MUST be set DSKPP protocol:

   o  Anders Rundgren (Key Container Format and Client Authentication
      Data)

   o  Hannes Tschofenig (HTTP Binding)

   o  Phillip Hallam-Baker (Registry for Algorithms)

   Finally, we would like to thank Robert Griffin for opening
   communication channels for us with the concatenation IEEE P1619.3 Key Management
   Group, and facilitating our groups in staying informed of the
           string ID_S potential
   areas (esp. key provisioning and the nonce R, global key identifiers of
   collaboration) of collaboration.

15.  References

15.1.  Normative references

   [UNICODE]  Davis, M. and M. Duerst, "Unicode Normalization Forms",
              March 2001,
              <http://www.unicode.org/unicode/reports/tr15/
              tr15-21.html>.

   [XMLDSIG]  W3C, "XML Signature Syntax and Processing",
              W3C Recommendation, February 2002,
              <http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/>.

   [XMLENC]   W3C, "XML Encryption Syntax and Processing",
              W3C Recommendation, December 2002,
              <http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/>.

15.2.  Informative references

   [CT-KIP-P11]
              RSA Laboratories, "PKCS #11 Mechanisms for the ulDataLen parameter MUST
           be set to the length
              Cryptographic Token Key Initialization Protocol", PKCS #11
              Version 2.20 Amd.2, December 2005,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [FAQ]      RSA Laboratories, "Frequently Asked Questions About
              Today's Cryptography",  Version 4.1, 2000.

   [FIPS180-SHA]
              National Institute of concatenated string.  The desired
           length Standards and Technology, "Secure
              Hash Standard", FIPS 180-2, February 2004, <http://
              csrc.nist.gov/publications/fips/fips180-2/
              fips180-2withchangenotice.pdf>.

   [FIPS197-AES]
              National Institute of Standards and Technology,
              "Specification for the MAC MUST be specified through the
           pulSignatureLen parameter Advanced Encryption Standard
              (AES)", FIPS 197, November 2001, <http://csrc.nist.gov/
              publications/fips/fips197/fips-197.pdf>.

   [FSE2003]  Iwata, T. and K. Kurosawa, "OMAC: One-Key CBC MAC. In Fast
              Software Encryption", FSE 2003, Springer-Verlag , 2003,
              <http://crypt.cis.ibaraki.ac.jp/omac/docs/omac.pdf>.

   [NIST-PWD]
              National Institute of Standards and Technology, "Password
              Usage", FIPS 112, May 1985,
              <http://www.itl.nist.gov/fipspubs/fip112.htm>.

   [PKCS-1]   RSA Laboratories, "RSA Cryptography Standard", PKCS #1
              Version 2.1, June 2002,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [PKCS-11]  RSA Laboratories, "Cryptographic Token Interface
              Standard", PKCS #11 Version 2.20, June 2004,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [PKCS-12]  "Personal Information Exchange Syntax Standard", PKCS #12
              Version 1.0, 2005,
              <ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/
              pkcs-12v1.pdf>.

   [PKCS-5]   RSA Laboratories, "Password-Based Cryptography Standard",
              PKCS #5 Version 2.0, March 1999,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [PKCS-5-XML]
              RSA Laboratories, "XML Schema for PKCS #5 Version 2.0",
              PKCS #5 Version 2.0 Amd.1 (FINAL DRAFT), October 2006,
              <http://www.rsasecurity.com/rsalabs/pkcs/>.

   [PSKC]     "Portable Symmetric Key Container", 2005, <http://
              www.ietf.org/internet-drafts/
              draft-hoyer-keyprov-portable-symmetric-key-container-
              00.txt>.

   [RFC2104]  Krawzcyk, H., Bellare, M., and MUST be set to the length of R.
       5.  The server sends its message to the client, including the
           wrapped key K, the MAC and possibly also the authenticating
           MAC.
   c.  On the client side,
       1.  The client calls C_UnwrapKey to receive a handle to K. After
           this, the client calls C_DeriveKey twice: Once to derive
           K_TOKEN and once to derive K_MAC.  The client MUST Canetti, "HMAC: Keyed-
              Hashing for Message Authentication", RFC 2104,
              February 1997.

   [RFC2119]  "Key words for use the
           same mechanism (CKM_EXTRACT_KEY_FROM_KEY) in RFCs to Indicate Requirement
              Levels", BCP 14, RFC 2119, March 1997,
              <http://www.ietf.org/rfc/rfc2119.txt>.

   [RFC2616]  Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
              Masinter, L., Leach, P., and the same
           mechanism parameters as used by the server above.  When
           calling C_UnwrapKey T. Berners-Lee, "Hypertext
              Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999,
              <http://www.ietf.org/rfc/rfc2616.txt>.

   [RFC3280]  Housley, R., Polk, W., Ford, W., and C_DeriveKey, the pTemplate parameter
           MUST be used to set additional key attributes in accordance
           with local policy D. Solo, "Internet
              X.509 Public Key Infrastructure Certificate and as negotiated
              Certificate Revocation List (CRL) Profile", RFC 3280,
              April 2002.

   [RFC3553]  Mealling, M., Masinter, L., Hardie, T., and expressed in the
           protocol.  In particular, the value G. Klyne, "An
              IETF URN Sub-namespace for Registered Protocol
              Parameters", RFC 3553, BCP 73, June 2003.

   [RFC4758]  RSA, The Security Division of the <KeyID> element EMC, "Cryptographic Token
              Key Initialization Protocol (CT-KIP)", November 2006,
              <http://www.ietf.org/rfc/rfc4758.txt>.

Appendix A.  Examples

   This appendix contains example messages that illustrate parameters,
   encoding, and semantics in
           the server's response message MAY be used as CKA_ID for
           K_TOKEN. four-and two- pass DSKPP exchanges.  The key K MUST be destroyed after deriving K_TOKEN
   examples are written using XML, and K_MAC.

       2.  The are syntactically correct.  MAC is verified in
   and cipher values are fictitious however.

A.1.  Trigger Message

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:KeyProvTrigger Version="1.0"
     xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
       keyprov-dskpp-1.0.xsd">
     <dskpp:InitializationTrigger>
       <dskpp:DeviceIdentifierData>
         <dskpp:DeviceId>
           <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
           <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
           <pskc:Model>U2</pskc:Model>
         </dskpp:DeviceId>
       </dskpp:DeviceIdentifierData>
       <dskpp:KeyID>SE9UUDAwMDAwMDAx</dskpp:KeyID>
       <dskpp:TokenPlatformInfo KeyLocation="Hardware"
         AlgorithmLocation="Software"/>
       <dskpp:TriggerNonce>112dsdfwf312asder394jw==</dskpp:TriggerNonce>
       <dskpp:ServerUrl>https://www.somekeyprovservice.com/
         </dskpp:ServerUrl>
     </dskpp:InitializationTrigger>
   </dskpp:KeyProvTrigger>

A.2.  Four-Pass Protocol

A.2.1.  <KeyProvClientHello> Without a reciprocal fashion as it was
           generated by the server.  If use of Preceding Trigger
   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:KeyProvClientHello Version="1.0"
     xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
      keyprov-dskpp-1.0.xsd">
     <dskpp:DeviceIdentifierData>
       <dskpp:DeviceId>
         <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
         <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
         <pskc:Model>U2</pskc:Model>
       </dskpp:DeviceId>
     </dskpp:DeviceIdentifierData>
     <dskpp:SupportedKeyTypes>
       <dskpp:Algorithm>http://www.ietf.org/keyprov/pskc#hotp
         </dskpp:Algorithm>
       <dskpp:Algorithm>http://www.rsa.com/rsalabs/otps/schemas/2005/09/
         otps-wst#SecurID-AES</dskpp:Algorithm>
     </dskpp:SupportedKeyTypes>
     <dskpp:SupportedEncryptionAlgorithms>
       <dskpp:Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5
         </dskpp:Algorithm>
       <dskpp:Algorithm>http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
         </dskpp:Algorithm>
     </dskpp:SupportedEncryptionAlgorithms>
     <dskpp:SupportedMacAlgorithms>
       <dskpp:Algorithm>http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
         </dskpp:Algorithm>
     </dskpp:SupportedMacAlgorithms>
     <dskpp:SupportedProtocolVariants><dskpp:FourPass/>
       </dskpp:SupportedProtocolVariants>
     <dskpp:SupportedKeyContainers>
       <dskpp:KeyContainerFormat>
         http://www.ietf.org/keyprov/pskc#KeyContainer
       </dskpp:KeyContainerFormat>
     </dskpp:SupportedKeyContainers>
   </dskpp:KeyProvClientHello>

A.2.2.  <KeyProvClientHello> Assuming a Preceding Trigger

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvClientHello Version="1.0"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
    keyprov-dskpp-1.0.xsd">
  <dskpp:DeviceIdentifierData>
    <dskpp:DeviceId>
      <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
      <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
      <pskc:Model>U2</pskc:Model>
    </dskpp:DeviceId>
  </dskpp:DeviceIdentifierData>
  <dskpp:KeyID>SE9UUDAwMDAwMDAx</dskpp:KeyID>
  <dskpp:TriggerNonce>112dsdfwf312asder394jw==</dskpp:TriggerNonce>
  <dskpp:SupportedKeyTypes>
    <dskpp:Algorithm>http://www.ietf.org/keyprov/pskc#hotp</dskpp:Algorithm>
    <dskpp:Algorithm>http://www.rsa.com/rsalabs/otps/schemas/2005/09/
      otps-wst#SecurID-AES</dskpp:Algorithm>
  </dskpp:SupportedKeyTypes>
  <dskpp:SupportedEncryptionAlgorithms>
    <dskpp:Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5
      </dskpp:Algorithm>
    <dskpp:Algorithm>http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
      </dskpp:Algorithm>
  </dskpp:SupportedEncryptionAlgorithms>
  <dskpp:SupportedMacAlgorithms>
    <dskpp:Algorithm>http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
      </dskpp:Algorithm>
  </dskpp:SupportedMacAlgorithms>
  <dskpp:SupportedProtocolVariants><dskpp:FourPass/>
    </dskpp:SupportedProtocolVariants>
  <dskpp:SupportedKeyContainers>
    <dskpp:KeyContainerFormat>
      http://www.ietf.org/keyprov/pskc#KeyContainer
    </dskpp:KeyContainerFormat>
  </dskpp:SupportedKeyContainers>
</dskpp:KeyProvClientHello>

A.2.3.  <KeyProvServerHello> Without a Preceding Trigger

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvServerHello Version="1.0" SessionID="4114" Status="Success"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
    keyprov-dskpp-1.0.xsd">
  <dskpp:KeyType>
    http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES
  </dskpp:KeyType>
  <dskpp:EncryptionAlgorithm>
    http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
  </dskpp:EncryptionAlgorithm>
  <dskpp:MacAlgorithm>
    http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
  </dskpp:MacAlgorithm>
  <dskpp:EncryptionKey>
    <ds:KeyName>KEY-1</ds:KeyName>
  </dskpp:EncryptionKey>
  <dskpp:KeyContainerFormat>
    http://www.ietf.org/keyprov/pskc#KeyContainer
  </dskpp:KeyContainerFormat>
  <dskpp:Payload>
    <dskpp:Nonce>qw2ewasde312asder394jw==</dskpp:Nonce>
  </dskpp:Payload>
</dskpp:KeyProvServerHello>

A.2.4.  <KeyProvServerHello> Assuming a Preceding Trigger
   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:KeyProvServerHello Version="1.0" SessionID="4114"
     Status="Success"
     xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
     xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
       keyprov-dskpp-1.0.xsd">
     <dskpp:KeyType>
       urn:ietf:params:xml:schema:keyprov:otpalg#SecurID-AES
     </dskpp:KeyType>
     <dskpp:EncryptionAlgorithm>
       http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
     </dskpp:EncryptionAlgorithm>
     <dskpp:MacAlgorithm>
       http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
     </dskpp:MacAlgorithm>
     <dskpp:EncryptionKey>
       <ds:KeyName>KEY-1</ds:KeyName>
     </dskpp:EncryptionKey>
     <dskpp:KeyContainerFormat>
       http://www.ietf.org/keyprov/pskc#KeyContainer
     </dskpp:KeyContainerFormat>
     <dskpp:Payload>
       <dskpp:Nonce>qw2ewasde312asder394jw==</dskpp:Nonce>
     </dskpp:Payload>
     <dskpp:Mac
       MacAlgorithm="http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes">
       cXcycmFuZG9tMzEyYXNkZXIzOTRqdw==
     </dskpp:Mac>
   </dskpp:KeyProvServerHello>

A.2.5.  <KeyProvClientNonce> Using Default Encryption

   This message contains the CKM_KIP_MAC mechanism
           has been negotiated, then in nonce chosen by the call to C_VerifyInit, cryptographic module,
   R_C, encrypted by the
           hKey parameter in specified encryption key and encryption
   algorithm.

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:KeyProvClientNonce Version="1.0" SessionID="4114"
     xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
       keyprov-dskpp-1.0.xsd">
     <dskpp:EncryptedNonce>VXENc+Um/9/NvmYKiHDLaErK0gk=
       </dskpp:EncryptedNonce>
     <dskpp:AuthenticationData>
       <dskpp:ClientID>31300257</dskpp:ClientID>
       <dskpp:AuthenticationCodeMac>
         <dskpp:IterationCount>512</dskpp:IterationCount>
         <dskpp:Mac>4bRJf9xXd3KchKoTenHJiw==</dskpp:Mac>
       </dskpp:AuthenticationCodeMac>
     </dskpp:AuthenticationData>
   </dskpp:KeyProvClientNonce>

A.2.6.  <KeyProvServerFinished> Using Default Encryption

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvServerFinished Version="1.0" SessionID="4114" Status="Success"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
    keyprov-dskpp-1.0.xsd">
  <dskpp:KeyContainer>
    <dskpp:KeyContainer Version="1.0">
      <pskc:DigestMethod
        Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
      <pskc:Device>
        <pskc:Key
          KeyAlgorithm="http://www.rsa.com/rsalabs/otps/schemas/2005/09/
            otps-wst#SecurID-AES"
          KeyId="XL0000000001234">
          <pskc:Issuer>CredentialIssuer</pskc:Issuer>
          <pskc:Usage OTP="true">
            <pskc:ResponseFormat Format="DECIMAL" Length="6"/>
          </pskc:Usage>
          <pskc:FriendlyName>MyFirstToken</pskc:FriendlyName>
          <pskc:Data Name="TIME">
            <pskc:Value>AAAAADuaygA=</pskc:Value>
          </pskc:Data>
          <pskc:Expiry>10/30/2012</pskc:Expiry>
        </pskc:Key>
      </pskc:Device>
    </dskpp:KeyContainer>
  </dskpp:KeyContainer>
  <dskpp:Mac
    MacAlgorithm="http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes">
    miidfasde312asder394jw==
  </dskpp:Mac>
</dskpp:KeyProvServerFinished>

A.3.  Two-Pass Protocol

A.3.1.  Example Using the CK_KIP_PARAMS structure MUST be set to
           NULL_PTR, Key Transport Profile

   The client indicates support all the pSeed parameter MUST be set to NULL_PTR, Key Transport, Key Wrap, and
           ulSeedLen MUST be set to 0.  The hKey parameter of
           C_VerifyInit MUST refer to K_MAC.
   Passphrase-Based Key Wrap profiles (see Section 3.2.2):

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvClientHello Version="1.0"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
  keyprov-dskpp-1.0.xsd">
  <dskpp:DeviceIdentifierData>
    <dskpp:DeviceId>
      <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
      <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
      <pskc:Model>U2</pskc:Model>
    </dskpp:DeviceId>
  </dskpp:DeviceIdentifierData>
  <dskpp:ClientNonce>xwQzwEl0CjPAiQeDxwRJdQ==</dskpp:ClientNonce>
  <dskpp:SupportedKeyTypes>
    <dskpp:Algorithm>http://www.ietf.org/keyprov/pskc#hotp
      </dskpp:Algorithm>
    <dskpp:Algorithm>
      http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES
    </dskpp:Algorithm>
  </dskpp:SupportedKeyTypes>
  <dskpp:SupportedEncryptionAlgorithms>
    <dskpp:Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5
      </dskpp:Algorithm>
    <dskpp:Algorithm>http://www.w3.org/2001/04/xmlenc#kw-aes128
      </dskpp:Algorithm>
    <dskpp:Algorithm>http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
      </dskpp:Algorithm>
  </dskpp:SupportedEncryptionAlgorithms>
  <dskpp:SupportedMacAlgorithms>
    <dskpp:Algorithm>http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
      </dskpp:Algorithm>
  </dskpp:SupportedMacAlgorithms>
  <dskpp:SupportedProtocolVariants>
    <dskpp:TwoPass>
      <dskpp:SupportedKeyProtectionMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#wrap
      </dskpp:SupportedKeyProtectionMethod>
      <dskpp:Payload xsi:type="ds:KeyInfoType">
        <ds:KeyName>Key_001</ds:KeyName>
      </dskpp:Payload>
      <dskpp:SupportedKeyProtectionMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#transport
      </dskpp:SupportedKeyProtectionMethod>
      <dskpp:SupportedKeyProtectionMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#passphrase-wrap
      </dskpp:SupportedKeyProtectionMethod>
      <dskpp:Payload xsi:type="ds:KeyInfoType">
        <ds:X509Data>
          <ds:X509Certificate>miib</ds:X509Certificate>
        </ds:X509Data>
      </dskpp:Payload>
    </dskpp:TwoPass>
  </dskpp:SupportedProtocolVariants>
  <dskpp:SupportedKeyContainers>
    <dskpp:KeyContainerFormat>
      http://www.ietf.org/keyprov/pskc#KeyContainer
    </dskpp:KeyContainerFormat>
  </dskpp:SupportedKeyContainers>
  <dskpp:AuthenticationData>
    <dskpp:ClientID>31300257</dskpp:ClientID>
    <dskpp:AuthenticationCodeMac>
      <dskpp:IterationCount>512</dskpp:IterationCount>
      <dskpp:Mac>4bRJf9xXd3KchKoTenHJiw==</dskpp:Mac>
    </dskpp:AuthenticationCodeMac>
  </dskpp:AuthenticationData>
</dskpp:KeyProvClientHello>

   In this example, the call to C_Verify,
           pData MUST be set server responds to the concatenation of the string ID_S and previous request using
   the nonce R, and key transport profile.

  <?xml version="1.0" encoding="UTF-8"?>
  <dskpp:KeyProvServerFinished Version="1.0" SessionID="4114"
    Status="Success"
    xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
    xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
    xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
      keyprov-dskpp-1.0.xsd">
    <dskpp:KeyContainer>
      <dskpp:KeyContainer Version="1.0">
      <dskpp:ServerID>https://www.somedskppservice.com/</dskpp:ServerID>
      <dskpp:KeyProtectionMethod>
          urn:ietf:params:xml:schema:keyprov:protocol#transport
      </dskpp:KeyProtectionMethod>
        <pskc:EncryptionMethod
          Algorithm="http://www.w3.org/2001/05/xmlenc#rsa_1_5">
          <pskc:KeyInfo>
            <ds:X509Data>
              <ds:X509Certificate>miib</ds:X509Certificate>
            </ds:X509Data>
          </pskc:KeyInfo>
        </pskc:EncryptionMethod>
        <pskc:DigestMethod
          Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
        <pskc:Device>
          <pskc:Key KeyAlgorithm="http://www.ietf.org/keyprov/pskc#hotp"
            KeyId="SDU312345678">
            <pskc:Issuer>CredentialIssuer</pskc:Issuer>
            <pskc:Usage OTP="true">
              <pskc:ResponseFormat Format="DECIMAL" Length="6"/>
            </pskc:Usage>
            <pskc:FriendlyName>MyFirstToken</pskc:FriendlyName>
            <pskc:Data Name="SECRET">
              <pskc:Value>
                7JHUyp3azOkqJENSsh6b2vxXzwGBYypzJxEr+ikQAa229KV/BgZhGA==
              </pskc:Value>
              <pskc:ValueDigest>
                i8j+kpbfKQsSlwmJYS99lQ==
              </pskc:ValueDigest>
            </pskc:Data>
            <pskc:Data Name="COUNTER">
              <pskc:Value>AAAAAAAAAAA=</pskc:Value>
            </pskc:Data>
            <pskc:Expiry>10/30/2012</pskc:Expiry>
          </pskc:Key>
        </pskc:Device>
      </dskpp:KeyContainer>
    </dskpp:KeyContainer>
    <dskpp:Mac
      MacAlgorithm="http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes">
      miidfasde312asder394jw==
    </dskpp:Mac>
    <dskpp:AuthenticationData>
      <dskpp:AuthenticationCodeMac>
        <dskpp:Mac>4bRJf9xXd3KchKoTenHJiw==</dskpp:Mac>
      </dskpp:AuthenticationCodeMac>
    </dskpp:AuthenticationData>
  </dskpp:KeyProvServerFinished>

A.3.2.  Example Using the ulDataLen parameter MUST be set Key Wrap Profile

   The client sends a request that specifies a shared key to protect the
           length of
   K_TOKEN, and the concatenated string, pSignature to server responds using the MAC
           value received from Key Wrap Profile.
   Authentication data in this example is basing on an authentication
   code rather than a device certificate.

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:KeyProvClientHello Version="1.0"
     xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
     xmlns:pkcs-5=
       "http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5v2-0#"
     xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
     keyprov-dskpp-1.0.xsd">
     <dskpp:DeviceIdentifierData>
       <dskpp:DeviceId>
         <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
         <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
         <pskc:Model>U2</pskc:Model>
       </dskpp:DeviceId>
     </dskpp:DeviceIdentifierData>
     <dskpp:ClientNonce>xwQzwEl0CjPAiQeDxwRJdQ==</dskpp:ClientNonce>
     <dskpp:SupportedKeyTypes>
       <dskpp:Algorithm>http://www.ietf.org/keyprov/pskc#hotp
         </dskpp:Algorithm>
       <dskpp:Algorithm>http://www.rsa.com/rsalabs/otps/schemas/2005/09/
         otps-wst#SecurID-AES</dskpp:Algorithm>
     </dskpp:SupportedKeyTypes>
     <dskpp:SupportedEncryptionAlgorithms>
       <dskpp:Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5
         </dskpp:Algorithm>
       <dskpp:Algorithm>http://www.w3.org/2001/04/xmlenc#kw-aes128
         </dskpp:Algorithm>
       <dskpp:Algorithm>http://www.rsasecurity.com/rsalabs/pkcs/schemas/
         pkcs-5#pbes2</dskpp:Algorithm>
       <dskpp:Algorithm>http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
         </dskpp:Algorithm>
     </dskpp:SupportedEncryptionAlgorithms>
     <dskpp:SupportedMacAlgorithms>
       <dskpp:Algorithm>http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
         </dskpp:Algorithm>
     </dskpp:SupportedMacAlgorithms>
     <dskpp:SupportedProtocolVariants>
       <dskpp:TwoPass>
         <dskpp:SupportedKeyProtectionMethod>
           urn:ietf:params:xml:schema:keyprov:protocol#wrap
         </dskpp:SupportedKeyProtectionMethod>
         <dskpp:Payload xsi:type="ds:KeyInfoType">
           <ds:KeyName>Key_001</ds:KeyName>
         </dskpp:Payload>
       </dskpp:TwoPass>
     </dskpp:SupportedProtocolVariants>
     <dskpp:SupportedKeyContainers>
       <dskpp:KeyContainerFormat>
         http://www.ietf.org/keyprov/pskc#KeyContainer
       </dskpp:KeyContainerFormat>
     </dskpp:SupportedKeyContainers>
     <dskpp:AuthenticationData>
       <dskpp:ClientID>31300257</dskpp:ClientID>
       <dskpp:AuthenticationCodeMac>
         <dskpp:IterationCount>512</dskpp:IterationCount>
         <dskpp:Mac>4bRJf9xXd3KchKoTenHJiw==</dskpp:Mac>
       </dskpp:AuthenticationCodeMac>
     </dskpp:AuthenticationData>
   </dskpp:KeyProvClientHello>

   In this example, the server, and ulSignatureLen server responds to the
           length of the MAC.  If previous request using
   the MAC does not verify key wrap profile.

  <?xml version="1.0" encoding="UTF-8"?>
  <dskpp:KeyProvServerFinished Version="1.0" Status="Success"
    xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
    xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
    xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
    keyprov-dskpp-1.0.xsd">
    <dskpp:KeyContainer>
      <dskpp:KeyContainer Version="1.0">
      <dskpp:ServerID>https://www.somedskppservice.com/</dskpp:ServerID>
      <dskpp:KeyProtectionMethod>
          urn:ietf:params:xml:schema:keyprov:protocol#wrap
      </dskpp:KeyProtectionMethod>
        <pskc:EncryptionMethod
          Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes128">
          <pskc:KeyInfo>
             <ds:KeyName>Key-001</ds:KeyName>
           </pskc:KeyInfo>
        </pskc:EncryptionMethod>
        <pskc:DigestMethod
          Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
        <pskc:Device>
          <pskc:Key KeyAlgorithm="http://www.ietf.org/keyprov/pskc#hotp"
            KeyId="SDU312345678">
            <pskc:Issuer>CredentialIssuer</pskc:Issuer>
            <pskc:Usage OTP="true">
              <pskc:ResponseFormat Format="DECIMAL" Length="6"/>
            </pskc:Usage>
            <pskc:FriendlyName>MyFirstToken</pskc:FriendlyName>
            <pskc:Data Name="SECRET">
              <pskc:Value>
                JSPUyp3azOkqJENSsh6b2hdXz1WBYypzJxEr+ikQAa22M6V/BgZhRg==
              </pskc:Value>
              <pskc:ValueDigest>
                i8j+kpbfKQsSlwmJYS99lQ==
              </pskc:ValueDigest>
            </pskc:Data>
            <pskc:Data Name="COUNTER">
              <pskc:Value>AAAAAAAAAAA=</pskc:Value>
            </pskc:Data>
            <pskc:Expiry>10/30/2012</pskc:Expiry>
          </pskc:Key>
        </pskc:Device>
      </dskpp:KeyContainer>
    </dskpp:KeyContainer>
    <dskpp:Mac
      MacAlgorithm="http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes">
      miidfasde312asder394jw==
    </dskpp:Mac>
    <dskpp:AuthenticationData>
      <dskpp:AuthenticationCodeMac>
        <dskpp:Mac>4bRJf9xXd3KchKoTenHJiw==</dskpp:Mac>
      </dskpp:AuthenticationCodeMac>
    </dskpp:AuthenticationData>
  </dskpp:KeyProvServerFinished>

A.3.3.  Example Using the protocol
           session ends with a failure. Passphrase-Based Key Wrap Profile

   The token MUST be constructed
           to not "commit" client sends a request similar to the new K_TOKEN or the new K_MAC unless
           the MAC verifies.
       3.  If that in Appendix A.3.1 with
   authentication data basing on an authenticating MAC was received (REQUIRED if authentication code, and the new
           K_TOKEN will replace an existing key on server
   responds using the token), then it Passphrase-Based Key Wrap Profile.  The
   authentication data is verified set in clear text when it is sent over a similar vein but using the K_MAC associated
           with
   secure transport channel such as TLS.

<?xml version="1.0" encoding="UTF-8"?>
<dskpp:KeyProvClientHello Version="1.0"
  xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
  xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:pkcs-5=
    "http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5v2-0#"
  xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
    keyprov-dskpp-1.0.xsd">
  <dskpp:DeviceIdentifierData>
    <dskpp:DeviceId>
      <pskc:Manufacturer>ManufacturerABC</pskc:Manufacturer>
      <pskc:SerialNo>XL0000000001234</pskc:SerialNo>
      <pskc:Model>U2</pskc:Model>
    </dskpp:DeviceId>
  </dskpp:DeviceIdentifierData>
  <dskpp:ClientNonce>xwQzwEl0CjPAiQeDxwRJdQ==</dskpp:ClientNonce>
  <dskpp:SupportedKeyTypes>
    <dskpp:Algorithm>http://www.ietf.org/keyprov/pskc#hotp
      </dskpp:Algorithm>
    <dskpp:Algorithm>
      http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#SecurID-AES
    </dskpp:Algorithm>
  </dskpp:SupportedKeyTypes>
  <dskpp:SupportedEncryptionAlgorithms>
    <dskpp:Algorithm>http://www.w3.org/2001/05/xmlenc#rsa_1_5
      </dskpp:Algorithm>
    <dskpp:Algorithm>http://www.w3.org/2001/04/xmlenc#kw-aes128
      </dskpp:Algorithm>
    <dskpp:Algorithm>
      http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2
    </dskpp:Algorithm>
    <dskpp:Algorithm>
      http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
    </dskpp:Algorithm>
  </dskpp:SupportedEncryptionAlgorithms>
  <dskpp:SupportedMacAlgorithms>
    <dskpp:Algorithm>
      http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes
    </dskpp:Algorithm>
  </dskpp:SupportedMacAlgorithms>
  <dskpp:SupportedProtocolVariants>
    <dskpp:TwoPass>
      <dskpp:SupportedKeyProtectionMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#wrap
      </dskpp:SupportedKeyProtectionMethod>
      <dskpp:Payload xsi:type="ds:KeyInfoType">
        <ds:KeyName>Key_001</ds:KeyName>
      </dskpp:Payload>
      <dskpp:SupportedKeyProtectionMethod>
        urn:ietf:params:xml:schema:keyprov:protocol#passphrase-wrap
      </dskpp:SupportedKeyProtectionMethod>
    </dskpp:TwoPass>
  </dskpp:SupportedProtocolVariants>
  <dskpp:SupportedKeyContainers>
    <dskpp:KeyContainerFormat>
      http://www.ietf.org/keyprov/pskc#KeyContainer
    </dskpp:KeyContainerFormat>
  </dskpp:SupportedKeyContainers>
  <dskpp:AuthenticationData>
    <dskpp:ClientID>31300257</dskpp:ClientID>
    <dskpp:AuthenticationCodeMac>
      <dskpp:IterationCount>512</dskpp:IterationCount>
      <dskpp:Mac>4bRJf9xXd3KchKoTenHJiw==</dskpp:Mac>
    </dskpp:AuthenticationCodeMac>
  </dskpp:AuthenticationData>
</dskpp:KeyProvClientHello>

   In this server and existing before example, the protocol run.
           Again, if server responds to the MAC does not verify previous request using
   the protocol session ends Passphrase-Based Key Wrap Profile.

  <?xml version="1.0" encoding="UTF-8"?>
  <dskpp:KeyProvServerFinished Version="1.0"
    SessionID="4114" Status="Success"
    xmlns:dskpp="urn:ietf:params:xml:ns:keyprov:protocol:1.0"
    xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container:1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
    xsi:schemaLocation="urn:ietf:params:xml:ns:keyprov:protocol:1.0
      keyprov-dskpp-1.0.xsd">
    <dskpp:KeyContainer>
      <dskpp:KeyContainer Version="1.0">
      <dskpp:ServerID>https://www.somedskppservice.com/</dskpp:ServerID>
      <dskpp:KeyProtectionMethod>
          urn:ietf:params:xml:schema:keyprov:protocol#passphrase-wrap
      </dskpp:KeyProtectionMethod>
        <pskc:EncryptionMethod
          Algorithm="http://www.rsasecurity.com/rsalabs/pkcs/schemas/
            pkcs-5#pbes2">
            <pskc:PBEEncryptionParam
               EncryptionAlgorithm=
                 "http://www.w3.org/2001/04/xmlenc#kw-aes128-cbc">
              <pskc:PBESalt>y6TzckeLRQw=</pskc:PBESalt>
              <pskc:PBEIterationCount>1024</pskc:PBEIterationCount>
            </pskc:PBEEncryptionParam>
            <pskc:IV>c2FtcGxlaXY=</pskc:IV>
          </pskc:EncryptionMethod>
        <pskc:DigestMethod
          Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
        <pskc:Device>
          <pskc:Key KeyAlgorithm="http://www.ietf.org/keyprov/pskc#hotp"
            KeyId="SDU312345678">
            <pskc:Issuer>CredentialIssuer</pskc:Issuer>
            <pskc:Usage OTP="true">
              <pskc:ResponseFormat Format="DECIMAL" Length="6"/>
            </pskc:Usage>
            <pskc:FriendlyName>MyFirstToken</pskc:FriendlyName>
            <pskc:Data Name="SECRET">
              <pskc:Value>
                JSPUyp3azOkqJENSsh6b2hdXz1WBYypzJxEr+ikQAa22M6V/BgZhRg==
              </pskc:Value>
              <pskc:ValueDigest>
                i8j+kpbfKQsSlwmJYS99lQ==
              </pskc:ValueDigest>
            </pskc:Data>
            <pskc:Data Name="COUNTER">
              <pskc:Value>AAAAAAAAAAA=</pskc:Value>
            </pskc:Data>
            <pskc:Expiry>10/30/2012</pskc:Expiry>
          </pskc:Key>
        </pskc:Device>
      </dskpp:KeyContainer>
    </dskpp:KeyContainer>
    <dskpp:Mac
      MacAlgorithm="http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes">
      miidfasde312asder394jw==
    </dskpp:Mac>
    <dskpp:AuthenticationData>
      <dskpp:AuthenticationCodeMac>
        <dskpp:Mac>4bRJf9xXd3KchKoTenHJiw==</dskpp:Mac>
      </dskpp:AuthenticationCodeMac>
    </dskpp:AuthenticationData>
  </dskpp:KeyProvServerFinished>

Appendix B.  Integration with a failure, and the token MUST be constructed no PKCS #11

   A DSKPP client that needs to
           "commit" communicate with a connected
   cryptographic module to perform a DSKPP exchange MAY use PKCS #11
   [PKCS-11]as a programming interface.

B.1.  The 4-pass Variant

   When performing 4-pass DSKPP with a cryptographic module using the new K_TOKEN or the new K_MAC unless
   PKCS #11 programming interface, the MAC
           verifies.

A.3. procedure described in
   [CT-KIP-P11], Appendix B, is RECOMMENDED.

B.2.  The 1-pass 2-pass Variant

   A suggested procedure to perform 1-pass 2-pass DSKPP with a cryptographic
   module through the PKCS #11 interface using the mechanisms defined in
   [CT-KIP-P11] is as follows:

   a.  On the client side,
       1.  The client selects a suitable slot and token (e.g. through
           use of the <DeviceIdentifier> or the <PlatformInfo> element
           of the DSKPP trigger message).
       2.  A nonce R is generated, e.g. by calling C_SeedRandom and
           C_GenerateRandom.
       3.  The client sends its first message to the server, including
           the nonce R.
   b.  On the server side,
       1.  A generic key K K_PROV = K_TOKEN | K _MAC K_MAC (where '|' denotes
           concatenation) is generated, e.g. by calling C_GenerateKey
           (using key type CKK_GENERIC_SECRET).  The template for K K_PROV
           MUST allow it to be exported (but only in wrapped form, i.e.
           CKA_SENSITIVE MUST be set to CK_TRUE and CKA_EXTRACTABLE MUST
           also be set to CK_TRUE), and also to be used for further key
           derivation.  From K, a token key K_TOKEN of suitable type is
           derived by calling C_DeriveKey using the PKCS #11 mechanism
           CKM_EXTRACT_KEY_FROM_KEY and setting the CK_EXTRACT_PARAMS to
           the first bit of the generic secret key (i.e. set to 0).
           Likewise, a MAC key K_MAC is derived from K K_PROV by calling
           C_DeriveKey using the CKM_EXTRACT_KEY_FROM_KEY mechanism,
           this time setting CK_EXTRACT_PARAMS to the length of K K_PROV
           (in bits) divided by two.
       2.  The server wraps K K_PROV with either the token's public key, key
           K_CLIENT, the shared secret key, key K_SHARED, or the derived
           shared secret key, key K_DERIVED by using C_WrapKey.  If use of
           the DSKPP key wrap algorithm has been negotiated, negotiated then the
           CKM_KIP_WRAP mechanism MUST be used to wrap K. When calling
           C_WrapKey, the hKey handle in the CK_KIP_PARAMS structure
           MUST be set to NULL_PTR.  The pSeed parameter in the
           CK_KIP_PARAMS structure MUST point to the octet-string
           representation of an integer I whose value MUST be
           incremented before each protocol run, nonce R provided by
           the DSKPP client, and the ulSeedLen parameter MUST indicate
           the length of the octet-string
           representation of I. R. The hWrappingKey parameter in the call to
           C_WrapKey MUST be set to refer to the wrapping key.

           Note: The integer-to-octet string conversion MUST be made
           using the I2OSP primitive from [PKCS-1].  There MUST be no
           leading zeros.
       3.  For  Next, the server's message server needs to the client, if calculate a MAC using K_MAC.  If
           use of the DSKPP MAC algorithm has been negotiated, then the
           MAC is calculated by calling C_SignInit with the CKM_KIP_MAC
           mechanism followed by a call to C_Sign.  In the call to
           C_SignInit, K_MAC MUST be the signature key, the hKey
           parameter in the CK_KIP_PARAMS structure MUST be set to
           NULL_PTR, the pSeed parameter of the CT_KIP_PARAMS structure
           MUST be set to NULL_PTR, and the ulSeedLen parameter MUST be
           set to zero.  In the call to C_Sign, the pData parameter MUST
           be set to the concatenation of the string ID_S ServerID and the octet-string representation of the
           integer I,
           nonce R, and the ulDataLen parameter MUST be set to the
           length of the concatenated string.  The desired length of the
           MAC MUST be specified through the pulSignatureLen parameter as
           usual,
           and MUST be equal to, or greater than, sixteen (16). set to the length of R.

       4.  If the server also needs to authenticate its message (due to
           an existing K_TOKEN being replaced), the server calculates MUST
           calculate a second MAC.  If  Again, if use of the DSKPP MAC mechanism is used,
           algorithm has been negotiated, then the server
           does this MAC is calculated by
           calling C_SignInit with the CKM_KIP_MAC mechanism followed by
           a call to C_Sign.  In the this call to C_SignInit, the K_MAC
           existing on the token before this DSKPP protocol run MUST be the signature
           key, the hKey parameter in the CK_KIP_PARAMS structure MUST
           be set to NULL_PTR, NULL, the pSeed parameter of the CT_KIP_PARAMS
           structure MUST be set to NULL_PTR, and the ulSeedLen ulSeeidLen
           parameter MUST be set to zero.  In the call to C_Sign, the
           pData parameter MUST be set to the concatenation of the
           string ID_S ServerID and the octet-string
           representation of the integer I+1 (i.e.  I MUST be
           incremented before each use), nonce R, and the ulDataLen parameter
           MUST be set to the length of the concatenated string.  The
           desired length of the MAC MUST be specified through the
           pulSignatureLen parameter as usual, and MUST be equal to, or
           greater than, sixteen (16). set to the length of R.
       5.  The server sends its message to the client, including the
           wrapped key K, the MAC and possibly also the authenticating
           MAC.
   b.
   c.  On the client side,
       1.  The client calls C_UnwrapKey to receive a handle to K. After
           this, the client calls C_DeriveKey twice: Once to derive
           K_TOKEN and once to derive K_MAC.  The client MUST use the
           same mechanism (CKM_EXTRACT_KEY_FROM_KEY) and the same
           mechanism parameters as used by the server above.  When
           calling C_UnwrapKey and C_DeriveKey, the pTemplate parameter
           MUST be used to set additional key attributes in accordance
           with local policy and as negotiated and expressed in the
           protocol.  In particular, the value of the <KeyID> element in
           the server's response message MAY be used as CKA_ID for
           K_TOKEN.  The key K K_PROV MUST be destroyed after deriving
           K_TOKEN and K_MAC.
       2.  The MAC is verified in a reciprocal fashion as it was
           generated by the server.  If use of the CKM_KIP_MAC mechanism
           has been negotiated, then in the call to C_VerifyInit, the
           hKey parameter in the CK_KIP_PARAMS structure MUST be set to
           NULL_PTR, the pSeed parameter MUST be set to NULL_PTR, and
           ulSeedLen MUST be set to 0.  The hKey parameter of
           C_VerifyInit MUST refer to K_MAC.  In the call to C_Verify,
           pData MUST be set to the concatenation of the string ID_S ServerID
           and the octet-string representation of the provided value for I, nonce R, and the ulDataLen parameter MUST be set to
           the length of the concatenated string, pSignature to the MAC
           value received from the server, and ulSignatureLen to the
           length of the MAC.  If the MAC does not verify or if the provided value of I is
           not larger than any stored value I' for the identified server
           ID_S the protocol
           session ends with a failure.  The token MUST be constructed
           to not "commit" to the new K_TOKEN or the new K_MAC unless
           the MAC verifies.  If the verification
           succeeds, the token MUST store the provided value of I as a
           new I' for ID_S.

       3.  If an authenticating MAC was received (REQUIRED if the new
           K_TOKEN will replace an existing key on the token), then it
           is verified in a similar vein but using the K_MAC associated
           with this server and existing before the protocol run.
           Again, if the MAC does not verify the protocol session ends
           with a failure, and the token MUST be constructed no to
           "commit" to the new K_TOKEN or the new K_MAC unless the MAC
           verifies.

Appendix B. C.  Example of DSKPP-PRF Realizations

B.1.

C.1.  Introduction

   This example appendix defines DSKPP-PRF in terms of AES [FIPS197-AES]
   and HMAC [RFC2104].

B.2.

C.2.  DSKPP-PRF-AES

B.2.1.

C.2.1.  Identification

   For cryptographic modules supporting this realization of DSKPP-PRF,
   the following URI URL MAY be used to identify this algorithm in DSKPP:

   urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes

   http://www.ietf.org/keyprov/dskpp#dskpp-prf-aes

   When this URI URL is used to identify the encryption algorithm to use,
   the method for encryption of R_C values described in Section 5.2 3.5 MUST
   be used.

B.2.2.

C.2.2.  Definition

   DSKPP-PRF-AES (k, s, dsLen)

   Input:
   k         Encryption key to use
   s         Octet string consisting of randomizing material.  The
             length of the string s is sLen.
   dsLen     Desired length of the output

   Output:

   DS        A pseudorandom string, dsLen-octets long

   Steps:

   1.  Let bLen be the output block size of AES in octets:

       bLen = (AES output block length in octets)
       (normally, bLen = 16)
   2.  If dsLen > (2**32 - 1) * bLen, output "derived data too long" and
       stop
   3.  Let n be the number of bLen-octet blocks in the output data,
       rounding up, and let j be the number of octets in the last block:

       n = ROUND( dsLen / bLen)
       j = dsLen - (n - 1) * bLen
   4.  For each block of the pseudorandom string DS, apply the function
       F defined below to the key k, the string s and the block index to
       compute the block:

       B1 = F (k, s, 1) ,
       B2 = F (k, s, 2) ,
       ...
       Bn = F (k, s, n)
   The function F is defined in terms of the OMAC1 construction from
   [FSE2003], using AES as the block cipher:

   F (k, s, i) = OMAC1-AES (k, INT (i) || s)

   where INT (i) is a four-octet encoding of the integer i, most
   significant octet first, and the output length of OMAC1 is set to
   bLen.

   Concatenate the blocks and extract the first dsLen octets to product
   the desired data string DS:

   DS = B1 || B2 || ... || Bn<0..j-1>

   Output the derived data DS.

B.2.3.

C.2.3.  Example

   If we assume that dsLen = 16, then:

   n = 16 / 16 = 1

   j = 16 - (1 - 1) * 16 = 16

   DS = B1 = F (k, s, 1) = OMAC1-AES (k, INT (1) || s)

B.3.

C.3.  DSKPP-PRF-SHA256

B.3.1.

C.3.1.  Identification

   For cryptographic modules supporting this realization of DSKPP-PRF,
   the following URI URL MAY be used to identify this algorithm in DSKPP:

   urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-sha256

   http://www.ietf.org/keyprov/dskpp#dskpp-prf-sha256

   When this URI URL is used to identify the encryption algorithm to use,
   the method for encryption of R_C values described in Section 5.2 3.5 MUST
   be used.

B.3.2.

C.3.2.  Definition

   DSKPP-PRF-SHA256 (k, s, dsLen)

   Input:
   k         Encryption key to use
   s         Octet string consisting of randomizing material.  The
             length of the string s is sLen.
   dsLen     Desired length of the output

   Output:

   DS        A pseudorandom string, dsLen-octets long

   Steps:

   1.  Let bLen be the output size of SHA-256 in octets of [FIPS180-SHA]
       (no truncation is done on the HMAC output):

       bLen = 32
       (normally, bLen = 16)
   2.  If dsLen > (2**32 - 1) * bLen, output "derived data too long" and
       stop
   3.  Let n be the number of bLen-octet blocks in the output data,
       rounding up, and let j be the number of octets in the last block:

       n = ROUND( dsLen / bLen)
       j = dsLen - (n - 1) * bLen
   4.  For each block of the pseudorandom string DS, apply the function
       F defined below to the key k, the string s and the block index to
       compute the block:

       B1 = F (k, s, 1) ,
       B2 = F (k, s, 2) ,
       ...

       Bn = F (k, s, n)
   The function F is defined in terms of the HMAC construction from
   [RFC2104], using SHA-256 as the digest algorithm:

   F (k, s, i) = HMAC-SHA256 (k, INT (i) || s)

   where INT (i) is a four-octet encoding of the integer i, most
   significant octet first, and the output length of HMAC is set to
   bLen.

   Concatenate the blocks and extract the first dsLen octets to product
   the desired data string DS:

   DS = B1 || B2 || ... || Bn<0..j-1>

   Output the derived data DS.

B.3.3.

C.3.3.  Example

   If we assume that sLen = 256 (two 128-octet long values) and dsLen =
   16, then:

   n = ROUND ( 16 / 32 ) = 1

   j = 16 - (1 - 1) * 32 = 16

   B1 = F (k, s, 1) = HMAC-SHA256 (k, INT (1) || s)

   DS = B1<0 ... 15>

   That is, the result will be the first 16 octets of the HMAC output.

Authors' Addresses

   Andrea Doherty
   RSA, The Security Division of EMC
   174 Middlesex Tpk.
   Bedford, MA  01730
   USA

   Email: adoherty@rsa.com
   Mingliang Pei
   Verisign, Inc.
   487 E. Middlefield Road
   Mountain View, CA  94043
   USA

   Email: mpei@verisign.com

   Salah Machani
   Diversinet Corp.
   2225 Sheppard Avenue East, Suite 1801
   Toronto, Ontario  M2J 5C2
   Canada

   Email: smachani@diversinet.com

   Magnus Nystrom
   RSA, The Security Division of EMC
   Arenavagen 29
   Stockholm, Stockholm Ln  121 29
   SE

   Email: mnystrom@rsa.com

Full Copyright Statement

   Copyright (C) The IETF Trust (2007). (2008).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
   THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
   THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at
   ietf-ipr@ietf.org.

Acknowledgment

   Funding for the RFC Editor function is provided by the IETF
   Administrative Support Activity (IASA).