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

          Dynamic Symmetric Key Provisioning Protocol (DSKPP)
                    draft-ietf-keyprov-dskpp-00.txt
                    draft-ietf-keyprov-dskpp-01.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 January 27, May 1, 2008.

Copyright Notice

   Copyright (C) The IETF Trust (2007).

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 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 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, 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 . . . . . . . . . . . . . . . . . . . . . . . . . .   7
     1.2.  Background  . . . . . . . . . . . . . . . . . . . . . . .   7
   2.  Requirements Notation and Terminology . . . . . . . . . . . .   8
   3.  Use Cases . . . . . . . .   8
   3.  Use Cases . . . . . . . . . . . . . . . . . .  11
     3.1.  Single Key Request  . . . . . . . .   9
     3.1.  A cryptographic module obtains a symmetric key . . . . .   9 . . . . . .  11
     3.2.  A cryptographic module acquires multiple symmetric
           keys of different types  Multiple Key Requests . . . . . . . . . . . . . . . . .   9 .  11
     3.3.  A provisioning server imposes a validity period policy
           for provisioning sessions  Session Time-Out Policy . . . . . . . . . . . . . . . .  10
     3.4.  A symmetric key issuer uses a third party provisioning
           service provider .  11
     3.4.  Outsourced Provisioning . . . . . . . . . . . . . . . . .  12
     3.5.  Key Renewal . .  10
     3.5.  A cryptographic module renews its symmetric key with
           the same key ID . . . . . . . . . . . . . . . . . . . . .  10  12
     3.6.  An administrator initiates a symmetric key replacement
           before it can be used  Pre-Loaded Key Replacement  . . . . . . . . . . . . . . .  12
     3.7.  Pre-Shared Transport Key  . . .  10
     3.7.  A cryptographic module hosted by a smart card uses a
           pre-shared transport key to communicate with the
           provisioning server . . . . . . . . . . . . .  12
     3.8.  SMS-Based Key Transport . . . . . .  11
     3.8.  A cryptographic module hosted by a mobile device
           downloads a symmetric key through SMS . . . . . . . . . .  11
     3.9.  A cryptographic module acquires a symmetric key over a
           transport protocol that does not ensure data
           confidentiality .  13
     3.9.  Non-Protected Transport Layer . . . . . . . . . . . . . .  13
     3.10. Non-Authenticated Transport Layer . . . . . .  12
     3.10. A cryptographic module acquires a symmetric key over a
           transport protocol that does not provide authentication .  12
   4.  DSKPP . . . . .  13
   4.  DSKPP Overview  . . . . . . . . . . . . . . . . . . . . . . .  12  13
     4.1.  Entities  . . . . . . . . . . . . . . . . . . . . . . . .  12  13
     4.2.  Principles  Overview of Operation Protocol Usage  . . . . . . . . . . . . . . .  15
     4.3.  Four-Pass Protocol Usage  . .  14
       4.2.1.  Four-pass DSKPP . . . . . . . . . . . . . .  18
       4.3.1.  Message Flow  . . . . .  15
       4.2.2.  Two-pass DSKPP . . . . . . . . . . . . . . .  19
       4.3.2.  Generation of Symmetric Keys for Cryptographic
               Modules . . . .  19
       4.2.3.  One-pass DSKPP . . . . . . . . . . . . . . . . . . .  21
     4.3.  20
       4.3.3.  Client Authentication . . . . . . . . . . . . . . . .  23
       4.3.4.  Key Confirmation  . . . . .  22
       4.3.1.  Client Authentication (Applicable to Four- and
               Two-Pass DSKPP) . . . . . . . . . . . . .  23
       4.3.5.  Server Authentication . . . . . .  22
       4.3.2.  Server Authentication . . . . . . . . . .  23
     4.4.  Two-Pass Protocol Usage . . . . . .  25
     4.4.  Symmetric Key Container Format . . . . . . . . . . .  24
       4.4.1.  Message Flow  . .  25
     4.5.  The DSKPP One-Way Pseudorandom Function, DSKPP-PRF . . .  25
       4.5.1.  Introduction . . . . . . . . . . . . . . .  26
       4.4.2.  Key Confirmation  . . . . .  25
       4.5.2.  Declaration . . . . . . . . . . . . .  27
       4.4.3.  Server Authentication . . . . . . . .  26
     4.6.  Generation of Symmetric Keys for Cryptographic Modules .  26
     4.7.  Encryption of Pseudorandom Nonces Sent from the DSKPP
           Client . . . . . . .  27
     4.5.  One-Pass Protocol Usage . . . . . . . . . . . . . . . . .  28
       4.5.1.  Message Flow  . .  27
     4.8.  MAC calculations . . . . . . . . . . . . . . . . . .  29
       4.5.2.  Key Confirmation  . .  27
       4.8.1.  Four-pass DSKPP . . . . . . . . . . . . . . . .  30
       4.5.3.  Server Authentication . . .  27
       4.8.2.  Two-pass DSKPP . . . . . . . . . . . . .  30
   5.  Methods Common to More Than One Protocol Variant  . . . . . .  28
       4.8.3.  One-pass  31
     5.1.  The DSKPP One-Way Pseudorandom Function, DSKPP-PRF  . . .  31
       5.1.1.  Introduction  . . . . . . . . . . . . . . . . .  29
     4.9.  DSKPP Schema Basics . . .  31
       5.1.2.  Declaration . . . . . . . . . . . . . . . . .  30
       4.9.1.  The AbstractRequestType Type . . . .  32
     5.2.  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) . . . . .  31
       4.9.2.  The AbstractResponseType Type . . . . . . . . . . . .  31
       4.9.3.  The VersionType Type . .  32
       5.3.1.  Device Certificate  . . . . . . . . . . . . . .  32
       4.9.4.  The IdentifierType Type . . .  33
       5.3.2.  Device Identifier . . . . . . . . . . . .  32
       4.9.5.  The StatusCode Type . . . . . .  33
       5.3.3.  Authentication Code . . . . . . . . . . .  32
       4.9.6.  The DeviceIdentifierDataType Type . . . . . .  33
     5.4.  Client Authentication Examples  . . . .  34
       4.9.7.  The TokenPlatformInfoType and PlatformType Types . .  35
       4.9.8.  The NonceType Type . . . . . . .  36
       5.4.1.  Example Using a MAC from an Authentication Code . . .  36
       5.4.2.  Example Using a Device Certificate  . . . . . . .  35
       4.9.9.  The AlgorithmsType Type . .  36
   6.  Four-Pass Protocol  . . . . . . . . . . . . .  36
       4.9.10. The ProtocolVariantsType and the
               TwoPassSupportType Types . . . . . . . .  36
     6.1.  XML Basics  . . . . . .  36
       4.9.11. The KeyContainersFormatTypeType . . . . . . . . . . .  37
       4.9.12. The AuthenticationDataType Type . . . . . .  36
     6.2.  Round-Trip #1:  <KeyProvClientHello> and
           <KeyProvServerHello>  . . . . .  38
       4.9.13. The PayloadType Type . . . . . . . . . . . . .  37
       6.2.1.  Examples  . . .  40
       4.9.14. The MacType Type . . . . . . . . . . . . . . . . . .  40
       4.9.15. The KeyContainerType Type .  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> . . . . . . .  40
       4.9.16. The ExtensionsType and the AbstractExtensionType
               Types . . . . . . . . . .  46
       6.3.1.  Examples  . . . . . . . . . . . . . .  41
     4.10. DSKPP Messages . . . . . . . .  46
       6.3.2.  Components of a <KeyProvClientNonce> Request  . . . .  47
       6.3.3.  Components of a <KeyProvServerFinished> Response  . .  48
     6.4.  DSKPP Server Results:  The StatusCode Type  . . . . . . .  41
       4.10.1. Introduction  49
   7.  Two-Pass Protocol . . . . . . . . . . . . . . . . . . . .  41
       4.10.2. DSKPP Initialization (OPTIONAL) . .  50
     7.1.  XML Basics  . . . . . . . . .  41
       4.10.3. The DSKPP Client's Initial PDU (2- and 4-Pass) . . .  43
       4.10.4. The DSKPP Server's Initial PDU (4-Pass Only) . . . .  46
       4.10.5. The DSKPP Client's Second PDU (4-Pass Only) . . . . .  47
       4.10.6. The DSKPP Server's Final PDU (1-, 2-, . .  50
     7.2.  Round-Trip #1:  <KeyProvClientHello> and 4-Pass)
           <KeyProvServerFinished> . .  48
     4.11. Protocol Extensions . . . . . . . . . . . . . . .  51
       7.2.1.  Examples  . . . .  50
       4.11.1. The ClientInfoType Type . . . . . . . . . . . . . . .  50
       4.11.2. The ServerInfoType Type . . . .  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  . . . . . .  50
       4.11.3. The KeyInitializationDataType Type .  62
   8.  One-Pass Protocol . . . . . . . .  51
   5.  Protocol Bindings . . . . . . . . . . . . . .  63
     8.1.  XML Basics  . . . . . . . .  52
     5.1.  General Requirements . . . . . . . . . . . . . . .  63
     8.2.  Server to Client Only: <KeyProvServerFinished>  . . .  52
     5.2.  HTTP/1.1 Binding for DSKPP . .  64
       8.2.1.  Example . . . . . . . . . . . . .  52
       5.2.1.  Introduction . . . . . . . . . .  64
       8.2.2.  Components of a <KeyProvServerFinished> Response  . .  65
   9.  Trigger . . . . . . . .  52
       5.2.2.  Identification of DSKPP Messages . . . . . . . . . .  53
       5.2.3.  HTTP Headers . . . . . . . . .  66
     9.1.  XML Basics  . . . . . . . . . . .  53
       5.2.4.  HTTP Operations . . . . . . . . . . . .  66
     9.2.  Example . . . . . . .  53
       5.2.5.  HTTP Status Codes . . . . . . . . . . . . . . . . . .  53
       5.2.6.  HTTP Authentication  67
     9.3.  Components of the <KeyProvTrigger> Message  . . . . . . .  67
   10. Extensibility . . . . . . . . . .  54
       5.2.7.  Initialization of DSKPP . . . . . . . . . . . . . .  68
     10.1. The ClientInfoType Type .  54
       5.2.8.  Example Messages . . . . . . . . . . . . . . . .  68
     10.2. The ServerInfoType Type . .  54
   6.  DSKPP Schema . . . . . . . . . . . . . . .  68
     10.3. The KeyInitializationDataType Type  . . . . . . . . .  55
   7.  Security Considerations . .  68
   11. Key Initialization Profiles of Two- and One-Pass DSKPP  . . .  69
     11.1. Introduction  . . . . . . . . . . . . . .  63
     7.1.  General . . . . . . . .  69
     11.2. Key Transport Profile . . . . . . . . . . . . . . . . .  63
     7.2.  Active Attacks .  69
       11.2.1. Introduction  . . . . . . . . . . . . . . . . . . . .  63
       7.2.1.  Introduction  69
       11.2.2. Identification  . . . . . . . . . . . . . . . . . . .  69
       11.2.3. Payloads  .  63
       7.2.2.  Message Modifications . . . . . . . . . . . . . . . .  64
       7.2.3.  Message Deletion . . . . .  69
     11.3. Key Wrap Profile  . . . . . . . . . . . . .  65
       7.2.4.  Message Insertion . . . . . . .  70
       11.3.1. Introduction  . . . . . . . . . . .  65
       7.2.5.  Message Replay . . . . . . . . .  70
       11.3.2. Identification  . . . . . . . . . .  66
       7.2.6.  Message Reordering . . . . . . . . .  71
       11.3.3. Payloads  . . . . . . . .  66
       7.2.7.  Man-in-the-Middle . . . . . . . . . . . . . .  71
     11.4. Passphrase-Based Key Wrap Profile . . . .  66
     7.3.  Passive Attacks . . . . . . . .  72
       11.4.1. Introduction  . . . . . . . . . . . . .  66
     7.4.  Cryptographic Attacks . . . . . . .  72
       11.4.2. Identification  . . . . . . . . . . .  67
     7.5.  Attacks on the Interaction between DSKPP and User
           Authentication . . . . . . . .  72
       11.4.3. Payloads  . . . . . . . . . . . . .  67
     7.6.  Additional Considerations Specific to 2- and 1-pass
           DSKPP . . . . . . . . .  72
   12. Protocol Bindings . . . . . . . . . . . . . . . . .  68
       7.6.1.  Client Contributions to K_TOKEN Entropy . . . . .  73
     12.1. General Requirements  . .  68
       7.6.2.  Key Confirmation . . . . . . . . . . . . . . . .  74
     12.2. HTTP/1.1 Binding for DSKPP  . .  68
       7.6.3.  Server Authentication . . . . . . . . . . . . .  74
       12.2.1. Introduction  . . .  68
       7.6.4.  Client Authentication . . . . . . . . . . . . . . . .  68
       7.6.5.  Key Protection in the Passphrase Profile .  74
       12.2.2. Identification of DSKPP Messages  . . . . .  69
   8.  IANA Considerations . . . . .  74
       12.2.3. HTTP Headers  . . . . . . . . . . . . . . . .  70
   9.  Intellectual Property Considerations . . . .  74
       12.2.4. HTTP Operations . . . . . . . .  70
   10. Acknowledgements . . . . . . . . . . .  74
       12.2.5. HTTP Status Codes . . . . . . . . . . .  70
   11. References . . . . . . .  75
       12.2.6. HTTP Authentication . . . . . . . . . . . . . . . . .  75
       12.2.7. Initialization of DSKPP .  70
     11.1. Normative references . . . . . . . . . . . . . .  75
       12.2.8. Example Messages  . . . .  70
     11.2. Informative references . . . . . . . . . . . . . .  75
   13. DSKPP Schema  . . .  71
   Appendix A.  Key Initialization Profiles of DSKPP . . . . . . . .  72
     A.1.  Introduction . . . . . . . . . . . . .  76
   14. Security Considerations . . . . . . . . .  73
     A.2.  Key Transport Profile . . . . . . . . . .  85
     14.1. General . . . . . . . .  73
       A.2.1.  Introduction . . . . . . . . . . . . . . . . .  85
     14.2. Active Attacks  . . .  73
       A.2.2.  Identification . . . . . . . . . . . . . . . . . .  85
       14.2.1. Introduction  .  73
       A.2.3.  Payloads . . . . . . . . . . . . . . . . . . .  85
       14.2.2. Message Modifications . . .  73
     A.3.  Key wrap profile . . . . . . . . . . . . .  85
       14.2.3. Message Deletion  . . . . . . .  74
       A.3.1.  Introduction . . . . . . . . . . .  87
       14.2.4. Message Insertion . . . . . . . . .  74
       A.3.2.  Identification . . . . . . . . .  87
       14.2.5. Message Replay  . . . . . . . . . .  74
       A.3.3.  Payloads . . . . . . . . .  87
       14.2.6. Message Reordering  . . . . . . . . . . . . .  74
     A.4.  Passphrase-based key wrap profile . . . .  88
       14.2.7. Man-in-the-Middle . . . . . . . .  76
       A.4.1.  Introduction . . . . . . . . . .  88
     14.3. Passive Attacks . . . . . . . . . .  76
       A.4.2.  Identification . . . . . . . . . . .  88
     14.4. Cryptographic Attacks . . . . . . . .  76
       A.4.3.  Payloads . . . . . . . . . .  88
     14.5. Attacks on the Interaction between DSKPP and User
           Authentication  . . . . . . . . . . . .  76
   Appendix B.  Example Messages . . . . . . . . .  89
     14.6. Additional Considerations Specific to 2- and 1-pass
           DSKPP . . . . . . . . .  77
     B.1.  Example Messages in a Four-pass Exchange . . . . . . . .  77
       B.1.1.  Example of a DSKPP Initialization (Trigger) Message .  78
       B.1.2.  Example of a <ClientHello> Message . . . . . . . .  89
       14.6.1. Client Contributions to K_TOKEN Entropy .  79
       B.1.3.  Example of a <ServerHello> Message . . . . . .  89
       14.6.2. Key Confirmation  . . .  80
       B.1.4.  Example of a <ClientNonce> Message . . . . . . . . .  80
       B.1.5.  Example of a <ServerFinished> Message . . . . . .  90
       14.6.3. Server Authentication . .  80
     B.2.  Example Messages in a Two- or One-pass Exchange . . . . .  81
       B.2.1.  Example of a <ClientHello> Message Indicating
               Support for Two-pass DSKPP . . . . . . . . .  90
       14.6.4. Client Authentication . . . . .  81
       B.2.2.  Example of a <ServerFinished> Message Using the
               Key Transport Profile . . . . . . . . . . .  90
       14.6.5. Key Protection in the Passphrase Profile  . . . . .  83
       B.2.3.  Example of a <ServerFinished> Message Using the
               Key Wrap Profile .  91
   15. Internationalization Considerations . . . . . . . . . . . . .  91
   16. IANA Considerations . . . .  85
       B.2.4.  Example of a <ServerFinished> Message using the
               Passphrase-based Key Wrap Profile . . . . . . . . . .  86
   Appendix C.  Requirements . . . . . . .  92
   17. Intellectual Property Considerations  . . . . . . . . . . . .  92
   18. Contributors  .  88
   Appendix D.  Integration with PKCS #11 . . . . . . . . . . . . .  90
     D.1.  The 4-pass Variant . . . . . . . . . .  92
   19. Acknowledgements  . . . . . . . . .  91
     D.2.  The 2-pass Variant . . . . . . . . . . . . .  92
   20. References  . . . . . .  91
     D.3.  The 1-pass Variant . . . . . . . . . . . . . . . . . . .  93
   Appendix E.  Example of DSKPP-PRF Realizations
     20.1. Normative references  . . . . . . . . . . . . . . . . . .  93
     20.2. Informative references  . . . . . . . . . . . . . . . . .  94
   Appendix A.  Integration with PKCS #11  . . . . . . . . . . . . .  95
     E.1.  Introduction
     A.1.  The 4-pass Variant  . . . . . . . . . . . . . . . . . . .  96
     A.2.  The 2-pass Variant  . . . . . . . . . . . . . . . . . . .  96
     E.2.
     A.3.  The 1-pass Variant  . . . . . . . . . . . . . . . . . . .  98
   Appendix B.  Example of DSKPP-PRF Realizations  . . . . . . . . . 100
     B.1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . 101
     B.2.  DSKPP-PRF-AES . . . . . . . . . . . . . . . . . . . . . .  96
       E.2.1. 101
       B.2.1.  Identification  . . . . . . . . . . . . . . . . . . .  96
       E.2.2. 101
       B.2.2.  Definition  . . . . . . . . . . . . . . . . . . . . .  96
       E.2.3. 101
       B.2.3.  Example . . . . . . . . . . . . . . . . . . . . . . .  97
     E.3. 102
     B.3.  DSKPP-PRF-SHA256  . . . . . . . . . . . . . . . . . . . .  97
       E.3.1. 102
       B.3.1.  Identification  . . . . . . . . . . . . . . . . . . .  97
       E.3.2. 102
       B.3.2.  Definition  . . . . . . . . . . . . . . . . . . . . .  98
       E.3.3. 103
       B.3.3.  Example . . . . . . . . . . . . . . . . . . . . . . .  99 104
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  99 104
   Intellectual Property and Copyright Statements  . . . . . . . . . 100 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) over-the-
   air) accessible.

1.2.  Background

   A locally accessible symmetric key cryptographic module may be hosted by a hand-held
   hardware device (e.g., a mobile phone),
   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 addressed herein is 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)
   DSKPP client    Manages communication between the symmetric
                   cryptographic module and the DSKPP server
   DSKPP server    The
   ENC_X(Y)        Encryption of message Y with symmetric key provisioning server 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
                   participates 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_AUTH

   K_AUTHCODE      Secret key that is derived from AUTHCODE and used for server
                   client authentication purposes in
                   4-pass

   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.  A cryptographic module obtains a symmetric key  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.  A cryptographic module acquires multiple symmetric keys of
      different types  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 the HMAC-Based One-Time
   Password (HOTP), RSA SecurID, challenge-response, etc. one-time password
   authentication algorithms, and AES encryption algorithm.

3.3.  A provisioning server imposes a validity period policy for
      provisioning sessions

   Once  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.  As long as  If the user inputs a valid authentication code within the
   fixed time period established by the issuer, the server will provision allow a
   key to be provisioned to the cryptographic module hosted by the
   user's device.

3.4.  A symmetric key issuer uses a third party provisioning service
      provider  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.  A cryptographic module renews its symmetric key with the same key
      ID  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.  An administrator initiates a symmetric key replacement before it
      can be used  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.

   Bulk initialization under controlled conditions, e.g., during
   manufacture, is likely to meet the security needs of most
   applications.  However, reliance on a pre-disclosed secret is
   unacceptable in some circumstances.  One such circumstance is when
   cryptographic modules are issued for classified government use or
   high security applications.  In such cases, the issuer requires the
   ability to remove all secret information already installed on the
   cryptographic module and replace it with symmetric keys established
   under conditions controlled by the issuer.  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.  A cryptographic module hosted by a smart card uses a pre-shared
      transport key to communicate with the provisioning server  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.  A cryptographic module hosted by a mobile device downloads a
      symmetric key through SMS  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, the an application may use a cryptographic module can ensure that SMS will provide to enforce an
   acceptable level of protection for download of the symmetric key. 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.  A cryptographic module acquires a symmetric key over a transport
      protocol that does not ensure data confidentiality  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.  A cryptographic module acquires a symmetric key over a transport
       protocol that does not provide authentication  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.  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 that hosts
                           symmetric cryptographic modules    |
   |---------|*  owns  *|-----------|
   | UserID  |--------->| DeviceID                A unique identifier for the device
   Cryptographic Module    A low-level component of an application,
                           which enables  |
   | ...     |          | ...       |
   -----------          -------------
                            | 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

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

   Encryption Algorithms Algorithms:  Encryption algorithms supported by the
                           cryptographic module

   MAC Algorithms Algorithms:         MAC algorithms supported by the cryptographic
                           module

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

   KeyID:                  A unique identifier for the symmetric key

   Key Type 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.)

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

   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.  Principles  Overview of Operation

   To initiate a Protocol Usage

   DSKPP session, a user may use a browser to connect to enables symmetric key provisioning between a
   web server.  The user may then identify and optionally authenticate
   herself and possibly indicate how the DSKPP client has to contact the server and
   DSKPP server.  There are also other alternatives for client.  The DSKPP session
   initiation, such as protocol supports the following types of
   requests and responses:

      <KeyProvClientHello>

          With this request, a DSKPP client being pre-configured to initiates contact
   a certain with the
          DSKPP server, or the user being informed out-of-band about indicating what protocol versions and variants,
          key types, encryption and MAC algorithms that it supports.  In
          addition, the address of request may include client authentication data
          that the DSKPP server.

   Once server uses to verify proof-of-possession of
          the location device.

      <KeyProvServerHello>
          Upon reception of a <KeyProvClientHello> request, the DSKPP
          server is known, uses the DSKPP client <KeyProvServerHello> response to specify which
          protocol version and variant, key type, encryption algorithm,
          and MAC algorithm that will be used by the DSKPP server engage in a 4-pass, 2-pass, or 1-pass protocol.
   With and
          DSKPP client during the four-pass protocol run.  The decision of which
          variant, keys are mutually generated by the
   provisioning server key type, and cryptographic module; provisioned keys are
   not transferred over-the-wire or over-the-air.  Two- and one-pass
   variants enable secure algorithms to pick is
          policy- and efficient download implementation-dependent and installation therefore outside the
          scope of
   symmetric keys to this document.
          The <KeyProvServerHello> response includes the DSKPP server's
          random nonce, R_S. The response also consists of information
          about either a cryptographic module shared secret key, or its own public key, that
          the DSKPP client uses when sending its protected random nonce,
          R_C, in environments where near
   real-time communication may not be possible. the <KeyProvClientNonce> request (see below).
          Optionally, the DSKPP protocol variants server may be applied to provide a MAC that the DSKPP
          client may use cases described in
   Section 3, as shown below:

   ==========================================================
   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 for server authentication.

      <KeyProvClientNonce>

          With this request, a pre-generated key
              is required
   -----------------------------------------------------------
   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 2: Mapping of use cases to protocol variants

4.2.1.  Four-pass DSKPP

   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 server securely
          exchange protected data, e.g., the flow, nor for
   provisioning of pre-generated keys.  The 4-pass protocol flow, shown
   in Figure 3 and expanded in Figure 4, consists of two round trips
   between protected random nonce R_C.
          In addition, the DSKPP client and server.

   +---------------+                            +---------------+
   |               |                            |               |
   |  DSKPP request may include client |                            | authentication
          data that the DSKPP server |
   |               |                            |               |
   +---------------+                            +---------------+
           |                                            |
           |        [ <---- DSKPP trigger ----- ]       |
           |                                            |
           |        ------- Client Hello ------->       |
           |                                            |
           |        <------ Server Hello --------       |
           |                                            |
           |        ------- Client Nonce ------->       |
           |                                            |
           |        <----- Server Finished ------       |
           |                                            |

       Figure 3: The 4-pass DSKPP protocol (with OPTIONAL preceeding
                                 trigger)

   a.    The DSKPP client sends a <ClientHello> message uses to verify proof-of-possession
          of the DSKPP
         server. device.

      <KeyProvServerFinished>

          The <KeyProvServerFinished> response is a confirmation message provides information to the DSKPP server
         about the DSKPP versions, protocol variants,
          that includes a key types,
         encryption container that holds configuration data,
          and MAC algorithms supported by the cryptographic
         module for the purposes of this protocol.  The message may also
         include client authentication data, such contain protected key material (this depends on
          the protocol variant, as a certificate or
         authentication code.
   b.    The DSKPP server responds to discussed below).
          Optionally, the DSKPP client with a
         <ServerHello> 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 <ServerHello> message also
         provides information about either a shared secret key to use
         for encrypting the cryptographic module's random nonce (see
         description of <ClientNonce> below), or its own public key.
         Optionally, <ServerHello> server may include provide a MAC that the DSKPP
          client may use for server authentication.
   c.    Based on information contained in the <ServerHello> message,
         the cryptographic module generates

   To initiate a random nonce, R_C. The
         length of the nonce R_C DSKPP session:
   1.  A user may depend use a browser to connect to a web server that is
       running on the selected key type. some host.  The cryptographic module encrypts R_C using the selected
         encryption algorithm user may then identify (and optionally
       authenticate) herself (through some means that essentially are
       out of scope for this document) and with request a key, K, that is either the
         DSKPP server's public key, K_SERVER, or symmetric key.
   2.  A client application may request a shared secret key,
         K_SHARED, as indicated symmetric key by invoking the
       DSKPP server.  If K is equivalent client.
   3.  A DSKPP server may send a trigger message to K_SERVER, a client
       application, which would then invoke the cryptographic module SHOULD verify DSKPP client.

   To contact the
         server's certificate before using it to encrypt R_C. The DSKPP
         client then sends server:

   1.  A user may indicate how the encrypted random nonce DSKPP client is to the contact a certain
       DSKPP server in during a <ClientNonce> message, and may include browsing session.
   2.  A DSKPP client
         authentication data, such as may be pre-configured to contact a certificate or authentication
         code.  Finally, certain DSKPP
       server.
   3.  A user may be informed out-of-band about the cryptographic module calculates a symmetric
         key, K_TOKEN, location of the selected type from
       DSKPP server.

   Once the combination location 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 4.5.
   d.    The DSKPP server decrypts R_C, calculates K_TOKEN from the
         combination of the two random nonces R_S and R_C, is known, the
         encryption key K, DSKPP client and possibly some other data, using
   the
         DSKPP-PRF function defined in Section 4.5.  The DSKPP server then
         associates K_TOKEN with the cryptographic module engage 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 4-pass, 2-pass, or decrypt
         data produced by 1-pass protocol.
   Depending upon the cryptographic module policy and implementation, a DSKPP server selects
   which variant of the key.
   e.    Once protocol to use: 4-pass, 2-pass, or 1-pass.
   With the association has been made, four-pass variant, keys are mutually generated by the DSKPP
   server sends a
         confirmation message to the and DSKPP client called
         <ServerFinished>.  The confirmation message includes a key
         container that holds an identifier for the generated key (but client; provisioned keys are not the key itself) transferred over-
   the-wire or over-the-air.  Two- and additional configuration information,
         e.g., the identity one-pass variants enable secure
   and efficient download and installation of the DSKPP server.  Optionally,
         <ServerFinished> may include symmetric keys to a MAC that the DSKPP
   client in environments where near real-time communication may
         use for server authentication.
   f.    Upon receipt not be
   possible.Figure 2 shows which messages get exchanged during each type
   of the protocol run (4-pass, 2-pass, or 1-pass).
   +---------------+                            +---------------+
   |               |                            |               |
   |  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.
   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 client |                            |  DSKPP server |
   |               |                            |               |
   +---------------+                            +---------------+
           |                                            |
           |        [ <---- DSKPP trigger ----- ]       |
           |                                            |
           |        ------- Client Hello ------->       |
           |        (Applicable 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 4- and R_C in the key
   generation provides assurance 2-pass)       |
           |                                            |
           |        <------ Server Hello --------       |
           |         (Applicable to both sides (the cryptographic module 4-pass only)        |
           |                                            |
           |        ------- Client Nonce ------->       |
           |         (Applicable to 4-pass only)        |
           |                                            |
           |        <----- Server Finished ------       |
           |      (Applicable to 4-, 2-, and the 1-pass)    |
           |                                            |

      Figure 2: The DSKPP server) that they have contributed protocol (with OPTIONAL preceding trigger)

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

   ----------------------------------------------------------
   Protocol   Applicable                Applicable
   Variant    Use Cases                 Deployment Scenarios
   ----------------------------------------------------------
   4-pass     All but 3.6 and that the           Near real-time
              3.8 if mutual key         communication is unique.  The inclusion
              generation is desired;    possible
              none if transport 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 pre-generated key different from
   the one stored by

   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 legitimate DSKPP client and
   DSKPP server.

   Note: A man-in-the-middle (in  It is not suitable for environments wherein
   administrative approval is a required step in the form flow, nor for
   provisioning of corrupt 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 software or 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 mistakenly contacted server) MAY present his own public key <KeyProvClientHello> message to the
   cryptographic module.  This will enable the attacker DSKPP
   server.  The message provides information to learn the
   client's version of K_TOKEN.  However, DSKPP server about
   the attacker is not able to
   persuade DSKPP versions, protocol variants, key types, encryption and MAC
   algorithms supported by the legitimate cryptographic module for the purposes of
   this protocol.

   The DSKPP server responds to derive the same value for K_TOKEN,
   since K_TOKEN is DSKPP client with a function of
   <KeyProvServerHello> message, whose content includes a random nonce,
   R_S, along with information about the public type of key involved, to generate, and
   the
   attacker's public key must be different than the correct server's (or
   else the attacker would not be able encryption algorithm chosen to decrypt protect sensitive data sent in the information
   received from
   protocol.  The length of the client).  Therefore, once nonce R_S may depend on the attacker is no longer
   "in selected key
   type.  The <KeyProvServerHello> message also provides information
   about either a shared secret key to use for encrypting the middle,"
   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 and server will detect that they are "out
   of synch" when they try to may use their keys.  In
   for server authentication during key replacement.

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

   Based on information contained in the case <KeyProvServerHello> message,
   the cryptographic module generates a random nonce, R_C. The length of encrypting
   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, it or
   a shared secret key, K_SHARED, as indicated by the DSKPP server.  If
   K is therefore important equivalent to K_SERVER, then the cryptographic module SHOULD
   verify that K_SERVER
   really is the legitimate server's key.  One way certificate before using it to do this is encrypt R_C in
   accordance with [RFC3280].  The DSKPP client then sends the encrypted
   random nonce to
   independently validate a newly generated K_TOKEN against some
   validation service at the DSKPP server (e.g. by using in a connection
   independent <KeyProvClientNonce> message,
   and may include client authentication data, such as a certificate or
   MAC derived from an authentication code and R_C. Finally, the one used for
   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 generation).

   +----------------------+    +-------+     +----------------------+
   |    +------------+    |    |       |     |                      |
   |    | Server key |    |    |       |     |                      |
   | +<-|  Public    |------>------------->-------------+---------+ |
   | |  |  Private   |    |    |       |     |          |         | |
   | |  +------------+    |    |       |     |          |         | |
   | |        |           |    |       |     |          |         | |
   | V        V           |    |       |     |          V         V |
   | |   +---------+      |    |       |     |        +---------+ | |
   | |   | Decrypt |<-------<-------------<-----------| Encrypt | | |
   | |   +---------+      |    |       |     |        +---------+ | |
   | |      |  +--------+ |    |       |     |            ^       | |
   | |      |  | Server | |    |       |     |            |       | |
   | |      |  | Random |--->------------->------+  +----------+  | |
   | |      |  +--------+ |    |       |     |   |  | Client   |  | |
   | |      |      |      |    |       |     |   |  | Random   |  | |
   | |      |      |      |    |       |     |   |  +----------+  | |
   | |      |      |      |    |       |     |   |        |       | |
   | |      V      V      |    |       |     |   V        V       | |
   | |   +------------+   |    |       |     | +------------+     | |
   | +-->|  DSKPP PRF |   |    |       |     | | K, and possibly some other data, using the
   DSKPP-PRF function defined in Section 5.1.

   The 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

4.2.2.  Two-pass DSKPP

   The 2-pass protocol flow is suitable for environments wherein near
   real-time communication between decrypts R_C, calculates K_TOKEN from the DSKPP client
   combination of the two random nonces R_S and server may not
   be possible.  It is also suitable for environments wherein
   administrative approval is a required step in R_C, the flow, encryption key
   K, and for
   provisioning of pre-generated keys.  In possibly some other data, using the 2-pass protocol flow,
   shown DSKPP-PRF function defined
   in Figure 5, Section 5.1.  The server then associates K_TOKEN with the client's initial <ClientHello> message is
   directly followed by
   cryptographic module in a <ServerFinished> message.  There server-side data store.  The intent is no
   exchange of that
   the <ServerHello> message data store later on will be used by some service that needs to
   verify or decrypt data produced by the <ClientNonce> message.
   However, as cryptographic module and the
   key.

   Once the association has been made, the two-pass variant of DSKPP consists of one round trip server sends a
   confirmation message to the server, the DSKPP client is still able to called
   <KeyProvServerFinished>.  Optionally, <KeyProvServerFinished> may
   include its random nonce,
   R_C, algorithm preferences and supported key types in the
   <ClientHello> message.  Note than by including R_C in <ClientHello>, a MAC that the DSKPP client is able to ensure the may use for server is alive before
   "commiting" the key.  Also note that the DSKPP "trigger"
   authentication.  The confirmation message MAY
   be used to trigger includes a key container
   that holds an identifier for the client's sending of generated key (but not the <ClientHello> message.

   Essentially, two-pass DSKPP is a transport of key material from
   itself) and additional configuration information, e.g., the
   DSKPP server to identity
   of the DSKPP client.  Two-pass DSKPP supports multiple server.  The default symmetric key initialization methods container format that ensure K_TOKEN
   is not exposed to any
   other entity than the DSKPP server and used in the cryptographic module
   itself.  Currently, three such key initialization methods are defined
   (refer to Appendix A), each supporting a different usage of 2-pass
   DSKPP:

   Key Transport               This profile <KeyProvServerFinished> message is intended for PKI-capable
                               devices. based on the
   Portable Symmetric Key transport is carried out
                               using a public key, K_CLIENT, whose
                               private key part resides 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 as associates the transport
                               key.
   Key Wrap                    This profile is ideal provided key container with the
   generated key K_TOKEN, and stores any provided configuration data.

4.3.2.  Generation of Symmetric Keys for pre-keyed
                               devices, e.g., SIM cards.  Key wrap is
                               carried out using a Cryptographic Modules

   With 4-pass DSKPP, the symmetric key-
                               wrapping key, K_SHARED, which key that is known in
                               advance by both the cryptographic module
                               and target of
   provisioning, is generated on-the-fly without being transferred
   between the DSKPP client and DSKPP server.
   Passphrase-based Key Wrap   This profile is a variation of  A sample data flow
   depicting how this works followed by computational information are
   provided in 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 subsections below.

4.3.2.1.  Data Flow

   A sample data flow showing key generation during the 4-pass protocol
   is known shown in advance
                               by both the cryptographic module and
                               DSKPP server.

   +---------------+                            +---------------+ Figure 4.
   +----------------------+    +-------+     +----------------------+
   |    +------------+    |    |       |     |  DSKPP client                      |
   |  DSKPP server    | Server key |    |    |       |
   +---------------+                            +---------------+     |                      |
   |        [ <---- DSKPP trigger ----- ] +<-|  Public    |------>------------->-------------+---------+ |
   | |  |        ------- Client Hello ------->  Private   |    |    |       |     |          |         | |
   | |  +------------+    |    |       |     |          |         | |
   | |        |           |    |       |     |          |         | |
   | V        V           |    |       |     |          V         V |
   | |   +---------+      |    |       |     |        +---------+ | |
   | |   | Decrypt |<-------<-------------<-----------| Encrypt | | |
   | |   +---------+      |    |       |     |        +---------+ | |
   | |      |  +--------+ |    |       |     |            ^       | |
   | |      |  |        <----- Server Finished ------ | |    |

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

   a.    The DSKPP client sends a <ClientHello> 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 a
         certificate or authentication code.  Unlike 4-pass DSKPP,
         2-pass DSKPP client uses the <ClientHello> message to declare
         which key initialization method it supports, providing required
         payload information, e.g., K_CLIENT for the       |     |            |       | |
   | |      |  | Random |--->------------->------+  +----------+  | |
   | |      |  +--------+ |    |       |     |   |  | Client   |  | |
   | |      |      |      |    |       |     |   |  | Random   |  | |
   | |      |      |      |    |       |     |   |  +----------+  | |
   | |      |      |      |    |       |     |   |        |       | |
   | |      V      V      |    |       |     |   V        V       | |
   | |   +------------+   |    |       |     | +------------+     | |
   | +-->|  DSKPP PRF |   |    |       |     | |  DSKPP PRF |<----+ |
   |     +------------+   |    |       |     | +------------+       |
   |           |          |    |       |     |       |              |
   |           V          |    |       |     |       V              |
   |       +-------+      |    |       |     |   +-------+          |
   |       |  Key Transport
         Profile.
   b.    The  |      |    |       |     |   |  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 generates a key K from which

   Note: Conceptually, although R_C is one pseudorandom string, it may
   be viewed as consisting of two keys, K_TOKEN components, R_C1 and K_MAC are derived.  K R_C2, where R_C1
   is either transported or wrapped in
         accordance with generated during the key initialization method specified by the
         DSKPP client in the <ClientHello> message.  The server then
         associates K_TOKEN with protocol run, and R_C2 can be pre-generated
   and loaded on the cryptographic module in a server-
         side data store.  The intent before the device is issued to
   the user.  In that case, the data store later on
         will latter string, R_C2, SHOULD be used by some service that needs to verify or decrypt
         data produced by 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 key.
   c.    Once the association has been made, the DSKPP server sends a
         confirmation message server) that they have contributed to the DSKPP client called
         <ServerFinished>.  The confirmation message includes a key
         container key's
   randomness and that holds an identifier for the key, key is unique.  The inclusion of the
   encryption key K from
         which K_TOKEN and K_MAC are derived, and additional
         configuration information (note ensures that no man-in-the-middle may be present, or
   else the latter MUST include cryptographic module will end up with a key different from
   the identity of one stored by the legitimate DSKPP server for authentication purposes).
         In addition, <ServerFinished> MUST include two MACs whose
         values are calculated with contribution from server.

   Note: A man-in-the-middle (in the form of corrupt client nonce,
         R_C, provided in software or
   a mistakenly contacted server) may present his own public key to the <ClientHello> message.  The MAC values
   cryptographic module.  This will allow enable the cryptographic module attacker to perform key confirmation
         and server authentication before "commiting" learn the key.

   d.    Upon receipt
   client's version of K_TOKEN.  However, the DSKPP server's confirmation message, attacker is not able to
   persuade the
         cryptographic module extracts legitimate server to derive the key data from the provided
         key container, uses same value for K_TOKEN,
   since K_TOKEN is a function of the two MAC values to perform public key
         confirmation and server authentication, involved, and stores the
   attacker's public key
         material locally.

4.2.3.  One-pass DSKPP

   The one-pass protocol flow is suitable for environments wherein near
   real-time communication between must be different than the DSKPP client and server may correct server's (or
   else the attacker would not be possible.  It is also suitable for environments wherein
   administrative approval is a required step in able to decrypt the flow, and for
   provisioning of pre-generated keys.  In one-pass DSKPP, shown in
   Figure 6, information
   received from the server simply sends a <ServerFinished> message to client).  Therefore, once the
   DSKPP client.  In this case, there attacker is no exchange of longer
   "in the
   <ClientHello>, <ServerHello>, and <ClientNonce> DSKPP messages, and
   hence there is no way for middle," the client and server will detect that they are "out
   of sync" when they try to express supported algorithms
   or key types.  Before attempting one-pass DSKPP, use their keys.  In the server MUST case of encrypting
   R_C with K_SERVER, it is therefore have prior knowledge not only important to verify that the client K_SERVER
   really is able and
   willing the legitimate server's key.  One way to accept do this variant of DSKPP, but also of algorithms and
   key types supported by the client.

   Essentially, one-pass DSKPP is to
   independently validate a transport of key material from newly generated K_TOKEN against some
   validation service at the
   DSKPP server to (e.g. by using a connection
   independent from the DSKPP client.  As with two-pass DSKPP, one used for the one-
   pass variant relies on key initialization methods that ensure K_TOKEN
   is not exposed to any other entity than generation).

4.3.2.2.  Computing the DSKPP server and the
   cryptographic module itself.  The same key initialization profiles Symmetric Key

   In DSKPP, keys are generated using the DSKPP-PRF function defined as described in
   Section 4.2.2 and Appendix A.

   Outside 5.1, a secret random value R_C chosen by 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.

   +---------------+                            +---------------+
   |               |                            |               |
   |  DSKPP client |                            |  DSKPP server |
   |               |                            |               |
   +---------------+                            +---------------+
           |                                            |
           |        <----- Server Finished ------       |
           |                                            |

                    Figure 6: The 1-pass DSKPP protocol
   a.    The DSKPP server generates client, 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
   random value R_S chosen by the DSKPP server.  The server then associates K_TOKEN with server, and the cryptographic module in a server-side data store. key k used to
   encrypt R_C. The
         intent input parameter s of DSKPP-PRF is that the data store later on will be used by some
         service that needs set to verify or decrypt data produced by the
         cryptographic module and the key.
   b.    Once
   concatenation of the association has been made, (ASCII) string "Key generation", k, and R_S, and
   the DSKPP server sends a
         confirmation message input parameter dsLen is set to the DSKPP client called
         <ServerFinished>.  The confirmation message includes a key
         container that holds an identifier for desired length of 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 (the length of K_TOKEN is given by the DSKPP server for authentication purposes).
         In addition, <ServerFinished> MUST include two MACs, which will
         allow 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 cryptographic module output of DSKPP-PRF MAY be subject
   to perform key confirmation and
         server authentication before "commiting" 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 algorithm-dependent transform before being adopted as a key container, uses of
   the two MAC values to perform key
         confirmation and server authentication, and stores selected type.  One example of this is the key
         material locally.

4.3.  Authentication

4.3.1. need for parity in DES
   keys.

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

   To ensure that a generated key K_TOKEN ends up associated with the
   correct cryptographic module and user, the DSKPP server MAY couple an
   initial user authentication to client using any of
   the DSKPP execution in several ways,
   as discussed methods described in the following sub-sections. 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.
   For

4.3.4.  Key Confirmation

   In four-pass DSKPP, the client includes a further discussion of this, and threats related to man-in-the-
   middle attacks nonce R_C in this context, see Section 7.

4.3.1.1.  Device Certificate

   Instead of requiring an Authentication Code for in-band
   authentication, a device certificate could be used, which was
   supplied with the cryptographic module by its issuer.

4.3.1.2.  Device Identifier
   <KeyProvClientHello> message.  The provisioning server could MAC value in the
   <KeyProvServerFinished> message MUST be pre-configured with a device
   identifier.  The DSKPP server MAY then include this identifier in the
   DSKPP initialization trigger, and computed on the DSKPP client would include it
   in its message(s) to (ASCII)
   string "MAC 2 computation", 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 nonce R_C using a unique MAC key for the identified device and that
   K_MAC.  This key will MUST be used in the
   protocol.

4.3.1.3.  One-time Use Authentication Code

   A key issuer may provide a one-time value, called an Authentication
   Code, to the user or device out-of-band generated together with K_TOKEN using R_C
   and require this R_S.

   The MAC value to in <KeyProvServerFinished> MAY be
   used computed by using the DSKPP client when contacting the DSKPP server.  The DSKPP
   client MAY include the authentication data
   DSKPP-PRF function of Section 5.1, in its <ClientHello> (and
   <ClientNonce> for four-pass) message, and which case the DSKPP server input parameter
   s MUST
   verify consist of the data before continuing with concatenation of the protocol run.  Note: An
   alternate method for getting (ASCII) string "MAC 2
   computation", R_C, the Authentication Code parameter dsLen MUST be set to the client,
   is for 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 place avoid a false "Commit" of
   a symmetric key that which could cause the value cryptographic module to
   end up in an initialized state for which the <TriggerNonce>
   element of the DSKPP initialization trigger (if triggers are used;
   see Section 5.2.7) .

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

      Figure 7: User Authentication with One-Time               Code

   Considering an Authentication Code as a special form of shared secret
   between a user and server does not know the
   stored key.  To do this, the DSKPP server authenticates itself by
   including a provisioning server, Authentication Data can
   have one of MAC value in the following forms:

   o  AuthenticationData = Hash (Authentication Code)
      When an Authentication Code <KeyProvServerHello> message when
   replacing a existing key.  The MAC value is used to initiate generated using the protocol run,
   existing the Authentication Code MAC key K_MAC' (the MAC key that existed before this
   protocol run).  The MAC algorithm MUST be sent to the same as the algorithm
   used for key confirmation purposes.  In addition, a DSKPP server in a
      secure manner.  If the underlying can
   leverage transport channel layer authentication if it is secure, available.

   When the
      authentication data MAY contain MAC value is used for server authentication, the plaintext format or value MAY
   be computed by using the hashed
      format DSKPP-PRF function of Section 5.1, in which
   case the Authentication Code using a hash function.

   o  AuthenticationData = HMAC(Authentication Code, K_AUTH)

      If input parameter s MUST be set to the underlying transport is not secure, concatenation of the client MUST use a
      key K_AUTH and
   (ASCII) string "MAC 1 computation", R (if sent by the Authentication Code client), and
   R_S, and k MUST be set to derive authentication
      data.  For example, if the Authentication Code has a fixed format,
      e.g.,

      AuthenticationCode = passwordLength || ID || password || checksum

      then AuthenticationData MAY existing MAC key K_MAC' .  The input
   parameter dsLen MUST be calculated as follows:

      AuthenticationData = AuthenticationCode->ID || B64(Digest)

      where for four-pass DSKPP, the cryptographic module uses the
      server nonce R_S in combination with the server URL set to calculate the Digest:

      Digest length of R_S:

   dsLen = DSKPP-PRF-AES(K_AUTH, AuthCode->ID || serverURL len(R_S)
   MAC = DSKPP-PRF (K_MAC', "MAC 1 computation" || [R ||] R_S,
      16)

      Refer to Section 4.5 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 description of DSKPP-PRF required step in general the flow, and
      Appendix E for
   provisioning of pre-generated keys.  In the 2-pass protocol flow, the
   client's initial <KeyProvClientHello> message is directly followed by
   a description <KeyProvServerFinished> message.  There is no exchange of DSKPP-PRF-AES.

      For two-pass DSKPP, the cryptographic module does not have access
      to
   <KeyProvServerHello> message or the server nonce R_S in combination and so:

      Digest = DSKPP-PRF-AES(K_AUTH, AuthenticationCode->ID ||
      serverURL, 16)

      In either case, K_AUTH MAY be derived AES key from
      AuthenticationCode->password <KeyProvClientNonce> message.
   However, as in:

      K_AUTH = truncate( Hash( Hash(...n times...( AuthCode->password )
      ) ) )

      where truncate() returns the first 16 bytes from the result two-pass variant of DSKPP consists of one round trip
   to the
      last hash iteration, and n is server, the number of hash iterations (set client is still able to fixed values, e.g., between 10 include its random nonce,
   R_C, algorithm preferences and 100).

   o  AuthenticationData = <Signed data with a supported key types in the
   <KeyProvClientHello> message.  Note that by including R_C in
   <KeyProvClientHello>, the DSKPP client certificate>

      When a certificate is used for authentication, able to ensure the authentication
      data MAY be client-signed.  Authentication data MAY be omitted if
      client certificate authentication has been provided by the
      transport channel such as TLS.

   When an issuer delegates symmetric key provisioning to a third party
   provisioning service provider, both client authentication and issuer
   authentication are required by server
   is alive before "committing" the provisioning server.  Client
   authentication to key.  Also note that the Issuer DSKPP
   "trigger" message MAY be in-band or out-of-band as
   described above.  The issuer acts as a proxy for the provisioning
   server.  The issuer authenticates used to trigger the provisioning service
   provider either using a certificate or a pre-established secret key.

4.3.2.  Server Authentication

   A client's sending of the
   <KeyProvClientHello> message.

   Essentially, two-pass DSKPP server MUST authenticate itself to avoid is a false "Commit" transport of
   a symmetric key that which could cause material from the cryptographic module
   DSKPP server to
   end up in an initialized state for which the server does DSKPP client.  Two-pass DSKPP supports multiple
   key initialization methods that ensure K_TOKEN is not know the
   stored key.  To do this, exposed to any
   other entity than the DSKPP server authenticates itself by
   including a MAC in and the cryptographic module
   itself.  Currently, three such key initialization methods are defined
   (refer to Section 11), each supporting a different usage of its responses to the client.  In 2-pass
   and 1-pass DSKPP, servers authenticate themselves by including
   DSKPP:

   Key Transport               This profile is intended for PKI-capable
                               devices.  Key transport is carried out
                               using a
   second MAC value public key, K_CLIENT, whose
                               private key part resides in the response message.  In addition, a DSKPP
   server can leverage
                               cryptographic module as the transport layer authentication if it
                               key.
   Key Wrap                    This profile is
   available.

4.4.  Symmetric ideal for pre-keyed
                               devices, e.g., SIM cards.  Key Container Format

   The default wrap is
                               carried out using a symmetric key container format that key-
                               wrapping key, K_SHARED, which is used known in
                               advance by both the
   <ServerFinished> message cryptographic module
                               and the DSKPP server.
   Passphrase-Based Key Wrap   This profile is based on a variation of the Portable Symmetric Key
   Container (PSKC) defined
                               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 [PSKC].  Alternative formats MAY include
   PKCS#12 [PKCS-12] or PKCS#5 XML [PKCS-5-XML] format.

4.5.  The advance
                               by both the cryptographic module and
                               DSKPP One-Way Pseudorandom Function, DSKPP-PRF

4.5.1.  Introduction server.

   The general requirements on DSKPP-PRF are full 2-pass protocol exchange when the same key is transported using
   the client public key is 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, 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 DSKPP-PRF function MUST be capable of generating key is wrapped using a
   variable-length output, and its output MUST be unpredictable even if
   other outputs for
   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 same key are known.

   It is assumed that any realization of DSKPP-PRF takes three input
   parameters: A secret wrapped using a passphrase
   based derived 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 is 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 E contains two
   example realizations of DSKPP-PRF.

4.5.2.  Declaration

   DSKPP-PRF (k, s, dsLen)

   Input:

   k     secret key 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 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 16 octets
   long.

4.6.  Generation more detail.

4.4.1.  Message Flow

   The 2-pass protocol flow consists of Symmetric Keys for Cryptographic Modules

   In DSKPP, keys are generated using the DSKPP-PRF function, a secret
   random value R_C chosen by one round trip between the DSKPP client, a random value R_S
   chosen by the
   client and DSKPP server, which consists of two "passes", i.e., one
   request message and the key k used to encrypt R_C. one response message:

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

   a.  The
   input parameter s of DSKPP-PRF is set DSKPP client sends a <KeyProvClientHello> message to the concatenation of
       DSKPP server.  The message provides the
   (ASCII) string "Key generation", k, client nonce, R_C, and R_S,
       information about the DSKPP versions, protocol variants, key
       types, encryption and MAC algorithms supported by the input parameter
   dsLen is set to
       cryptographic module for the desired length purposes of the key, K_TOKEN (the length of
   K_TOKEN 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 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, sent in clear only when underlying
       transport layer can ensure data confidentiality.  Unlike 4-pass
       DSKPP, 2-pass DSKPP client uses the output of DSKPP-PRF MAY be subject <KeyProvClientHello> message
       to an algorithm-dependent transform before being adopted as a declare which key of
   the selected type.  One example of this is the need initialization method it supports, providing
       required payload information, e.g., K_CLIENT for parity in DES
   keys.

4.7.  Encryption of Pseudorandom Nonces Sent from the Key
       Transport Profile.
   b.  The DSKPP Client

   DSKPP client random nonce(s) 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 encrypted
       transported or wrapped in accordance with the public key
   provided 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 a shared secret the cryptographic
       module and the key.  For example,
   in
   c.  Once the case of a public RSA key, an RSA encryption scheme from PKCS
   #1 [PKCS-1] MAY be used.

   In association has been made, the case of DSKPP server sends a shared secret key,
       confirmation message to avoid dependence on other
   algorithms, the DSKPP client MAY use the DSKPP-PRF function described
   herein with the shared secret called
       <KeyProvServerFinished>.  The confirmation message includes a key K_SHARED as input parameter k (in
   this case, K_SHARED SHOULD be used solely
       container that holds an identifier for this purpose), the
   concatenation of key, the (ASCII) string "Encryption" key K from
       which K_TOKEN and the server's
   nonce R_S as input parameter s, K_MAC are derived, and dsLen set to additional configuration
       information (note that 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 latter MUST include the identity of R_C MAY then be achieved by XOR-ing DS with R_C:

   Enc-R_C = DS ^ R_C

   The
       the DSKPP server will then perform the reverse operation to extract
   R_C for authentication purposes).  In addition,
       <KeyProvServerFinished> MUST include two MACs whose values are
       calculated with contribution from Enc-R_C.

   Note: It may appear that an attacker, who learns a previous value of the client nonce, R_C, may be able to replay provided
       in the corresponding R_S and, hence, learn a
   new R_C as well.  However, this attack is mitigated by <KeyProvClientHello> message.  The data will allow the
   requirement for a server to show knowledge of K_AUTH (see below) in
   order
       cryptographic module to successfully complete a perform key re-generation.

4.8.  MAC calculations

4.8.1.  Four-pass DSKPP

4.8.1.1.  Server Authentication: <ServerHello>

   The MAC value MUST be computed on the (ASCII) string "MAC 1
   computation", the client's nonce R (if sent), confirmation and the server's nonce
   R_S using an server
       authentication key K_AUTH before "committing" the key.  Note that SHOULD be a special
   authentication key used only for this purpose but MAY be the current
   K_TOKEN.

   The second
       MAC value MAY be computed by using the DSKPP-PRF function of
   Section 4.5, 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 K_AUTH.  The input
   parameter dsLen MUST be set to the length of R_S:

   dsLen = len(R_S)

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

4.8.1.2.  Server Authentication: <ServerFinished>

   The MAC value MUST be computed on the (ASCII) string "MAC 2
   computation" and R_C using an authentication key K_AUTH.  Again, this
   SHOULD be a special authentication key used only that is intended for this purpose,
   but key confirmation MAY also only be an existing K_TOKEN.  (In this case, implementations
   MUST protect against attacks where K_TOKEN is used to pre-compute MAC
   values.)  If no authentication key is present in the cryptographic
   module,
       for replacing and no K_TOKEN existed before existing key.
   d.  Upon receipt of the DSKPP run, K_AUTH MUST be
   the newly generated K_TOKEN.

   If DSKPP-PRF is used as the MAC algorithm, then server's confirmation message, the input parameter s
   MUST consist of
       cryptographic module extracts the concatenation of key data from the (ASCII) string "MAC 2
   computation", R_C, provided key
       container, uses the parameter dsLen MUST be set provided MAC values to perform key
       confirmation and server authentication, and stores the length of
   R_C:

   dsLen = len(R_C)

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

4.8.2.  Two-pass DSKPP

4.8.2.1. key
       material locally.

4.4.2.  Key Confirmation

   In two-pass DSKPP, the client is REQUIRED to include a nonce R in the
   <ClientHello>
   <KeyProvClientHello> message.  Further, the server is REQUIRED to
   include an identifier, ID_S, for itself (via the key container) in
   the
   <ServerFinished> <KeyProvServerFinished> message.  The MAC value in the <ServerFinished>
   <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.  Again, in
   contrast with the MAC calculation in the four-pass DSKPP, this  This key MUST be provided together with K_TOKEN to
   the cryptographic module,
   and hence there is no need for a K_AUTH for key confirmation
   purposes. 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.8.2.2.

4.4.3.  Server Authentication

   As discussed in Section 4.3.2, servers need to

   A server MUST authenticate
   themselves 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. 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.8.3.  One-pass DSKPP

4.8.3.1.  Key Confirmation

   In

4.5.  One-Pass Protocol Usage

   The one-pass DSKPP, the server MUST include an identifier, ID_S, protocol flow is suitable for
   itself (via the key container) in the <ServerFinished> message.  The
   MAC value in the <ServerFinished> message MUST be computed on the
   (ASCII) string "MAC 1 computation", environments wherein near
   real-time communication between the server identifier ID_S, and
   an unsigned integer value I, using a MAC key K_MAC.  The value I MUST
   be monotonically increasing DSKPP client and guaranteed server may not to
   be used again by
   this server towards this cryptographic module. possible.  It could is also suitable for example
   be the number of seconds since some point in time with sufficient
   granularity, a counter value, or environments wherein
   administrative approval is a combination of the two where required step in the
   counter value is reset flow, and for each new time value.
   provisioning of pre-generated keys.  In contrast to the
   MAC calculation in four-pass one-pass DSKPP, the MAC key K_MAC MUST be
   provided together with K_TOKEN server
   simply sends a <KeyProvServerFinished> message to the cryptographic module, DSKPP client.
   In this case, there is no exchange of the <KeyProvClientHello>,
   <KeyProvServerHello>, and <KeyProvClientNonce> DSKPP messages, and
   hence there is no need for a K_AUTH way for the client to express supported algorithms
   or key confirmation purposes.

   Note: The integer I does types.  Before attempting one-pass DSKPP, the server MUST
   therefore have prior knowledge not necessarily need only that the client is able and
   willing to be maintained per
   cryptographic module accept this variant of DSKPP, but also of algorithms and
   key types supported by the client.

   Essentially, one-pass DSKPP server (it is enough if a transport of key material from the
   DSKPP server
   can guarantee that to the same value DSKPP client.  As with two-pass DSKPP, the one-
   pass variant relies on key initialization methods that ensure K_TOKEN
   is never being sent twice not exposed to any other entity than the DSKPP server and the
   same
   cryptographic module).

   If DSKPP-PRF is used module itself.  The same key initialization profiles
   are defined as described in Section 4.4 and Section 11.

   Outside the MAC algorithm, then the input parameter s
   MUST consist of 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 concatenation of key is transported using the (ASCII) string "MAC 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, and I. Computation" || ID_S || I), [ DSKPP-PRF_K_MAC'("MAC 2
      Computation"||ID_S||I')]

   The parameter dsLen MUST be set to at
   least 16 (i.e. 1-pass protocol when the length of 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 MAC MUST be at least 16 octets):

   dsLen >= 16

   MAC = DSKPP-PRF (K_MAC, "MAC 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" Computation" || ID_S || I, dsLen) I), [DSKPP-PRF_K_MAC'("MAC 2
      Computation" || ID_S || I')]

   The server MUST provide I to subsections below describe the client 1-pass protocol in the Nonce attribute of the
   <Mac> element more detail.

4.5.1.  Message Flow

   The 1-pass protocol flow consists of the <ServerFinished> one "pass", i.e., a single
   message using sent from the
   AuthenticationCodeMacType defined in Section 4.9.12.

4.8.3.2.  Server Authentication

   As discussed in Section 4.3.2, servers need to authenticate
   themselves when attempting DSKPP server to replace an existing K_TOKEN.  In 1-pass
   DSKPP, servers authenticate themselves by including the DSKPP client:

   Pass 1: <KeyProvServerFinished>

   a.  The DSKPP server generates a second MAC
   value 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 AuthenticationDataType element. DSKPP server.  The MAC value server then associates K_TOKEN with the
       cryptographic module in a server-side data store.  The intent is
       that the
   AuthenticationDataType element MUST be computed data store later on will be used by some service that
       needs to verify or decrypt data produced by the (ASCII) string
   "MAC 1 computation", cryptographic
       module and the key.
   b.  Once the association has been made, the DSKPP server identifier ID_S, and sends a new value I',
   I' > I, using
       confirmation message to the existing MAC DSKPP client called
       <KeyProvServerFinished>.  The confirmation message includes a key K_MAC' (the MAC
       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 existed
   before this protocol run).  The MAC algorithm the latter MUST be include the same as identity of
       the
   algorithm used DSKPP server for authentication purposes).  In addition,
       <KeyProvServerFinished> MUST include two MACs, which will allow
       the cryptographic module to perform key confirmation purposes.

   If DSKPP-PRF is used as and server
       authentication before "commuting" the MAC algorithm, then key.  Note that unlike two-
       pass DSKPP, in the input parameter s
   MUST consist of one-pass variant, the concatenation of server does not have the (ASCII) string "MAC 1
   computation" ID_S,
       client nonce, R_C, and I'.  The parameter dsLen MUST be set to at
   least 16 (i.e. the length of therefore 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 MACs values are calculated
       with contribution from an unsigned integer, I, generated by the client in
       server during the Nonce attribute protocol run.

   c.  Upon receipt of the <Mac> element of DSKPP server's confirmation message, the AuthenticationDataType extension.  If
       cryptographic module extracts the
   protocol run is successful, key data from the client provided key
       container, uses the two MAC values to perform key confirmation
       and server authentication, and stores I' as the new value of
   I for this server.

4.9.  DSKPP Schema Basics

   This section describes key material locally.

4.5.2.  Key Confirmation

   In one-pass DSKPP, the schema used by DSKPP.  The DSKPP XML
   schema server MUST include an identifier, ID_S, for
   itself can be found in Section 6.  Specific protocol message
   elements are defined in Section 4.10.  Examples can be found (via the key container) in
   Appendix B.

   Some DSKPP elements rely on the parties being able to compare
   received values with stored values.  Unless otherwise noted, all
   elements <KeyProvServerFinished>
   message.  The MAC value in this document that have the XML Schema "xs:string" type,
   or a type derived from it, <KeyProvServerFinished> message MUST
   be compared using an exact binary
   comparison.  In particular, DSKPP implementations MUST NOT depend computed 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 (ASCII) string "MAC 1 computation", the Unicode
   character encoding, Normalization Form C [UNICODE], server
   identifier ID_S, 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.

4.9.1.  The AbstractRequestType Type

   All DSKPP requests are defined as extensions to the abstract
   AbstractRequestType type. unsigned integer value I, using a MAC key
   K_MAC.  The elements of the AbstractRequestType,
   therefore, apply to all DSKPP requests.  All DSKPP requests value I MUST
   contain a Version attribute.  For be monotonically increasing and guaranteed
   not to be used again by this version of server towards this specification,
   Version MUST cryptographic
   module.  It could for example be set to "1.0".

   <xs:complexType name="AbstractRequestType" abstract="true">
     <xs:attribute name="Version" type="VersionType" use="required"/>
   </xs:complexType>

4.9.2.  The AbstractResponseType Type

   All DSKPP responses are defined as extensions to the abstract
   AbstractResponseType type.  The elements number of seconds since some
   point in time with sufficient granularity, a counter value, or a
   combination of the AbstractResponseType,
   therefore, apply two where the counter value is reset for each new
   time value.  In contrast to all DSKPP responses.  All DSKPP responses contain
   a Version attribute indicating the version that was used.  A Status
   attribute, which indicates whether MAC calculation in four-pass DSKPP,
   the preceding request was
   successful or not MAC key K_MAC MUST also be present.  Finally, all responses MAY
   contain a SessionID attribute identifying provided together with K_TOKEN to the particular DSKPP
   session.
   cryptographic module.

   Note: The SessionID attribute needs only integer I does not necessarily need to be present if more than
   one roundtrip is REQUIRED for maintained by the
   DSKPP server on a successful protocol run (this per cryptographic module basis (it is enough if the
   case with
   server can guarantee that the protocol version described herein).

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

4.9.3.  The VersionType Type

   The VersionType type same value is used within DSKPP messages never being sent twice to identify the
   highest version of this protocol supported by
   the DSKPP client and
   server.

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

4.9.4.  The IdentifierType Type

   The IdentifierType type same cryptographic module).

   If DSKPP-PRF is used to identify various DSKPP elements,
   such as sessions, users, and services.  Identifiers the MAC algorithm, then the input parameter s
   MUST NOT be
   longer than 128 octets.

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

4.9.5.  The 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="AuthenticationDataInvalid"/>
       <xs:enumeration value="InitializationFailed"/>
     </xs:restriction>
   </xs:simpleType>

   Upon transmission or receipt consist of a message for which the Status
   attribute's value is not "Success" or "Continue", the default
   behavior, unless explicitly stated otherwise below, is that both concatenation of the
   DSKPP server (ASCII) string "MAC 1
   computation", ID_S, and the DSKPP client I. The parameter dsLen MUST immediately terminate be set to at
   least 16 (i.e. the
   DSKPP session.  DSKPP servers and DSKPP clients MUST delete any
   secret values generated as a result of failed runs length of the DSKPP
   protocol.  Session identifiers MAY be retained from successful or
   failed protocol runs for replay detection purposes, but such retained
   identifiers MAC MUST not be reused for subsequent runs of the protocol.

   When possible, 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 DSKPP client SHOULD present an appropriate error in the Nonce attribute of the
   <Mac> element of the <KeyProvServerFinished> message to using the user.

   These status codes are valid
   AuthenticationCodeMacType defined in all DSKPP Response messages unless
   explicitly stated otherwise:
   o  "Continue" indicates that the DSKPP server is ready for 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
      subsequent request from the DSKPP client.  It cannot be sent second MAC value in the server's final message.
   o  "Success" indicates successful completion
   AuthenticationDataType element of <KeyProvServerFinished>.  The MAC
   value in the DSKPP session.
      It can only AuthenticationDataType element MUST be sent in computed on the server's final message.
   o  "Abort" indicates that
   (ASCII) string "MAC 1 computation", the DSKPP server rejected identifier ID_S, and a
   new value I', I' > I, using the DSKPP
      client's request for unspecified reasons.
   o  "AccessDenied" indicates existing MAC key K_MAC' (the MAC key
   that the DSKPP client is not authorized
      to contact existed before this DSKPP server.
   o  "MalformedRequest" indicates that the DSKPP server failed to parse protocol run).  The MAC algorithm MUST be
   the DSKPP client's request.

   o  "UnknownRequest" indicates that same as the DSKPP client made a request
      that algorithm used for key confirmation purposes.

   If DSKPP-PRF is unknown to the DSKPP server.
   o  "UnknownCriticalExtension" indicates that a critical DSKPP
      extension (see below) used by as the DSKPP client was not supported
      or recognized by MAC algorithm, then the DSKPP server.
   o  "UnsupportedVersion" indicates that input parameter s
   MUST consist of the DSKPP client used a DSKPP
      protocol version not supported by concatenation of the DSKPP server.  This error is
      only valid in the DSKPP server's first response message.
   o  "NoSupportedKeyTypes" indicates that the DSKPP client only
      suggested key types that are not supported by (ASCII) string "MAC 1
   computation" ID_S, and I'.  The parameter dsLen MUST be set to at
   least 16 (i.e. the DSKPP server.
      This error is only valid in length of the DSKPP server's first response
      message.
   o  "NoSupportedEncryptionAlgorithms" indicates that 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 DSKPP client
      only suggested encryption algorithms that are not supported by the
      DSKPP server.  This error is only valid in the DSKPP server's
      first response message.  Note that the error will only occur if Nonce attribute of
   the DSKPP server does not support any <Mac> element of the DSKPP client's
      suggested encryption algorithms.
   o  "NoSupportedMACAlgorithms" indicates that AuthenticationDataType extension.  If the
   protocol run is successful, the DSKPP client only
      suggested MAC algorithms that are not supported by stores I' as the DSKPP new value of
   I for this server.  This error is only valid

5.  Methods Common to More Than One Protocol Variant

   The mechanisms contained in the DSKPP server's first
      response message.  Note that the error will only occur if the
      DSKPP server does not support any this section are used in more than one
   variant of the DSKPP.

5.1.  The DSKPP client's suggested
      MAC algorithms.
   o  "NoProtocolVariants" indicates that One-Way Pseudorandom Function, DSKPP-PRF

5.1.1.  Introduction

   All of the DSKPP client only
      suggested a protocol variant (either 2-pass or 4-pass) that is not
      supported by the DSKPP server.  This error is only valid in the
      DSKPP server's first response message.  Note that the error will
      only occur if variants depend on DSKPP-PRF.  The general
   requirements on DSKPP-PRF are the DSKPP server does not support any 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
      client's suggested protocol variants.
   o  "NoSupportedKeyContainers" indicates that DSKPP-PRF function MUST be capable of generating a variable-
   length output, and its output MUST be unpredictable even if other
   outputs for the DSKPP client only
      suggested same key container formats that are not supported by the
      DSKPP server.  This error known.

   It is only valid in the DSKPP server's
      first response message.  Note assumed that the error will only occur if
      the DSKPP server does not support any realization of the DSKPP client's
      suggested DSKPP-PRF takes three input
   parameters: A secret key container formats.
   o  "AuthenticationDataInvalid" indicates that the DSKPP client
      supplied user or device authentication data that k, some combination of variable data, and
   the DSKPP server
      failed to validate.
   o  "InitializationFailed" indicates that desired length of the DSKPP server could not
      generate output.  The combination of variable data
   can, without loss of generalization, be considered as a valid key given 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 provided data.  When point of view of this status
      code
   specification, DSKPP-PRF is received, a "black-box" function that, given the DSKPP client SHOULD try to restart DSKPP, as
      it is possible that
   inputs, generates a new run will succeed.

4.9.6.  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 pseudorandom value.

   Separate specifications MAY define the correct shared
   secret implementation of DSKPP-PRF
   for MAC'ing purposes.  The default DeviceIdentifierDataType is
   defined in [PSKC].

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

4.9.7.  The TokenPlatformInfoType and PlatformType Types

   The TokenPlatformInfoType type is used to carry characteristics various types of
   the intended cryptographic module platform, and applies 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
   public-key variant particular string being derived
   dsLen desired length of DSKPP in situations when the client potentially
   needs to select a cryptographic module to initialize.

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

4.9.8.  The NonceType Type

   The NonceType type is used to carry output

   Output:

   DS    pseudorandom values in DSKPP
   messages.  A nonce, as the name implies, MUST be used only once. string, dsLen-octets long
   For
   each DSKPP message that requires a nonce element to be sent, a fresh
   nonce MUST be generated each time.  Nonce values the purposes of this document, the secret key k MUST be at least
   16 octets long.

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

4.9.9.  The AlgorithmsType Type

   The AlgorithmsType type is a list

5.2.  Encryption of type-value pairs that define
   algorithms supported by a Pseudorandom Nonces Sent from the DSKPP client or server.  Algorithms are
   identified through URIs.

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

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

4.9.10.  The ProtocolVariantsType 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 TwoPassSupportType Types

   The ProtocolVariantsType type is OPTIONALLY used public key provided by the DSKPP client
   to indicate server
   or by a shared secret key.  For example, in the number of passes case of the DSKPP protocol that it
   supports (see Section 4.2).  The ProtocolVariantsType a public RSA
   key, an RSA encryption scheme from PKCS #1 [PKCS-1] MAY be used used.

   In the case of a shared secret key, to
   indicate support for 4-pass or 2-pass DSKPP.  Because 1-pass avoid dependence on other
   algorithms, the DSKPP
   does not include a client request to MAY use the server, DSKPP-PRF function described
   herein with the
   ProtocolVariantsType type MAY NOT shared secret key K_SHARED as input parameter k (in
   this case, K_SHARED SHOULD be used to indicate support solely for
   1-pass DSKPP.  If this purpose), the ProtocolVariantsType is not used, then
   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 proceed with ordinary 4-pass DSKPP.  However, it
   does not support 4-pass DSKPP, then perform the server MUST find 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 suitable
   two-pass variant or else the protocol run will fail.

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

   <xs:complexType name="TwoPassSupportType">
     <xs:sequence maxOccurs="unbounded">
       <xs:element name="SupportedKeyInitializationMethod"
         type="xs:anyURI"/>
       <xs:element name="Payload" minOccurs="0"/>
     </xs:sequence>
   </xs:complexType>

   The TwoPassSupportType type signals client support for the 2-pass
   version of DSKPP, informs generated K_TOKEN ends up associated with the server of supported two-pass variants,
   correct cryptographic module and provides OPTIONAL payload data to user, the DSKPP server.  The payload
   is sent in an opportunistic fashion, and server MAY be discarded by couple an
   initial user authentication to the DSKPP server if execution in several ways,
   as discussed in the server does not support following sub-sections.  Whatever the two-pass variant method, the
   payload
   DSKPP server MUST ensure that a generated key is associated with.  The elements 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 type have the
   following meaning:
   o  <SupportedKeyInitializationMethod>: A two-pass context, see Section 14.

5.3.1.  Device Certificate

   Instead of requiring an Authentication Code for in-band
   authentication, a device private key initialization
      method supported by the DSKPP client.  Multiple supported methods
      MAY and certificate could be present, in used,
   which case they MUST be listed in order of
      precedence.
   o  <Payload>: An OPTIONAL payload associated was supplied with each supported key
      initialization method.
   A DSKPP client that indicates support for two-pass DSKPP MUST also
   include the nonce R in cryptographic module by its <ClientHello> message (this will enable
   the issuer for
   client to verify that authentication at the DSKPP server it is communicating with transport layer e.g TLS/HTTPS.  When the
   Device certificate is alive).

4.9.11.  The KeyContainersFormatTypeType

   The KeyContainersFormatType type available and client authentication is a list of type-value pairs that
   are OPTIONALLY used to define key container formats supported by a not
   provided in the transport layer, the DSKPP client or server.  Key container formats are identified through
   URIs, e.g., may include a
   device's certificate signed data for the PSKC URI
   "http://www.openauthentication.org/OATH/2006/10/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"/>
   </xs:simpleType>

4.9.12.  The AuthenticationDataType Type

   The AuthenticationDataType type is OPTIONALLY used to carry client or
   server authentication values in DSKPP messages (see Section 4.3). data.

5.3.2.  Device Identifier

   The element MAY be used as follows:
   a.  A DSKPP client MAY include server could be pre-configured with a one-time use AuthenticationCode that
       was given by the issuer unique device
   identifier corresponding to the user for acquiring a symmetric
       key.  An AuthenticationCode MAY or particular cryptographic module.  The
   DSKPP server MAY NOT contain alphanumeric
       characters then include this identifier in addition to numeric digits depending on the device
       type DSKPP
   initialization trigger, and policy of the issuer.  For example, if the device is a
       mobile phone, a code that the user enters on the keypad DSKPP client would
       typically be restricted to numeric digits for ease of use.  An
       activation code can be sent include it in its
   message(s) to the DSKPP server in plaintext
       form, hashed data form, or keyed hash data form depending on the
       underlying transport protocol.
   b.  A for authentication.  Note that it is
   also legitimate for a DSKPP client MAY include to initiate the DSKPP protocol run
   without having received an AuthenticationCertificate that
       contains initialization message from a certificate issued with the server, but
   in this case any provided device identifier MUST NOT be accepted by
   the issuer.
   c.  A DSKPP server MAY use unless the AuthenticationDataType element
       AuthenticationCodeMac server has access to carry a MAC unique key for authenticating itself to the client.  For example, when
   identified device and that key will be used in the protocol.

5.3.3.  Authentication Code

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

   Note: An alternate method for getting the Authentication Code to the DSKPP client
       that
   client, is for the DSKPP server knows to place the value of in the key it is about to
       replace.

   <xs:complextype name="AuthenticationDataType">
     <xs:sequence>
       <xs:element name="ClientID" type="dskpp:IdentifierType"
         minOccurs="0"/>
       <xs:choice minOccurs="0">
         <xs:element name="AuthenticationCode"
           type="dskpp:AuthenticationCodeType"/>
         <xs:element name="AuthenticationCodeDigest"
           type="dskpp:AuthenticationCodeDigestType"/>
         <xs:element name="AuthenticationCodeMac"
           type="dskpp:AuthenticationCodeMacType"/>
         <xs:element name="AuthenticationCertificate"
           type="ds:KeyInfoType"/>
       </xs:choice>
     </xs:sequence>
   </xs:complexType>

   <xs:simpleType name="AuthenticationCodeType">
     <xs:restriction base="xs:string">
       <xs:maxLength value="20"/>
     </xs:restriction>
   </xs:simpleType>

   <xs:complexType name="AuthenticationCodeDigestType">
     <xs:simpleContent>
       <xs:extension base="xs:base64Binary">
         <xs:attribute name="HashAlgorithm" type="xs:anyURI"
           use="required"/>
       </xs:extension>
     </xs:simpleContent>
   </xs:complexType>

   <xs:complexType name="AuthenticationCodeMacType">
     <xs:sequence>
       <xs:element name="Data" type="xs:base64Binary">
       <xs:element name="Nonce" type="dskpp:NonceType"/>
     </xs:sequence>
     <attribute name="HMACAlgorithm" type="xs:anyURI"
       use="required"/>
     <attribute name="NonceId" type="dskpp:IdentifierType"/>
   </xs:complexType>

   The
   <TriggerNonce> element of the AuthenticationDataType type have the following
   meaning:
   o  <ClientID>: A requestor's identifier.  The value MAY be a user ID,
      a device ID, or a keyID associated with the requestor's
      authentication value. DSKPP initialization trigger (if
   triggers are used; see Section 12.2.7) .  When the authentication data this method is based on used, a
      certificate, <ClientID> can
   transport providing privacy and integrity MUST be omitted, as the certificate itself
      is typically sufficient used to identify deliver the requestor.  Also, if a
      <DSKPPTrigger> message was provided by
   DSKPP initialization trigger from the DSKPP server to initiate the DSKPP protocol run, <ClientID> can
   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 omitted, considered as a special
   form of a shared secret between a User and a DSKPP server.  The
   Issuer may generate the DeviceID,
      KeyID, and/or nonce provided in Authentication Code as follows:

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

   where

   passwordLen  : 1 digit indicating the <InitializationTriggerType>
      element ought to be sufficient to identify 'password' length.  The maximum
             length of the requestor.
   o  <AuthenticationCode>: password is 10.  A one-time use passwordLen value sent in '0'
             indicates a password of 10 digits.

   identifier  : A globally unique identifier of the clear to user's order for
             token provisioning.  The length of the DSKPP server.
   o  <AuthenticationCodeDigest>: A one-time use value sent in digest
      form identifier may be
             fixed e.g. 10 digits or variable e.g. 1 to the DSKPP server.
   o  <AuthenticationCodeMac>: An authentication MAC and OPTIONAL
      additional information (e.g., MAC algorithm). 20 digits.  The value could
             identifier may be
      a one-time use value sent generated as a MAC value sequence number.

   password  : 6 to the DSKPP server; or,
      it could 10 digits.  The password should be generated by the
             system as a MAC value sent random number to make the DSKPP client, where the MAC is AUTHCODE more
             difficult to guess.

   checksum  : 1 digit calculated as described from the remaining digits in Section 4.8.
   o  <AuthenticationCertificate>: A device certificate sent to the
      DSKPP server.

4.9.13.  The PayloadType Type code.

   The PayloadType type is used to carry data in a DSKPP client or
   server message.  For this version of Authentication Data, AUTHDATA, may be derived from the protocol, only one payload
   is defined, the pseudorandom string R_S, 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 one message, a description of DSKPP-PRF in general and
      Appendix B for a description of DSKPP-PRF-AES.

      In four-pass DSKPP, the DSKPP
   <ServerHello>.

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

4.9.14.  The MacType Type

   The MacType type is used by cryptographic module uses the client nonce
      R_C, the DSKPP server to carry a MAC value
   that nonce R_S, and the DSKPP server uses URL URL_S to authenticate itself calculate
      the MAC.  In two-pass DSKPP, the cryptographic module does not
      have access to the client.

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

4.9.15.  The KeyContainerType Type

   The KeyContainerType type server nonce R_S therefore only the client
      nonce R_C is used by in combination with the DSKPP server in its final
   message URL URL_S to carry symmetric key(s) (in
      produce the 2- and 1-pass exchanges)
   and configuration data. MAC.

      The default element defined for the
   KeyContainerType 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 contained in optional and MAY be one of the namespace defined following:

                   K_CLIENT: The device public key when a device
                   certificate is available and used for key transport
                   in the PSKC
   namespace as KeyContainerType (see [PSKC].

   <xs:complexType name="KeyContainerType">
     <xs:choice>
       <xs:element name="KeyContainer"
         type="pskc:KeyContainerType"/>
       <xs:element name="##other" processContents="strict"/>
     </xs:choice>
   </xs:complexType>

4.9.16. 2-pass

                   K_SHARED: The ExtensionsType shared key between the Client and the AbstractExtensionType Types

   The ExtensionsType type
                   Server when it is used for key wrap in two-pass or
                   for R_C protection in four-pass

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

         'truncate()' returns the first 16 bytes from the result of type-value pairs that define
   OPTIONAL DSKPP features supported 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 DSKPP third
      party provisioning service provider, both client or authentication
      and issuer authentication are required by the provisioning server.
   Extensions
      Client authentication to the issuer MAY be sent with any DSKPP message.  Please see the
   description of individual DSKPP messages in Section 4.11 of this
   document for applicable extensions.  All DSKPP extensions are defined in-band or out-of-band
      as extensions to the AbstractExtensionType type. described above.  The elements of issuer acts as a proxy for the
   AbstractExtensionType, therefore, apply
      provisioning server.  The issuer authenticates to all DSKPP extensions.
   Unless 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 extension is marked as Critical, Authentication Code

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

5.4.2.  Example Using a receiving party need not
   be able to interpret it.  A receiving party is always free to
   disregard any (non-critical) extensions.

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

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

4.10.  DSKPP Messages

4.10.1.  Introduction 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, DSKPP messages, including their example messages are used to describe parameters,
   encoding and semantics are defined.

4.10.2. in a 4-pass DSKPP Initialization (OPTIONAL) exchanges.  The examples are
   written using XML.  While they are syntactically correct, MAC and
   cipher values are fictitious.

6.1.  XML Basics

   The DSKPP server MAY initialize the DSKPP protocol by sending a
   <DSKPPTrigger> message.  This message MAY, e.g., XML schema can be sent in response
   to a user requesting key initialization found in a browsing session.

   <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="DSKPP_URL" type="xs:anyURI" minOccurs="0"/>
       <xs:any namespace="##other" processContents="strict"
         minOccurs="0"/>
     </xs:sequence>
   </xs:complexType>

   <xs:element name="DSKPPTrigger" type="DSKPPTriggerType"/>

   <xs:complexType name="DSKPPTriggerType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Message used to trigger the device to initiate a
         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>

   The <DSKPPTrigger> element is intended for the DSKPP client and MAY
   inform the Section 13.  Some DSKPP client about the identifier for elements
   rely on the device parties being able to compare received values with stored
   values.  Unless otherwise noted, all elements in this document that
   houses
   have the cryptographic module to XML Schema "xs:string" type, or a type derived from it, MUST
   be initialized, and, OPTIONALLY,
   of the identifier for the key 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 module.  The latter would apply
   to key renewal.  The trigger always contains a nonce to allow the
   DSKPP server to couple the trigger with compare values that are represented using
   different character encodings MUST use a later DSKPP <ClientHello>
   request.  Finally, comparison method that
   returns the trigger MAY contain a URL same result as converting both values to use when
   contacting the DSKPP server.  The <xs:any> elements are Unicode
   character encoding, Normalization Form C [UNICODE], and then
   performing an exact binary comparison.

   No collation or sorting order for future
   extensibility.  Any provided <DeviceIdentifierData> attributes or <KeyID> element values is
   defined.  Therefore, DSKPP implementations MUST be used by the DSKPP client in 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 subsequent <ClientHello>
   request. <KeyProvClientHello> Request

   The OPTIONAL <TokenPlatformInfo> element informs the DSKPP
   client about the characteristics components of this message have the intended cryptographic module
   platform, and applies in following meaning:
   o  Version: (attribute inherited from the public-key variant AbstractRequestType type)
      The highest version of DSKPP in
   situations when this protocol the client potentially needs to decide which supports.  Only
      version one of
   several modules to initialize. ("1.0") is currently specified.
   o  <DeviceIdentifierData>: An identifier for the cryptographic module
      as defined in Section 5.3 above.  The Version attribute identifier MUST only be set to "1.0" for this version of DSKPP.

4.10.3.  The DSKPP Client's Initial PDU (2- and 4-Pass)

   This message is the initial message sent from
      present if such shared secrets exist or if the DSKPP client to identifier was
      provided by the
   DSKPP server.

   <xs:element name="ClientHello" type="ClientHelloPDU"/>

   <xs:complexType name="ClientHelloPDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Message sent from DSKPP client to DSKPP server to initiate in a
         DSKPP session.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="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"/>
           <xs:element name="TriggerNonce" type="dskpp:NonceType"
             minOccurs="0"/>
           <xs:element name="SupportedKeyTypes"
             type="dskpp:AlgorithmsType"/>
           <xs:element name="SupportedEncryptionAlgorithms"
             type="dskpp:AlgorithmsType"/>
           <xs:element name="SupportedMACAlgorithms"
             type="dskpp:AlgorithmsType"/>
           <xs:element name="SupportedProtocolVariants"
             type="dskpp:ProtocolVariantsType" minOccurs="0"/>
           <xs:element name="SupportedKeyContainers"
             type="dskpp:KeyContainersFormatType" minOccurs="0"/>
           <xs:element name="AuthenticationData"
             type="dskpp:AuthenticationDataType" minOccurs="0"/>
           <xs:element name="Extensions" type="dskpp:ExtensionsType"
             minOccurs="0"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   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 cryptographic module
      as defined in Section 4.3.1 above.  The identifier MUST only be
      present if such shared secrets exist or if the identifier was
      provided by the server in a <DSKPPTrigger> <KeyProvTrigger> element (see
      Section 5.2.7 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 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 a
      <DSKPPTrigger> element (see Section 5.2.7 below).  In the latter <KeyProvTrigger> element, in which case, it MUST have the
      same value as the identifier provided in that element. element (see a
      (Section 9) and Section 12.2.7 below).
   o  <ClientNonce>:  <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 the <KeyID> element is present.
   o  <TriggerNonce>: This OPTIONAL element MUST be present if and only
      if the DSKPP run was initialized with a <DSKPPTrigger> <KeyProvTrigger> message
      (see Section 5.2.7 12.2.7 below), 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 and that
      any device or key identifier values provided in the <DSKPPTrigger>
      <KeyProvTrigger> message match the corresponding identifier values
      in the
      <ClientHello> <KeyProvClientHello> message.
   o  <SupportedKeyTypes>: A sequence of URIs indicating the key types
      for which the cryptographic module is willing to generate keys
      through DSKPP.
   o  <SupportedEncryptionAlgorithms>: A sequence of URIs indicating the
      encryption algorithms supported by the cryptographic module for
      the purposes of DSKPP.  The DSKPP client MAY indicate the same
      algorithm both as a supported key type and as an encryption
      algorithm.
   o  <SupportedMACAlgorithms>:  <SupportedMacAlgorithms>: A sequence of URIs indicating the MAC
      algorithms supported by the cryptographic module for the purposes
      of DSKPP.  The DSKPP client MAY indicate 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 E). B).
   o  <SupportedProtocolVariants>: This 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 <ClientNonce> <KeyProvClientNonce> MUST
      be set to nonce R in the <ClientHello> <KeyProvClientHello> message unless
      <TriggerNonce> is already present.
   o  <SupportedKeyContainers>: This OPTIONAL element is a sequence of
      URIs indicating the key container formats supported by the DSKPP
      client.  If this element is not provided, then the DSKPP server
      MUST proceed with
      "http://www.openauthentication.org/OATH/2006/10/PSKC#KeyContainer"
      "urn:ietf:params:xml:schema:keyprov:container#KeyContainer" (see [PSKC].
      [PSKC]).
   o  <AuthenticationData>: This OPTIONAL element contains data that the
      DSKPP client uses to authenticate the user or device to the DSKPP
      server.  The element is set as specified in Section 4.3.1. 5.3.
   o  <Extensions>: A sequence of extensions.  One extension is defined
      for this message in this version of DSKPP: the ClientInfoType (see
      Section 4.11).

4.10.4. 10).

6.2.2.1.  The DSKPP Server's Initial PDU (4-Pass Only)

   This message Client:  The DeviceIdentifierDataType Type

   The DeviceIdentifierDataType type is used to uniquely identify the first message sent from
   device that houses the cryptographic module, e.g., a mobile phone.
   The device identifier allows the DSKPP server to the
   DSKPP client (assuming find, e.g., a trigger message has not been sent to
   initiate pre-
   shared transport key for 2-pass DSKPP and/or the protocol, correct shared
   secret for MAC'ing purposes.  The default DeviceIdentifierDataType is
   defined in which case, this message [PSKC].

6.2.2.2.  Selecting a Protocol Variant: The ProtocolVariantsType Type

   The ProtocolVariantsType type is the second
   message sent from the OPTIONAL for a DSKPP server client, who MAY
   use it to indicate the DSKPP client).  It is sent
   upon reception number of a <ClientHello> message.

   <xs:element name="ServerHello" type="ServerHelloPDU"/>

   <xs:complexType name="ServerHelloPDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Message sent from passes of the DSKPP server protocol that it
   supports.  The ProtocolVariantsType MAY be used to indicate support
   for 4-pass or 2-pass DSKPP.  Because 1-pass DSKPP does not include a
   client
         in response request to a received ClientHello PDU.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="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>

   The components of this message have the following meaning:

   o  Version: (attribute inherited from the AbstractResponseType type)
      The version selected by server, the DSKPP server. ProtocolVariantsType type MAY NOT
   be lower than the
      version indicated by the DSKPP client, in which case, local policy
      at the client MUST determine whether or not used 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 indicate support for the <ClientHello>. 1-pass DSKPP.  If Status the
   ProtocolVariantsType is not "Continue",
      only used, then the Status and Version attributes DSKPP server will be present; otherwise,
      all proceed
   with ordinary 4-pass DSKPP.  However, it does not support 4-pass
   DSKPP, then the other element server MUST be present as well.
   o  <KeyType>: find a suitable two-pass variant or else
   the protocol run will fail.

   The TwoPassSupportType type signals client support for the 2-pass
   version of DSKPP, informs the key to be generated.
   o  <EncryptionAlgorithm>: The encryption algorithm server of supported two-pass variants,
   and provides OPTIONAL payload data to use when
      protecting R_C.
   o  <MacAlgorithm>: the DSKPP server.  The MAC algorithm to payload
   is sent in an opportunistic fashion, and MAY be used discarded by the
   DSKPP server.
   o  <EncryptionKey>: Information about server if the key to use when encrypting
      R_C. It will either be server does not support the server's public key (the <ds:KeyValue>
      alternative of ds:KeyInfoType) or an identifier for a shared
      secret key (the <ds:KeyName> alternative two-pass variant the
   payload is associated with.  The elements of ds:KeyInfoType). this type have the
   following meaning:
   o  <KeyContainerFormat>: The  <SupportedKeyInitializationMethod>: A two-pass key container format type to be used initialization
      method supported by the DSKPP server.  The default setting relies on the
      KeyContainerType element defined client.  Multiple supported methods
      MAY be present, in
      "urn:ietf:params:xml:schema:keyprov:container" [PSKC]. which case they MUST be listed in order of
      precedence.
   o  <Payload>: The actual payload.  For this version of the protocol,
      only one An OPTIONAL payload is defined: the pseudorandom string R_S.
   o  <Extensions>: associated with each supported key
      initialization method.
   A list of server extensions.  Two extensions are
      defined DSKPP client that indicates support for this message in this version of DSKPP: the
      ClientInfoType and the ServerInfoType (see Section 4.11).
   o  <Mac>: The MAC MUST be present if the two-pass DSKPP run will result in the
      replacement of an existing symmetric key with a new one (i.e., if MUST also
   include the <KeyID> element was present nonce R in its <KeyProvClientHello> message (this will
   enable the <ClientHello message).  In
      this case, client to verify that the DSKPP server MUST prove to the cryptographic module
      that it is authorized to replace it. communicating
   with is alive).

6.2.2.3.  Selecting a Key Container Format: The MAC value MUST be
      computed as defined in Section 4.8.1.1. KeyContainersFormatType
          Type

   The OPTIONAL KeyContainersFormatType type is a list of type-value
   pairs that a DSKPP client MUST verify the MAC if the successful execution
      of the protocol will result in the replacement of an existing
      symmetric or server MAY use to define key with a newly generated one.  The DSKPP client MUST
      terminate the DSKPP session if container
   formats it supports.  Key container formats are identified through
   URIs, e.g., the MAC does not verify, PSKC KeyContainer URI
   "urn:ietf:params:xml:schema:keyprov:container#KeyContainer" (see
   [PSKC]).

6.2.2.4.  Selecting a Client and MUST
      delete any nonces, keys, and/or secrets associated with the failed
      run of the DSKPP protocol. Server Authentication Mechanism: The MacType's MacAlgorithm attribute MUST, when present, identify
      the negotiated MAC algorithm.

4.10.5.
          AuthenticationDataType Type

   The DSKPP Client's Second PDU (4-Pass Only)

   This message contains the nonce chosen by the cryptographic module,
   R_C, encrypted OPTIONAL AuthenticationDataType type is used by the specified encryption key and encryption
   algorithm.

   <xs:element name="ClientNonce" type="ClientNoncePDU"/>

   <xs:complexType name="ClientNoncePDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Second message sent from DSKPP client to DSKPP clients and
   server to carry authentication values in a DSKPP session.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="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> messages.  The components of this message have the following meaning:

   o  Version: (inherited element
   MAY contain a device certificate or MAC derived from the AbstractRequestType type) MUST be the
      same version an
   authentication code as in the <ServerHello> message.
   o  <SessionID>: MUST have follows:
   a.  A DSKPP client MAY include a one-time use AuthenticationCode that
       was given by the same value as issuer to the SessionID attribute user for acquiring a symmetric
       key.  An AuthenticationCode MAY or MAY NOT contain alphanumeric
       characters in addition to numeric digits depending on the received <ServerHello> message.
   o  <EncryptedNonce>: The nonce generated device
       type and encrypted by policy of the
      cryptographic module.  The encryption MUST be made using issuer.  For example, if the
      selected encryption algorithm and identified key, and as specified
      in Section 4.5.
   o  <AuthenticationData>: The device is a
       mobile phone, a code that the user enters on the keypad would
       typically be restricted to numeric digits for ease of use.  An
       authentication data value, which code MAY
      OPTIONALLY be sent to the same as provided in the <ClientHello>, MUST be
      set DSKPP server as specified in MAC data
       calculated according to section Section 4.3.1.
   o  <Extensions>: 5.3.3.
   b.  A list DSKPP client MAY contain Authentication Data consisting of extensions.  Two extensions are defined
       signed data of client Nonce with a client certificate's private
       key.  A service provider may have a policy to issue symmetric
       keys for this message a device only if it has a trusted device certificate.
       An authentication code isn't required in this version of DSKPP: the ClientInfoType and
      the ServerInfoType (see Section 4.11).

4.10.6.  The DSKPP Server's Final PDU (1-, 2-, and 4-Pass)

   This message is the last message of the DSKPP protocol run.  In a
   4-pass exchange, the case.
   c.  A DSKPP server sends this message in response MAY use the AuthenticationDataType element
       AuthenticationCodeMac to carry a
   <ClientNonce> message, whereas in MAC for authenticating itself to
       the client.  For example, when a successful 1- or 2-pass exchange, the DSKPP server
   sends this message
       protocol run will result in response to a <ClientHello> message.  In a
   1-pass exchange, an existing key being replaced, then
       the DSKPP server sends only this message MUST include a MAC proving to the
   client.

   <xs:element name="ServerFinished" type="ServerFinishedPDU"/>

   <xs:complexType name="ServerFinishedPDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Final message sent from DSKPP server to DSKPP client in a DSKPP session.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="AbstractResponseType">
         <xs:sequence minOccurs="0">
           <xs:element name="KeyContainer"
             type="dskpp:KeyContainerType"/>
           <xs:element name="Extensions"
             type="dskpp:ExtensionsType" minOccurs="0"/>
           <xs:element name="Mac"
             type="dskpp:MacType"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   The components
       that the server knows the value of this message have the following meaning:

   o  Version: (inherited from the AbstractResponseType type) key it is about to
       replace.

   The DSKPP
      version used in this session.
   o  SessionID: (inherited from element of the AbstractResponseType type) The
      previously established identifier for this session. AuthenticationDataType type have the following
   meaning:
   o  Status: (inherited from  <ClientID>: A requester's identifier.  The value MAY be a user ID,
      a device ID, or a keyID associated with the AbstractResponseType type) Return code
      for requester's
      authentication value.  When the <ServerFinished> message.  If Status authentication data is not "Success",
      only the Status, SessionID, and Version attributes will based on a
      certificate, <ClientID> can be present
      (the presence of omitted, as the SessionID attribute certificate itself
      is dependent on typically sufficient to identify the type
      of reported error); otherwise, all requester.  Also, if a
      <KeyProvTrigger> message was provided by the other elements MUST be
      present as well.  In this latter case, server to initiate
      the <ServerFinished>
      message DSKPP protocol run, <ClientID> can be seen omitted, as a "Commit" message, instructing the
      cryptographic module to store
      DeviceID, KeyID, and/or nonce provided in the generated key and associate
      <InitializationTriggerType> element ought to be sufficient to
      identify the
      given key identifier with this key. requester.
   o  <KeyContainer>: The key container containing symmetric key values
      (in the case of a 2- or 1-pass exchange)  <AuthenticationCodeMac>: An authentication MAC and configuration data. OPTIONAL
      additional information (e.g., MAC algorithm).  The default container format is based on the KeyContainerType type
      from PSKC, value could be
      a one-time use value sent as defined in [PSKC].
   o  <Extensions>: A list of extensions chosen by a MAC value to the DSKPP server.
      For this message, this version of DSKPP defines one extension, server; or,
      it could be a MAC value sent to the
      ClientInfoType (see DSKPP client.  Refer to
      section Section 4.11). 5.3.3 for calculation of MAC with an
      authentication code.
   o  <Mac>: To avoid a false "Commit" message causing  <DigitalSignature>: Client nonce R_C signed using the cryptographic
      module to end up device
      certificate and sent in an initialized state KeyProvClientHello for which two-pass protocol
      or in KeyProvClientNonce for four-pass protocol.

6.2.3.  Components of the <KeyProvServerHello> Response

   This message is the first message sent from the DSKPP server does
      not know to the stored key, <ServerFinished> messages MUST always be
      authenticated with
   DSKPP client (assuming a MAC.  The MAC MUST be made using trigger message has not been sent to
   initiate the already
      established MAC algorithm.  The MAC value MUST be computed as
      specified protocol, in Section 4.8.1.2.
      When receiving a <ServerFinished> message with Status="Success"
      for which case, this message is the MAC verifies, second
   message sent from the DSKPP client MUST associate the
      generated key K_TOKEN with the provided key identifier and store
      this data permanently.  After this operation, it MUST not be
      possible server to overwrite the key unless knowledge of an authorizing
      key DSKPP client).  It is proven through a MAC on sent
   upon reception of a later <ServerHello> (and
      <ServerFinished>) <KeyProvClientHello> message.  The DSKPP client MUST verify components of
   this message have the MAC. following meaning:

   o  Version: (attribute inherited from the AbstractResponseType type)
      The DSKPP client MUST
      terminate version selected by the DSKPP session if server.  MAY be lower than the MAC does not verify, and MUST,
      version indicated by the DSKPP client, in this which case, also delete any nonces, keys, and/or secrets
      associated with local policy
      at the failed run of client MUST determine whether or not to continue the DSKPP protocol.
      The MacType's MacAlgorithm attribute MUST, when present, identify
      session.
   o  SessionID: (attribute inherited from the negotiated MAC algorithm.

4.11.  Protocol Extensions

4.11.1.  The ClientInfoType Type

   When present in a <ClientHello> or a <ClientNonce> message, the
   OPTIONAL ClientInfoType extension contains DSKPP client-specific
   information.  DSKPP servers MUST support AbstractResponseType
      type) An identifier for this extension.  DSKPP
   servers MUST NOT attempt to interpret the data it carries and, if
   received, MUST include it unmodified in the current protocol run's
   next server response.  Servers need not retain session.
   o  Status: (attribute inherited from the ClientInfoType's
   data after that response has been generated.

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

4.11.2.  The ServerInfoType Type

   When present, AbstractResponseType type)
      Return code for the OPTIONAL ServerInfoType extension contains DSKPP
   server-specific information.  This extension <KeyProvClientHello>.  If Status is not
      "Continue", only valid in
   <ServerHello> messages for which the Status = "Continue".  DSKPP clients
   MUST support this extension.  DSKPP clients MUST NOT attempt to
   interpret and Version attributes will be
      present; otherwise, all the data it carries and, if received, other element MUST include it
   unmodified in the current protocol run's next client request (i.e.,
   the <ClientNonce> message).  DSKPP clients need not retain be present as well.
   o  <KeyType>: The type of the
   ServerInfoType's data after that request has been key to be generated.  This
   extension MAY
   o  <EncryptionAlgorithm>: The encryption algorithm to use when
      protecting R_C.
   o  <MacAlgorithm>: The MAC algorithm to be used, e.g., for state management in used by the DSKPP server.

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

4.11.3.  The KeyInitializationDataType Type

   This extension is used for 2- and 1-pass DSKPP exchange; it carries
   an identifier for
   o  <EncryptionKey>: Information about the selected key initialization method as well as key initialization method-dependent payload data.

   Servers MAY include this extension in a <ServerFinished> message that
   is being sent in response to a received <ClientHello> message if and
   only if that <ClientHello> message selected TwoPassSupport as the
   ProtocolVariantType and the client indicated support for use when encrypting
      R_C. It will either be the selected server's public key initialization method.  Servers MUST include this extension in a
   <ServerFinished> message that is sent as part (the <ds:KeyValue>
      alternative of ds:KeyInfoType) or an identifier for a 1-pass DSKPP.

   <xs:complexType name="KeyInitializationDataType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         This extension is only valid in ServerFinished PDUs. It
         contains shared
      secret key initialization data and its presence results in a
         two-pass (or one-pass, if no ClientHello 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"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   The elements (the <ds:KeyName> alternative of this type have the following meaning: ds:KeyInfoType).
   o  <KeyInitializationMethod>: A two-pass  <KeyContainerFormat>: The key initialization method
      supported container format type to be used by
      the DSKPP client. server.  The default setting relies on the
      KeyContainerType element defined in
      "urn:ietf:params:xml:schema:keyprov:container" [PSKC].
   o  <Payload>: A payload associated with the key initialization
      method.  Since The actual payload.  For this version of the syntax protocol,
      only one payload is a shorthand defined: the pseudorandom string R_S.
   o  <Extensions>: A list of server extensions.  Two extensions are
      defined for <xs:element
      name="Payload" type="xs:anyType"/>, any well-formed payloads can
      be carried this message in this element.

5.  Protocol Bindings

5.1.  General Requirements

   DSKPP assumes a reliable transport.

5.2.  HTTP/1.1 Binding for DSKPP

5.2.1.  Introduction

   This section presents a binding version of DSKPP: the previous messages to HTTP/1.1
   [RFC2616].  Note that
      ClientInfoType and the HTTP client normally will ServerInfoType (see Section 10).
   o  <Mac>: The MAC MUST be different from present if the DSKPP client, i.e., the HTTP client run will only exist to "proxy"
   DSKPP messages from result in the DSKPP client to
      replacement of an existing symmetric key with a new one (i.e., if
      the DSKPP server.  Likewise,
   on <KeyID> element was present in the HTTP server side, <ClientHello message).  In
      this case, the DSKPP server MAY receive DSKPP PDUs from
   a "front-end" HTTP server.

5.2.2.  Identification of DSKPP Messages

   The MIME-type for all DSKPP messages MUST be

   application/vnd.ietf.keyprov.dskpp+xml

5.2.3.  HTTP Headers

   HTTP proxies MUST NOT cache responses carrying DSKPP messages.  For
   this reason, the following holds:
   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".
   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 as a Last-Modified or ETag
         header.
   There are no other restrictions on HTTP headers, besides the
   requirement prove to set the Content-Type header value according to
   Section 5.2.2.

5.2.4.  HTTP Operations

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

5.2.5.  HTTP Status Codes

   A DSKPP HTTP responder cryptographic module
      that refuses it is authorized to perform a message exchange
   with a replace it.

      The DSKPP HTTP requester SHOULD return a 403 (Forbidden) response.
   In this case, client MUST verify the content MAC if the successful execution
      of the HTTP body is not significant.  In protocol will result in the case replacement of an HTTP error while processing existing
      symmetric key with a newly generated one.  The DSKPP request, client MUST
      terminate the HTTP
   server DSKPP session if the MAC does not verify, and MUST return a 500 (Internal Server Error) response.  This type
      delete any nonces, keys, and/or secrets associated with the failed
      run of error SHOULD be returned for HTTP-related errors detected before
   control is passed to the DSKPP processor, or protocol.
      The MacType's MacAlgorithm attribute MUST, when present, identify
      the DSKPP processor
   reports an internal error (for example, negotiated MAC algorithm.

6.3.  Round-Trip #2: <KeyProvClientNonce> and <KeyProvServerFinished>

6.3.1.  Examples

6.3.1.1.  Example Using Default Encryption

   This message contains the DSKPP XML namespace is
   incorrect, or nonce chosen by the DSKPP schema cannot be located).  If cryptographic module,
   R_C, encrypted by the type 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: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 of a
   DSKPP request cannot be determined, <KeyProvClientNonce> Request

   The components of this message have the DSKPP responder following meaning:

   o  Version: (inherited from the AbstractRequestType type) MUST return a
   400 (Bad request) response.

   In these cases (i.e., when be the HTTP response code is 4xx or 5xx),
      same version as in the
   content of <KeyProvServerHello> message.
   o  <SessionID>: MUST have the HTTP body is not significant.

   Redirection status codes (3xx) apply same value as usual.

   Whenever the HTTP POST is successfully invoked, SessionID attribute
      in the DSKPP HTTP
   responder received <KeyProvServerHello> message.
   o  <EncryptedNonce>: The nonce generated and encrypted by the
      cryptographic module.  The encryption MUST use be made using the 200 status code
      selected encryption algorithm and provide a suitable DSKPP
   message (possibly with DSKPP error information included) identified key, and as specified
      in the HTTP
   body.

5.2.6.  HTTP Authentication

   No support for HTTP/1.1 Section 5.1.

   o  <AuthenticationData>: The authentication data value MUST be set as
      specified in Section 5.3 and Section 6.2.2.4.
   o  <Extensions>: A list of extensions.  Two extensions are defined
      for this message in this version of DSKPP: the ClientInfoType and
      the ServerInfoType (see Section 10)

6.3.3.  Components of a <KeyProvServerFinished> Response

   This message is assumed.

5.2.7.  Initialization the last message of DSKPP

   The DSKPP server MAY initialize the DSKPP protocol by sending an HTTP
   response with Content-Type set according to Section 5.2.2 and run.  In a
   4-pass exchange, the DSKPP server sends this message in response code set to 200 (OK).  This a
   <KeyProvClientNonce> message, whereas in a 2-pass exchange, the DSKPP
   server sends this message MAY, e.g., be sent in response to a user requesting key initialization in <KeyProvClientHello>
   message.  In a browsing
   session. 1-pass exchange, the DSKPP server sends only this
   message to the client.  The initialization components of this message MAY carry data have the
   following meaning:

   o  Version: (inherited from the AbstractResponseType type) The DSKPP
      version used in its body.  If 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 the case, Status, SessionID, and Version attributes will
      be present (the presence of the data 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 as a valid instance of a
   <DSKPPTrigger> element.

5.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 "Commit" message,
      instructing the cryptographic module 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 of a 2- or 1-pass exchange) and configuration data.
      The default container format is based on the KeyContainerType type
      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 PSKC, as defined in XML form (supported version, supported
       algorithms...)

   c.  Initial response from [PSKC].
   o  <Extensions>: A list of extensions chosen 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> server.
      For this message, this version of DSKPP data defines one extension, the
      ClientInfoType (see Section 10).
   o  <Mac>: To avoid a false "Commit" message causing the cryptographic
      module to end up in XML form (server random nonce, an initialized state for which the server public does
      not know the stored key,
       ...)

6. <KeyProvServerFinished> messages MUST
      always be authenticated with a MAC.  The MAC MUST be made using
      the already established MAC algorithm.
      When receiving a <KeyProvServerFinished> message with
      Status="Success" for which the MAC verifies, the DSKPP Schema

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

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

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

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

   <xs:complexType name="AbstractResponseType" abstract="true">
     <xs:attribute name="Version" type="VersionType" use="required"/>
     <xs:attribute name="SessionID" type="IdentifierType"/>
     <xs:attribute name="Status" type="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="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="AlgorithmType"/>
     </xs:sequence>
   </xs:complexType>

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

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

   <xs:complexType name="TwoPassSupportType">
     <xs:sequence maxOccurs="unbounded">
       <xs:element name="SupportedKeyInitializationMethod"
         type="xs:anyURI"/>
       <xs:element name="Payload" minOccurs="0"/>
     </xs:sequence>
   </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:sequence>
       <xs:element name="ClientID" type="dskpp:IdentifierType"
         minOccurs="0"/>
       <xs:choice minOccurs="0">
         <xs:element name="AuthenticationCode"
           type="dskpp:AuthenticationCodeType"/>
         <xs:element name="AuthenticationCodeDigest"
           type="dskpp:AuthenticationCodeDigestType"/>
         <xs:element name="AuthenticationCodeMac"
           type="dskpp:AuthenticationCodeMacType"/>
         <xs:element name="AuthenticationCertificate"
           type="ds:KeyInfoType"/>
       </xs:choice>
     </xs:sequence>
   </xs:complexType>
   <xs:simpleType name="AuthenticationCodeType">
     <xs:restriction base="xs:string">
       <xs:maxLength value="20"/>
     </xs:restriction>
   </xs:simpleType>

   <xs:complexType name="AuthenticationCodeDigestType">
     <xs:simpleContent>
       <xs:extension base="xs:base64Binary">
         <xs:attribute name="HashAlgorithm" type="xs:anyURI"
           use="required"/>
       </xs:extension>
     </xs:simpleContent>
   </xs:complexType>

   <xs:complexType name="AuthenticationCodeMacType">
     <xs:sequence>
       <xs:element name="Data" type="xs:base64Binary">
       <xs:element name="Nonce" type="dskpp:NonceType"/>
     </xs:sequence>
     <attribute name="HMACAlgorithm" type="xs:anyURI"
       use="required"/>
     <attribute name="NonceId" type="dskpp:IdentifierType"/>
   </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="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:choice>
       <xs:element name="KeyContainer"
         type="pskc:KeyContainerType"/>
       <xs:element name="##other" processContents="strict"/>
     </xs:choice>
   </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="DSKPP_URL" type="xs:anyURI" minOccurs="0"/>
       <xs:any namespace="##other" processContents="strict"
         minOccurs="0"/>
     </xs:sequence>
   </xs:complexType>

   <!-- Extension client MUST
      associate the generated key K_TOKEN with the provided key
      identifier and store this data permanently.  After this operation,
      it MUST NOT be possible to overwrite the key unless knowledge of
      an authorizing key is proven through a MAC on a later
      <KeyProvServerHello> (and <KeyProvServerFinished>) message.

      The DSKPP client MUST verify the MAC.  The DSKPP client MUST
      terminate the DSKPP session if the MAC does not verify, and MUST,
      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
      the negotiated MAC algorithm.

6.4.  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 is not "Success" or "Continue", the default behavior, unless
   explicitly stated otherwise below, is that both the DSKPP server and
   the DSKPP client MUST immediately terminate the 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 runs for replay
   detection purposes, but such retained identifiers MUST NOT be reused
   for subsequent runs of the protocol.

   When possible, the DSKPP client SHOULD present an appropriate error
   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 a
      subsequent request from the DSKPP client.  It cannot be sent in
      the server's final message.
   o  "Success" indicates successful completion of the DSKPP session.
      It can only be sent in the server's final message.
   o  "Abort" indicates that the DSKPP server rejected the DSKPP
      client's request for unspecified reasons.
   o  "AccessDenied" indicates that the DSKPP client is not authorized
      to contact this DSKPP server.
   o  "MalformedRequest" indicates that the DSKPP server failed to parse
      the DSKPP client's request.
   o  "UnknownRequest" indicates that the DSKPP client made a request
      that is unknown to the DSKPP server.
   o  "UnknownCriticalExtension" indicates that a critical DSKPP
      extension (see below) used by the DSKPP client was not supported
      or recognized by the DSKPP server.
   o  "UnsupportedVersion" indicates that the DSKPP client used a DSKPP
      protocol version not supported by the DSKPP server.  This error is
      only valid in the DSKPP server's first response message.
   o  "NoSupportedKeyTypes" indicates that the DSKPP client only
      suggested key types that are not supported by the DSKPP server.
      This error is only valid in the DSKPP server's first response
      message.

   o  "NoSupportedEncryptionAlgorithms" indicates that the DSKPP client
      only suggested encryption algorithms that are not 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 only
      suggested MAC algorithms that are not supported by the DSKPP
      server.  This error is only valid in the DSKPP server's first
      response message.
   o  "NoProtocolVariants" indicates that the DSKPP client only
      suggested a protocol variant (either 2-pass or 4-pass) that is not
      supported by the DSKPP server.  This error is only valid in the
      DSKPP server's first response messagei
   o  "NoSupportedKeyContainers" indicates that the DSKPP client only
      suggested key container formats that are not supported by the
      DSKPP server.  This error is only valid in 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
      supplied user or device authentication data that the DSKPP server
      failed to validate.
   o  "InitializationFailed" indicates that the DSKPP server could not
      generate a valid key given the provided data.  When this status
      code is received, the DSKPP client SHOULD try to restart DSKPP, as
      it is possible that a new run will succeed.
   o  "ProvisioningPeriodExpired" indicates that the provisioning period
      set by the DSKPP server has expired.  When the status code is
      received, the DSKPP client SHOULD report the key initialization
      failure reason to the user and the user MUST register with 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 DSKPP exchanges.  The examples are
   written using XML.  While they are syntactically correct, MAC and
   cipher values are fictitious.

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

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 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 to protect the
   K_TOKEN, and the server responds 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 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 is set in clear text when it is sent over a
   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: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 of this protocol the client supports.  Only
      version one ("1.0") is currently specified.
   o  <DeviceIdentifierData>: An identifier for the cryptographic module
      as defined in Section 5.3 above.  The identifier MUST only be
      present if 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 that will be overwritten if the
      protocol run is successful.  The identifier MUST only be present
      if the key exists or 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  <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 the <KeyID> element is present.
   o  <TriggerNonce>: This OPTIONAL element MUST be present if and only
      if the DSKPP run was initialized with a <KeyProvTrigger> message
      (see Section 12.2.7 below), 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 and that
      any device or key identifier values provided in the
      <KeyProvTrigger> message match the corresponding identifier values
      in the <KeyProvClientHello> message.
   o  <SupportedKeyTypes>: A sequence of URIs indicating the key types
      for which the cryptographic module is willing to generate keys
      through DSKPP.
   o  <SupportedEncryptionAlgorithms>: A sequence of URIs indicating the
      encryption algorithms supported by the cryptographic module for
      the purposes of DSKPP.  The DSKPP client MAY indicate the same
      algorithm both as a supported key type and as an encryption
      algorithm.
   o  <SupportedMacAlgorithms>: A sequence of URIs indicating the MAC
      algorithms supported by the cryptographic module for the purposes
      of DSKPP.  The DSKPP client MAY indicate 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 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 set to nonce R in the <KeyProvClientHello> message unless
      <TriggerNonce> is already present.
   o  <SupportedKeyContainers>: This OPTIONAL element is a sequence of
      URIs indicating the key container formats supported by the DSKPP
      client.  If this element is not provided, then the DSKPP server
      MUST proceed with
      "urn:ietf:params:xml:schema:keyprov:container#KeyContainer" (see
      [PSKC].
   o  <AuthenticationData>: This OPTIONAL element contains data that the
      DSKPP client uses to authenticate the user or device to the DSKPP
      server.  The element is set as specified in Section 5.3.
   o  <Extensions>: A sequence of extensions.  One extension is defined
      for this message in this version of DSKPP: the ClientInfoType (see
      Section 10).

7.2.3.  Components of a <KeyProvServerFinished> Response

   This message is the last message of the DSKPP protocol run.  In a
   4-pass exchange, the DSKPP server sends this message in response to a
   <KeyProvClientNonce> message, whereas in a 2-pass exchange, the DSKPP
   server sends this message in response to a <KeyProvClientHello>
   message.  In a 1-pass exchange, the DSKPP server sends only this
   message to the client.  The components of this message have the
   following meaning:

   o  Version: (inherited from the AbstractResponseType type) The DSKPP
      version 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 the Status, SessionID, 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 as a "Commit" message,
      instructing the cryptographic module 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 of a 2- or 1-pass exchange) and configuration data.
      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, the
      ClientInfoType (see Section 10).
   o  <Mac>: To avoid a false "Commit" message causing the cryptographic
      module to end up in an initialized state for which the server does
      not know the stored key, <KeyProvServerFinished> messages MUST
      always be authenticated with a MAC.  The MAC MUST be made using
      the already established MAC algorithm.
   o  <AuthenticationData>: This OPTIONAL element contains data that
      allows the DSKPP client to authenticate the DSKPP server.  The MAC
      value is calculated with K_MAC' as specified in Section 4.4.3.
      When receiving a <KeyProvServerFinished> message with
      Status="Success" for which the MAC verifies, the DSKPP client MUST
      associate the generated key K_TOKEN with the provided key
      identifier and store this data permanently.  After this operation,
      it MUST not be possible to overwrite the key unless knowledge of
      an authorizing key is proven through a MAC on a later
      <KeyProvServerHello> (and <KeyProvServerFinished>) message.
      The DSKPP client MUST verify the MAC.  The DSKPP client MUST
      terminate the DSKPP session if the MAC does not verify, and MUST,
      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
      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 is not "Success" or "Continue", the default behavior, unless
   explicitly stated otherwise below, is that both the DSKPP server and
   the DSKPP client MUST immediately terminate the 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 runs for replay
   detection purposes, but such retained identifiers MUST not be reused
   for subsequent runs of the protocol.

   When possible, the DSKPP client SHOULD present an appropriate error
   message to the user.

   These status codes are valid in all DSKPP Response messages unless
   explicitly stated otherwise:
   o  "Continue" indicates that the DSKPP server is ready for a
      subsequent request from the DSKPP client.  It cannot be sent in
      the server's final message.
   o  "Success" indicates successful completion of the DSKPP session.
      It can only be sent in the server's final message.
   o  "Abort" indicates that the DSKPP server rejected the DSKPP
      client's request for unspecified reasons.
   o  "AccessDenied" indicates that the DSKPP client is not authorized
      to contact this DSKPP server.
   o  "MalformedRequest" indicates that the DSKPP server failed to parse
      the DSKPP client's request.
   o  "UnknownRequest" indicates that the DSKPP client made a request
      that is unknown to the DSKPP server.
   o  "UnknownCriticalExtension" indicates that a critical DSKPP
      extension (see below) used by the DSKPP client was not supported
      or recognized by the DSKPP server.
   o  "UnsupportedVersion" indicates that the DSKPP client used a DSKPP
      protocol version not supported by the DSKPP server.  This error is
      only valid in the DSKPP server's first response message.
   o  "NoSupportedKeyTypes" indicates that the DSKPP client only
      suggested key types -->
   <xs:complexType name="ExtensionsType">
     <xs:sequence maxOccurs="unbounded">
       <xs:element name="Extension" type="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="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="AbstractExtensionType">
         <xs:sequence>
           <xs:element name="Data"
             type="xs:base64Binary"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="KeyInitializationDataType">
     <xs:annotation>
       <xs:documentation xml:lang="en"> that are not supported by the DSKPP server.
      This error is only valid in the DSKPP server's first response
      message.
   o  "NoSupportedEncryptionAlgorithms" indicates that the DSKPP client
      only suggested encryption algorithms that are not supported by the
      DSKPP server.  This error is only valid in the DSKPP server's
      first response message.  Note that the error will only occur if
      the DSKPP server does not support any of the DSKPP client's
      suggested encryption algorithms.

   o  "NoSupportedMacAlgorithms" indicates that the DSKPP client only
      suggested MAC algorithms that are not supported by the DSKPP
      server.  This error is only valid in the DSKPP server's first
      response message.  Note that the error will only occur if the
      DSKPP server does not support any of the DSKPP client's suggested
      MAC algorithms.
   o  "NoProtocolVariants" indicates that the DSKPP client only
      suggested a protocol variant (either 2-pass or 4-pass) that is not
      supported by the DSKPP server.  This error is only valid in the
      DSKPP server's first response message.  Note that the error will
      only occur if the DSKPP server does not support any of the DSKPP
      client's suggested protocol variants.
   o  "NoSupportedKeyContainers" indicates that the DSKPP client only
      suggested key container formats that are not supported by the
      DSKPP server.  This extension error is only valid in ServerFinished PDUs. It
         contains the DSKPP server's
      first response message.  Note that the error will only occur if
      the DSKPP server does not support any of the DSKPP client's
      suggested key initialization container formats.
   o  "AuthenticationDataMissing" indicates that the DSKPP client didn't
      provide authentication data and its presence results in that the DSKPP server required.
   o  "AuthenticationDataInvalid" indicates that the DSKPP client
      supplied user or device authentication data that the DSKPP server
      failed to validate.
   o  "InitializationFailed" indicates that the DSKPP server could not
      generate a
         two-pass (or one-pass, if no ClientHello was sent) valid key given the provided data.  When this status
      code is received, the 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"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <!-- client SHOULD try to restart DSKPP, as
      it is possible that a new run will succeed.
   o  "ProvisioningPeriodExpired" indicates that the provisioning period
      set by the DSKPP PDUs -->

   <!-- server has expired.  When the status code is
      received, the DSKPP trigger -->
   <xs:element name="DSKPPTrigger" type="DSKPPTriggerType"/>

   <xs:complexType name="DSKPPTriggerType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Message client SHOULD report the key initialization
      failure reason to the user and the user MUST register with the
      DSKPP server to initialize a new key.

8.  One-Pass Protocol

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

8.1.  XML Basics

   The DSKPP XML schema can be found in Section 13.  Some DSKPP elements
   rely on the device parties being able to initiate compare received values with stored
   values.  Unless otherwise noted, all elements in this document that
   have the XML Schema "xs:string" type, or a
         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>

   <!-- ClientHello PDU -->
   <xs:element name="ClientHello" type="ClientHelloPDU"/>

   <xs:complexType name="ClientHelloPDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Message sent type derived from it, MUST
   be compared using an exact binary comparison.  In particular, DSKPP client
   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 server implementations MUST NOT depend on
   specific sorting orders for values.

8.2.  Server to initiate Client Only: <KeyProvServerFinished>

8.2.1.  Example

   The Server sends a provisioned key to a client with prior knowledge
   about 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 of a <KeyProvServerFinished> Response

   This message is the last message of the DSKPP session.

       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="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"/>
           <xs:element name="TriggerNonce" type="dskpp:NonceType"
             minOccurs="0"/>
           <xs:element name="SupportedKeyTypes"
             type="dskpp:AlgorithmsType"/>
           <xs:element name="SupportedEncryptionAlgorithms"
             type="dskpp:AlgorithmsType"/>
           <xs:element name="SupportedMACAlgorithms"
             type="dskpp:AlgorithmsType"/>
           <xs:element name="SupportedProtocolVariants"
             type="dskpp:ProtocolVariantsType" minOccurs="0"/>
           <xs:element name="SupportedKeyContainers"
             type="dskpp:KeyContainersFormatType" minOccurs="0"/>
           <xs:element name="AuthenticationData"
             type="dskpp:AuthenticationDataType" minOccurs="0"/>
           <xs:element name="Extensions" type="dskpp:ExtensionsType"
             minOccurs="0"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <!-- ServerHello PDU -->
   <xs:element name="ServerHello" type="ServerHelloPDU"/>

   <xs:complexType name="ServerHelloPDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Message sent from DSKPP server to protocol run.  In a
   4-pass exchange, the DSKPP client server sends this message in response to a received ClientHello PDU.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="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>

   <!-- ClientNonce PDU -->
   <xs:element name="ClientNonce" type="ClientNoncePDU"/>

   <xs:complexType name="ClientNoncePDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Second message sent from DSKPP client to
         DSKPP server
   <KeyProvClientNonce> message, whereas in a 2-pass exchange, the DSKPP session.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="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>

   <!-- ServerFinished PDU -->
   <xs:element name="ServerFinished" type="ServerFinishedPDU"/>

   <xs:complexType name="ServerFinishedPDU">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         Final
   server sends this message sent from in response to a <KeyProvClientHello>
   message.  In a 1-pass exchange, the DSKPP server sends only this
   message to the client.  The components of this message have the
   following meaning:

   o  Version: (inherited from the AbstractResponseType type) The DSKPP client
      version used in a DSKPP this session.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="AbstractResponseType">
         <xs:sequence minOccurs="0">
           <xs:element name="KeyContainer"
             type="dskpp:KeyContainerType"/>
           <xs:element name="Extensions"
             type="dskpp:ExtensionsType" minOccurs="0"/>
           <xs:element name="Mac"
             type="dskpp:MacType"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

 </xs:schema>

7.  Security Considerations

7.1.  General

   DSKPP is designed to protect generated key material
   o  SessionID: (inherited from exposure.
   No other entities than the DSKPP server and 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 the Status, SessionID, 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 as a "Commit" message,
      instructing the cryptographic module
   will have access to a store the generated K_TOKEN if key
      and associate the cryptographic
   algorithms used are of sufficient strength and, on given key identifier with this key.
   o  <KeyContainer>: The key container containing symmetric key values
      (in the DSKPP client
   side, generation and encryption of R_C and generation case of K_TOKEN take
   place as specified a 2- or 1-pass exchange) and in the cryptographic module.  This applies
   even if malicious software configuration data.
      The default container format is present in based on the DSKPP client.  However, KeyContainerType type
      from PSKC, as discussed defined in [PSKC].
   o  <Extensions>: A list of extensions chosen by the following, DSKPP does not protect against certain
   other threats resulting from man-in-the-middle attacks and other
   forms server.
      For this message, this version 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 are
   not suitable in those situations.

7.2.  Active Attacks

7.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 material.  Section 7.2.2 through defines one extension, the
      ClientInfoType (see Section 7.2.7.

7.2.2.  Message Modifications

   Modifications to 10).
   o  <Mac>: To avoid a <DSKPPPTrigger> false "Commit" message will either cause denial-
   of-service (modifications of any of causing the cryptographic
      module to end up in an initialized state for which the identifiers or server does
      not know the nonce) or stored key, <KeyProvServerFinished> messages MUST
      always be authenticated with a MAC.  The MAC MUST be made using
      the already established MAC algorithm.
   o  <AuthenticationData>: This OPTIONAL element contains data that
      allows the DSKPP client to contact authenticate the wrong DSKPP server.  The latter MAC
      value is calculated with K_MAC' as specified in
   effect Section 4.5.3.
      When receiving a man-in-the-middle attack <KeyProvServerFinished> message with
      Status="Success" for which the MAC verifies, the DSKPP client MUST
      associate the generated key K_TOKEN with the provided key
      identifier and store this data permanently.  After this operation,
      it MUST not be possible to overwrite the key unless knowledge of
      an authorizing key is discussed further in
   Section 7.2.7.

   An attacker may modify proven through a <ClientHello> message.  This means that the
   attacker could indicate MAC on a different key or device than later
      <KeyProvServerHello> (and <KeyProvServerFinished>) message.
      The DSKPP client MUST verify the one
   intended by MAC.  The DSKPP client MUST
      terminate the DSKPP client, session if the MAC does not verify, and could MUST,
      in this case, also suggest other
   cryptographic algorithms than delete any nonces, keys, and/or secrets
      associated with the ones preferred by failed run of the DSKPP client,
   e.g., cryptographically weaker ones. protocol.
      The attacker could also suggest
   earlier versions of MacType's MacAlgorithm attribute MUST, when present, identify
      the DSKPP protocol, in case these versions have
   been shown to have vulnerabilities.  These modifications could lead
   to negotiated MAC algorithm.

9.  Trigger

   In this section, an attacker succeeding example is used to describe parameters, encoding
   and semantics in initializing or modifying another
   cryptographic module than the one intended (i.e., the server
   assigning a DSKPP Trigger message.  The example is written
   using XML.

9.1.  XML Basics

   The DSKPP XML schema can be found in Section 13.  Some DSKPP elements
   rely on the generated key parties being able to compare received values with stored
   values.  Unless otherwise noted, all elements in this document that
   have the wrong module), XML Schema "xs:string" type, or gaining access
   to a generated key through the use of weak cryptographic algorithms
   or protocol versions. type derived from it, MUST
   be compared using an exact binary comparison.  In particular, DSKPP
   implementations MAY protect against the
   latter by having strict policies about what versions and algorithms
   they support and accept.  The former threat (assignment 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
   generated key to comparison method that
   returns the wrong module) is not possible when same result as converting both values to the shared-
   key variant of DSKPP is employed (assuming existing shared keys are
   unique per cryptographic module), but 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 possible in the public-key
   variant.
   defined.  Therefore, DSKPP servers implementations MUST NOT accept unilaterally
   provided device identifiers in 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 the public-key variant.  This is also
   indicated in <KeyProvTrigger> Message

   The DSKPP server MAY initialize the DSKPP protocol description.  In the shared-key variant,
   however, an attacker may by sending a
   <KeyProvTrigger> message.  This message MAY, e.g., be able to provide the wrong identifier
   (possibly also leading to the incorrect sent in
   response to a user being associated with
   the generated key) if requesting key initialization in a browsing
   session.

   The <KeyProvTrigger> element is intended for the attacker has real-time access to DSKPP client and MAY
   inform the
   cryptographic module with DSKPP client about the identified key.  In other words, identifier for the
   generated key is associated with device that
   houses the correct cryptographic module but
   the module is associated with to be initialized, and optionally of
   the incorrect user.  See further
   Section 7.5 identifier for a discussion of this threat and possible
   countermeasures.

   An attacker may also modify a <ServerHello> message.  This means that the attacker could indicate different key types, algorithms, or
   protocol versions than the legitimate server would, e.g.,
   cryptographically weaker ones. on that module.  The attacker could also provide latter would apply to
   key renewal.  The trigger always contains a
   different nonce than the one sent by the legitimate server.  Clients
   will protect against to allow the former through strict adherence DSKPP
   server to policies
   regarding permissible algorithms and protocol versions.  The latter
   (wrong nonce) will not constitute a security problem, as couple the trigger with a generated
   key will not match later DSKPP <KeyProvClientHello>
   request.  Finally, the key generated on trigger MAY contain a URL to use when
   contacting the legitimate DSKPP server.  Also,
   whenever  The <xs:any> elements are for future
   extensibility.  Any provided <DeviceIdentifierData> or <KeyID> values
   MUST be used by the DSKPP run would result client in the replacement of an existing
   key, the <Mac> subsequent
   <KeyProvClientHello> request.  The OPTIONAL <TokenPlatformInfo>
   element protects against modifications of R_S.

   Modifications informs the DSKPP client about the characteristics of <ClientNonce> messages are also possible.  If an
   attacker modifies the SessionID attribute, then,
   intended cryptographic module platform, and applies in the public-key
   variant of DSKPP in situations when the client potentially needs to
   decide which one of several modules to initialize.

10.  Extensibility

10.1.  The ClientInfoType Type

   present in effect, a switch
   to another session will occur at <KeyProvClientHello> or a <KeyProvClientNonce> message,
   the server, assuming OPTIONAL ClientInfoType extension contains DSKPP client-specific
   information.  DSKPP servers MUST support this extension.  DSKPP
   servers MUST NOT attempt to interpret the new
   SessionID is valid at that time on data it carries and, if
   received, MUST include it unmodified in the server.  It still will current protocol run's
   next server response.  Servers need not
   allow retain the attacker to learn a generated K_TOKEN since R_C ClientInfoType's
   data after that response has been
   wrapped for the legitimate server.  Modifications of generated.

10.2.  The ServerInfoType Type

   When present, the
   <EncryptedNonce> element, e.g., replacing it with a value OPTIONAL ServerInfoType extension contains DSKPP
   server-specific information.  This extension is only valid in
   <KeyProvServerHello> messages for which Status = "Continue".  DSKPP
   clients MUST support this extension.  DSKPP clients MUST NOT attempt
   to interpret the attacker knows an underlying R'C, will not result data it carries and, if received, MUST include it
   unmodified in the current protocol run's next client
   changing its pre-DSKPP state, since request (i.e.,
   the server will <KeyProvClientNonce> message).  DSKPP clients need not retain the
   ServerInfoType's data after that request has been generated.  This
   extension MAY be unable to
   provide a valid MAC used, e.g., for state management in its final message to the client. DSKPP
   server.

10.3.  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 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 as
   key initialization method-dependent payload data.

   Servers MAY include this could constitute extension in a security problem.  For <KeyProvServerFinished>
   message that is being sent in response to a further discussion
   about this threat, received
   <KeyProvClientHello> message if and a possible countermeasure, see Section 7.5
   below.  Note that use of Secure Socket Layer (SSL) or TLS does not
   protect against this attack only if that <KeyProvClientHello>
   message selected TwoPassSupport as the attacker has access to ProtocolVariantType and the DSKPP
   client (e.g., through malicious software, "trojans").

   Finally, attackers may also modify the <ServerFinished> message.
   Replacing indicated support for the <Mac> element will only result selected key initialization method.
   Servers MUST include this extension in denial-of-service.
   Replacement a <KeyProvServerFinished>
   message that is sent as part of any other element may cause a 1-pass DSKPP.

   The elements of this type have the DSKPP client to
   associate, e.g., following meaning:

   o  <KeyInitializationMethod>: A two-pass key initialization method
      supported by the wrong service DSKPP client.
   o  <Payload>: A payload associated with the generated key.  DSKPP
   SHOULD be run over a transport providing privacy and integrity when
   this key initialization
      method.  Since the syntax is a concern.

7.2.3.  Message Deletion

   Message deletion will not cause shorthand for <xs:element
      name="Payload" type="xs:anyType"/>, 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 well-formed payloads can
      be carried in this element.

11.  Key Initialization Profiles of Two- and successfully has processed that
   message, including validation One-Pass DSKPP

11.1.  Introduction

   This appendix introduces three profiles of DSKPP for key
   initialization.  They MAY all be used for two- as well as one-pass
   initialization of its MAC.  A deleted <ServerFinished>
   message will not cause cryptographic modules.  Further profiles MAY be
   defined by external entities or through the server to end up in an inconsistent state
   vis-a-vis IETF process.

11.2.  Key Transport Profile

11.2.1.  Introduction

   This profile initializes the cryptographic module if the server implements the
   suggestions in Section 7.5.

7.2.4.  Message Insertion

   An active attacker may initiate with a DSKPP run at any time, symmetric
   key, K_TOKEN, through key transport and suggest
   any device identifier.  DSKPP server implementations MAY receive some
   protection against inadvertently initializing a key or inadvertently
   replacing an existing derivation.  The key or assigning
   transport is carried out using a public key, K_CLIENT, whose private
   key to a part resides in the cryptographic module by initializing as the DSKPP run by use of transport key.  A
   key K from which two keys, K_TOKEN and K_MAC are derived MUST be
   transported.

11.2.2.  Identification

   This profile MUST be identified with the <DSKPPTrigger>.
   The <TriggerNonce> element allows following URN:

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

11.2.3.  Payloads

   In the server to associate a DSKPP
   protocol run with, e.g., an earlier user-authenticated session.  The
   security two-pass version of 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 DSKPP, the
   legitimate user for client MUST send a payload
   associated with this key initialization.  DSKPP over a transport
   providing privacy initialization method.  The payload MUST be
   of type ds:KeyInfoType ([XMLDSIG]), and integrity, coupled with only those choices of the recommendations in
   Section 7.5, ds:
   KeyInfoType that identify a public key are allowed.  The ds:
   X509Certificate option of the ds:X509Data alternative is RECOMMENDED
   when this is a concern.

   Insertion of other messages into an existing protocol run is seen as
   equivalent the public key corresponding to modification the private key on the
   cryptographic module has been certified.

   The server payload associated with this key initialization method
   MUST be of legitimately sent messages.

7.2.5.  Message Replay

   During 4-pass DSKPP, attempts to replay type xenc:EncryptedKeyType ([XMLENC]), and only those
   encryption methods utilizing a previously recorded public key that are supported by the
   DSKPP client (as indicated in the <SupportedEncryptionAlgorithms>
   element of the <KeyProvClientHello> message will be detected, in the case of 2-pass
   DSKPP, or as otherwise known in the use case of nonces ensures that both
   parties 1-pass DSKPP) are live.  For example, a DSKPP client knows that a server it
   is communicating with is "live" since allowed
   as values for the server <xenc:EncryptionMethod> element.  Further, in the
   case of 2-pass DSKPP, the <ds:KeyInfo> element MUST create a MAC on
   information sent by contain the client.

   The same is true for 2-pass DSKPP thanks to
   value (i.e. identify the requirement that same public key) as the
   client sends R <Payload> of the
   corresponding supported key initialization method in the <ClientHello>
   <KeyProvClientHello> message and that triggered the server
   includes R in response.  The
   <CarriedKeyName> element MAY be present, but MUST, when present,
   contain the MAC computation.

   In 1-pass DSKPP clients that record same value as the latest I used by a particular
   server (as identified by ID_S) will <KeyID> element of the
   <KeyProvServerFinished> message.  The Type attribute of the xenc:
   EncryptedKeyType MUST be able to detect replays.

7.2.6.  Message Reordering

   An attacker may attempt to re-order 4-pass DSKPP messages but this
   will present and MUST identify the type of the
   wrapped key.  The type MUST be detected, as each message is one of a unique type.  Note: Message
   re-ordering attacks cannot occur in 2- and 1-pass the types supported by the
   DSKPP since each
   party sends at most one client (as reported in the <SupportedKeyTypes> of the preceding
   <KeyProvClientHello> message each.

7.2.7.  Man-in-the-Middle

   In addition to other active attacks, an attacker posing in the case of 2-pass DSKPP, or as a man
   otherwise known in the middle may be able to provide his own public case of 1-pass DSKPP).  The transported key to the DSKPP
   client.  This threat
   MUST consist of two parts of equal length.  The first half
   constitutes K_MAC and countermeasures to it are discussed in
   Section 4.2.  An attacker posing as a man-in-the-middle may the second half constitutes K_TOKEN.  The
   length of K_TOKEN (and hence also be
   acting as a proxy and, hence, may not interfere with DSKPP runs but
   still learn valuable information; see Section 7.3.

7.3.  Passive Attacks

   Passive attackers may eavesdrop on DSKPP runs to learn information
   that later on may be used to impersonate users, mount active attacks,
   etc.

   If DSKPP the length of K_MAC) is not run over a transport providing privacy, a passive
   attacker may learn:
   o  What determined
   by the type of K_TOKEN.

   DSKPP servers and cryptographic modules a particular user is supporting this profile MUST
   support the http://www.w3.org/2001/04/xmlenc#rsa-1_5 key-wrapping
   mechanism defined in possession of;
   o  The identifiers [XMLENC].

   When this profile is used, the MacAlgorithm attribute of keys on those crypotgraphic modules the <Mac>
   element of the <KeyProvServerFinished> message MUST be present and other
      attributes pertaining to those keys, e.g.,
   MUST identify the lifetime selected MAC algorithm.  The selected MAC algorithm
   MUST be one of the
      keys; and
   o  DSKPP versions and cryptographic MAC algorithms supported by a
      particular the DSKPP client (as
   indicated in the <SupportedMacAlgorithms> element of the
   <KeyProvClientHello> message in the case of 2-pass DSKPP, or server.
   Whenever as
   otherwise known in the above is a concer, DSKPP SHOULD case of 1-pass DSKPP).  The MAC MUST be run over a transport
   providing privacy.  If man-in-the-middle attacks
   calculated as described in Section 4.4 for Two-Pass DSKPP and
   Section 4.5 for One-Pass DSKPP.

   In addition, DSKPP servers MUST include the purposes
   described above are AuthenticationDataType
   element in their <KeyProvServerFinished> messages whenever a concern, the transport SHOULD also offer
   server-side authentication.

7.4.  Cryptographic Attacks

   An attacker with unlimited access to
   successful protocol run will result in an initialized existing K_TOKEN being
   replaced.

11.3.  Key Wrap Profile

11.3.1.  Introduction

   This profile initializes the cryptographic module may use 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 as an "oracle" to pre-compute values that
   later on may be used to impersonate and the DSKPP server.  Section 4.7  A
   key K from which two keys, K_TOKEN and Section 4.10 contain discussions K_MAC are derived MUST be
   wrapped.

11.3.2.  Identification

   This profile MUST be identified with the following URI:

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

11.3.3.  Payloads

   In the 2-pass version of this threat and steps
   RECOMMENDED to protect against it.

7.5.  Attacks on DSKPP, the Interaction between DSKPP and User Authentication

   If keys generated in DSKPP will be client MUST send a payload
   associated with a particular user
   at this key initialization method.  The payload MUST be
   of type ds:KeyInfoType ([XMLDSIG]), and only those choices of the DSKPP server (or ds:
   KeyInfoType that identify a symmetric key are allowed.  The ds:
   KeyName alternative is RECOMMENDED.

   The server trusted by, and communicating payload associated with this key initialization method
   MUST be of type xenc:EncryptedKeyType ([XMLENC]), and only those
   encryption methods utilizing a symmetric key that are supported by
   the DSKPP server), then client (as indicated in order to protect against threats where an
   attacker replaces a client-provided encrypted R_C with his own R'C
   (regardless the <SupportedEncryptionAlgorithms>
   element of whether the public-key variant or <KeyProvClientHello> message in the shared-secret
   variant case of DSKPP is employed to encrypt the client nonce), 2-pass
   DSKPP, or as otherwise known in the server
   SHOULD not commit to associate a generated K_TOKEN with case of 1-pass DSKPP) are allowed
   as values for the given
   cryptographic module until <xenc:EncryptionMethod> element.  Further, in the user simultaneously has proven both
   possession
   case of 2-pass DSKPP, the device that hosts <ds:KeyInfo> element MUST contain the cryptographic module
   containing K_TOKEN and some out-of-band provided authenticating
   information (e.g., a temporary password).  For example, if same
   value (i.e. identify the
   cryptographic module is a one-time password token, same symmetric key) as the user could be
   required to authenticate with both a one-time password generated by <Payload> of the cryptographic module and an out-of-band provided temporary PIN
   corresponding supported key initialization method in
   order to have the server "commit" to
   <KeyProvClientHello> message that triggered the generated OTP response.  The
   <CarriedKeyName> element MAY be present, and MUST, when present,
   contain the same value for as the
   given user.  Preferably, <KeyID> element of the user SHOULD perform this operation from
   another host than
   <KeyProvServerFinished> message.  The Type attribute of the xenc:
   EncryptedKeyType MUST be present and MUST identify the type of the
   wrapped key.  The type MUST be one used to initialize keys on of the
   cryptographic module, types supported by the
   DSKPP client (as reported in order to minimize the risk <SupportedKeyTypes> of malicious
   software on the client interfering with preceding
   <KeyProvClientHello> message in the process.

   Note: This scenario, wherein case of 2-pass DSKPP, or as
   otherwise known in the attacker replaces a client-provided
   R_C with his own R'C, does not apply to 2- and case of 1-pass DSKPP as DSKPP).  The wrapped key MUST
   consist of two parts of equal length.  The first half constitutes
   K_MAC and the
   client does not provide any entropy to second half constitutes K_TOKEN.  The attack as such length of K_TOKEN
   (and its countermeasures) still applies to 2- and 1-pass DSKPP,
   however, as it essentially hence also the length of K_MAC) is a man-in-the-middle attack.

   Another threat arises when an attacker determined by the type of
   K_TOKEN.

   DSKPP servers 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 able to trick a user to
   authenticate to used, the attacker rather than to MacAlgorithm attribute of the legitimate service
   before <Mac>
   element of the DSKPP protocol run.  If successful, <KeyProvServerFinished> message MUST be present and
   MUST identify the attacker will then selected MAC algorithm.  The selected MAC algorithm
   MUST be able to impersonate one of the user towards MAC algorithms supported by the legitimate service, and
   subsequently receive a valid DSKPP trigger.  If client (as
   indicated in the <SupportedMacAlgorithms> element of the
   <KeyProvClientHello> message in the case of 2-pass DSKPP, or as
   otherwise known in the case of 1-pass DSKPP).  The MAC MUST be
   calculated as described in Section 4.4.

   In addition, DSKPP servers MUST include the public-key
   variant of DSKPP is used, this may result AuthenticationDataType
   element in the attacker being able
   to (after their <KeyProvServerFinished> messages whenever a
   successful DSKPP protocol run) impersonate the user.
   Ordinary precautions MUST, therefore, be run will result in place to ensure that
   users authenticate only to legitimate services.

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

7.6.1.  Client Contributions to an existing K_TOKEN Entropy

   In 4-pass DSKPP, both being
   replaced.

11.4.  Passphrase-Based Key Wrap Profile

11.4.1.  Introduction

   This profile is a variation of the client and key wrap profile.  It initializes
   the server provide randomizing
   material to K_TOKEN , in cryptographic module with a manner that allows symmetric key, K_TOKEN, through key
   wrap and key derivation, using a passphrase-derived key-wrapping key,
   K_DERIVED.  The passphrase is known in advance by both parties to verify
   that they did contribute to the resulting key.  In the 1- device
   user and 2-pass
   DSKPP versions defined herein, only the server contributes to DSKPP server.  To preserve the
   entropy property of K_TOKEN.  This means that a broken or compromised
   (pseudo-)random number generator in not exposing
   K_TOKEN to any other entity than the DSKPP server may cause more damage
   than it would in and the 4-pass variant.  Server implementations
   cryptographic module itself, the method SHOULD
   therefore take extreme care to ensure that this situation does not
   occur.

7.6.2.  Key Confirmation

   4-pass DSKPP servers provide key confirmation through be employed only when
   the MAC on R_C
   in device contains facilities (e.g. a keypad) for direct entry of
   the passphrase.  A key K from which two keys, K_TOKEN and K_MAC are
   derived MUST be wrapped.

11.4.2.  Identification

   This profile MUST be identified with the <ServerFinished> message. following URI:

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

11.4.3.  Payloads

   In the 1- and 2-pass DSKPP variants
   described herein, key confirmation is provided by the MAC including I
   (in version of DSKPP, the 1-pass case) or R (2-pass case), using K_MAC.

7.6.3.  Server Authentication

   DSKPP servers client MUST authenticate themselves whenever a successful
   DSKPP 1- or 2-pass protocol run would result in an existing K_TOKEN
   being replaced by a K_TOKEN', or else a denial-of-service attack
   where an unauthorized DSKPP server replaces send a K_TOKEN payload
   associated with another this key would initialization method.  The payload MUST be possible.  In 1-
   of type ds:KeyInfoType ([XMLDSIG]).  The ds:KeyName option MUST be
   used and 2-pass DSKPP, servers authenticate
   by including the AuthenticationDataType extension containing a MAC as
   described in Section 4.8 above.

7.6.4.  Client Authentication

   A DSKPP server key name MUST authenticate a client to ensure that K_TOKEN is
   delivered to identify the intended device.  The following measures SHOULD passphrase that will be
   considered:

   o  When a device certificate is used for client authentication,
   by the
      DSKPP server SHOULD follow standard certificate verification
      processes to ensure that it is a trusted device.
   o  When generate the key-wrapping key.  As an Authentication Code is used for client authentication, a
      password dictionary attack on example, the authentication data is possible.
      When
   identifier could be a secure channel, e.g., SSL user identifier or TLS, is established between a registration identifier
   issued by the server to the user during a session preceding the DSKPP client
   protocol run.

   The server payload associated with this key initialization method
   MUST be of type xenc:EncryptedKeyType ([XMLENC]), and server, an attacker could successfully brute-
      force guess an Authentication Code, allowing him only those
   encryption methods utilizing a passphrase to illegitimately
      receive K_TOKEN.
   o  The length derive the key-wrapping
   key that are supported by the DSKPP client (as indicated in the
   <SupportedEncryptionAlgorithms> element of the Authentication Code when used over a non-
      secure channel SHOULD be longer than what is used over a secure
      channel.  When a device, e.g., some mobile phones with small
      screens, cannot handle a long Authentication Code <KeyProvClientHello>
   message in a user-
      friendly manner, DSKPP SHOULD rely on a secure channel the case of 2-pass DSKPP, or as otherwise known in the
   case of 1-pass DSKPP) are allowed as values for
      communication.
   o  In the <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
   initialization method in the <KeyProvClientHello> message that a non-secure channel has to be used,
   triggered the
      Authentication Code SHOULD response.  The <CarriedKeyName> element MAY be sent to present,
   and MUST, when present, contain the server MAC's with a
      DSKPP server's nonce value. same value as the <KeyID> element
   of the <KeyProvServerFinished> message.  The Authentication Code Type attribute of the
   xenc:EncryptedKeyType MUST be present and nonce
      value MUST identify the type of
   the wrapped key.  The type MUST be strong enough to prevent offline brute-force
      recovery one of the Authentication Code from types supported by the HMAC data.  Because
   DSKPP client (as reported in the nonce value is almost public across a non-secure channel, <SupportedKeyTypes> of the preceding
   <KeyProvClientHello> message in the case of 2-pass DSKPP, or as
   otherwise known in the case of 1-pass DSKPP).  The wrapped key strength 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
   (and hence also the length of K_MAC) is dependent on determined by the Authentication Code.

7.6.5.  Key Protection 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]), the Passphrase Profile

   The PBKDF2 passphrase-based key wrap profile uses the PBKDF2 derivation function from
   also defined in [PKCS-5] to generate an encryption key from a passphrase (and identified as
   http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbkdf2 in
   [PKCS-5-XML]), and salt
   string.  The derived key, K_DERIVED the http://www.w3.org/2001/04/xmlenc#kw-aes128
   key-wrapping mechanism defined in [XMLENC].

   When this profile is used by used, the server to encrypt
   K_TOKEN MacAlgorithm attribute of the <Mac>
   element of the <KeyProvServerFinished> message MUST be present and by
   MUST identify the cryptographic module to decrypt selected MAC algorithm.  The selected MAC algorithm
   MUST be one of the newly
   delivered K_TOKEN.  It is important to note that passphrase-based
   encryption is generally limited in MAC algorithms supported by the security that it provides
   despite DSKPP client (as
   indicated in the use <SupportedMacAlgorithms> element of salt and iteration count the
   <KeyProvClientHello> message in PBKDF2 to increase the
   complexity case of attack.  Implementations SHOULD therefore take
   additional measures to strengthen 2-pass DSKPP, or as
   otherwise known in the security case of the passphrase-
   based key wrap profile.  The following measures SHOULD be considered
   where applicable:

   o 1-pass DSKPP).  The passphrase SHOULD MAC MUST be selected well, and usage guidelines such
   calculated as described in Section 4.4.

   In addition, DSKPP servers MUST include the ones AuthenticationDataType
   element in [NIST-PWD] SHOULD be taken into account.
   o  A different passphrase SHOULD be used for every key initialization
      wherever possible (the use of 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 global passphrase reliable transport.

12.2.  HTTP/1.1 Binding for DSKPP

12.2.1.  Introduction

   This section presents a batch binding of
      cryptographic modules SHOULD the previous messages to HTTP/1.1
   [RFC2616].  Note that the HTTP client normally will be avoided, for example).  One way different from
   the DSKPP client, i.e., the HTTP client will only exist to
      achieve this is "proxy"
   DSKPP messages from the DSKPP client to use randomly-generated passphrases.
   o  The passphrase SHOULD be protected well if stored the DSKPP server.  Likewise,
   on the HTTP server
      and/or on side, the cryptographic module and SHOULD DSKPP server MAY receive DSKPP PDUs from
   a "front-end" HTTP server.

12.2.2.  Identification of DSKPP Messages

   The MIME-type for all DSKPP messages MUST be delivered to

   application/vnd.ietf.keyprov.dskpp+xml

12.2.3.  HTTP Headers

   HTTP proxies MUST NOT cache responses carrying DSKPP messages.  For
   this reason, the
      device's user using secure methods. following holds:
   o  User pre-authentication SHOULD be implemented to ensure that
      K_TOKEN is not delivered  When using HTTP/1.1, requesters SHOULD:
      *  Include a Cache-Control header field set to "no-cache, no-
         store".
      *  Include a rogue recipient.
   o  The iteration count in PBKDF2 SHOULD be high Pragma header field set to impose more work
      for an attacker "no-cache".
   o  When using brute-force methods (see [PKCS-5] for
      recommendations).  However, it MUST be noted that the higher the
      count, the more work is required 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 as a Last-Modified or ETag
         header.
   There are no other restrictions on HTTP headers, besides the legitimate cryptographic
      module
   requirement to decrypt set the newly delivered K_TOKEN.  Servers MAY use
      relatively low iteration counts Content-Type header value according to accommodate devices with
      limited processing power such
   Section 12.2.2.

12.2.4.  HTTP Operations

   Persistent connections as some PDA and cell phones when
      other security measures defined in HTTP/1.1 are implemented and 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, the security content of the
      passphrase-based key wrap method HTTP body is not weakened.
   o  Transport level security (e.g.  TLS) SHOULD be used where possible
      to protect significant.  In
   the case of an HTTP error while processing a 2-pass or 1-pass protocol run.  Transport level
      security provides DSKPP request, the HTTP
   server MUST return a second layer 500 (Internal Server Error) response.  This type
   of protection error SHOULD be returned for HTTP-related errors detected before
   control is passed to the newly
      generated K_TOKEN.

8.  IANA Considerations

   This document calls for registration of new URNs within DSKPP processor, or when the IETF sub-
   namespace per RFC3553 [RFC3553].  The following URNs are RECOMMENDED:
   o DSKPP XML schema: "urn:ietf:params:xml:schema:keyprov:protocol"
   o processor
   reports an internal error (for example, the DSKPP XML namespace: "urn:ietf:params:xml:ns:keyprov:protocol"

9.  Intellectual Property Considerations

   RSA and RSA Security are registered trademarks namespace is
   incorrect, or trademarks the DSKPP schema cannot be located).  If the type of RSA
   Security Inc. in a
   DSKPP 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 5xx), the United States and/or other countries.  The names
   content of other products the HTTP body is not significant.

   Redirection status codes (3xx) apply as usual.

   Whenever the HTTP POST is successfully invoked, the DSKPP HTTP
   responder MUST use the 200 status code and services mentioned may be provide a suitable DSKPP
   message (possibly with DSKPP error information included) in the trademarks HTTP
   body.

12.2.6.  HTTP Authentication

   No support for HTTP/1.1 authentication is assumed.

12.2.7.  Initialization of
   their respective owners.

10.  Acknowledgements DSKPP

   The authors would like to thank all DSKPP server MAY initialize the members of OATH [OATH] and
   participants of OTPS workshops for their review DSKPP protocol by sending an HTTP
   response with Content-Type set according to Section 12.2.2 and comments related
   response code set to 200 (OK).  This message MAY, e.g., be sent in
   response to a user requesting key initialization in a browsing
   session.  The initialization message MAY carry data in its body.  If
   this document.

11.  References

11.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/>.

11.2.  Informative references

   [CT-KIP-P11]
              RSA Laboratories, "PKCS #11 Mechanisms for is 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 case, the data MUST be a valid instance of 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 a
   <KeyProvTrigger> element.

12.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 data 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>

   <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 name="FourPass" minOccurs="0"/>
       <xs:element name="TwoPass" type="dskpp:TwoPassSupportType"
         minOccurs="0"/>
       <xs:element name="OnePass" minOccurs="0"/>
     </xs:sequence>
   </xs:complexType>

   <xs:complexType name="TwoPassSupportType">
     <xs:sequence maxOccurs="unbounded">
       <xs:element name="SupportedKeyInitializationMethod"
         type="xs:anyURI"/>
       <xs:element name="Payload" minOccurs="0"/>
     </xs:sequence>
   </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 can consist of Standards and Technology,
              "Specification either authentication code
         for authenticating a user of the Advanced Encryption Standard
              (AES)", FIPS 197, November 2001, <http://csrc.nist.gov/
              publications/fips/fips197/fips-197.pdf>.

   [FSE2003]  Iwata, T. protocol, or an X.509 Certificate for
         authenticating a device. When a device certificate is used over a
         transport layer that is not secure, the Signature is calculated over
         a nonce value specified in ds:Signature/Object. When used in
         conjunction with the KeyProvServerFinished PDU, it contains a MAC
         authenticating the DSKPP server to the client.
       </xs:documentation>
     </xs:annotation>
     <xs:sequence>
       <xs:element 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>
     </xs:sequence>
   </xs:complexType>

   <xs:complexType name="AuthenticationCodeMacType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         An authentication MAC calculated from an authentication code 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
         optionally server information as well as nonce value if they are
         available.
       </xs:documentation>
     </xs:annotation>
     <xs:sequence>
       <xs:element name="Nonce" type="dskpp:NonceType" minOccurs="0"/>
       <xs:element 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"/>
         </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 in KeyProvServerFinished PDUs. It
         contains key initialization data 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 its presence results in a
         two-pass (or one-pass, if no KeyProvClientHello 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 to trigger the device to initiate a
         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 sent from DSKPP client to DSKPP server to initiate a
         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"/>
           <xs:element name="TriggerNonce" type="dskpp:NonceType"
             minOccurs="0"/>
           <xs:element name="SupportedKeyTypes"
             type="dskpp:AlgorithmsType"/>
           <xs:element name="SupportedEncryptionAlgorithms"
             type="dskpp:AlgorithmsType"/>
           <xs:element name="SupportedMacAlgorithms"
             type="dskpp:AlgorithmsType"/>
           <xs:element name="SupportedProtocolVariants"
             type="dskpp:ProtocolVariantsType" minOccurs="0"/>
           <xs:element name="SupportedKeyContainers"
             type="dskpp:KeyContainersFormatType" minOccurs="0"/>
           <xs:element name="AuthenticationData"
             type="dskpp:AuthenticationDataType" minOccurs="0"/>
           <xs:element name="Extensions" type="dskpp:ExtensionsType"
             minOccurs="0"/>
         </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 from DSKPP server to DSKPP client
         in response to 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 to
         DSKPP server in a 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 DSKPP server to DSKPP client in a DSKPP
         session. A MAC value serves 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., key confirmation, and R. Canetti, "HMAC: Keyed-
              Hashing for Message Authentication", RFC 2104,
              February 1997.

   [RFC2119]  "Key words optional
         AuthenticationData servers for use in RFCs server authentication.
       </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
       <xs:extension base="dskpp:AbstractResponseType">
         <xs:sequence minOccurs="0">
           <xs:element name="KeyContainer"
             type="dskpp:KeyContainerType"/>
           <xs:element name="Extensions"
             type="dskpp:ExtensionsType" minOccurs="0"/>
           <xs:element name="Mac"
             type="dskpp:MacType"/>
           <xs:element name="AuthenticationData"
             type="dskpp:AuthenticationDataType" minOccurs="0"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

 </xs:schema>

14.  Security Considerations

14.1.  General

   DSKPP is designed 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., protect generated key material from exposure.
   No other entities than the DSKPP server and T. Berners-Lee, "Hypertext
              Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999,
              <http://www.ietf.org/rfc/rfc2616.txt>.

   [RFC3553]  Mealling, M., Masinter, L., Hardie, T., the cryptographic module
   will have access to a generated K_TOKEN if the cryptographic
   algorithms used are of sufficient strength and, on the DSKPP client
   side, generation and G. Klyne, "An
              IETF URN Sub-namespace for Registered Protocol
              Parameters", RFC 3553, BCP 73, June 2003.

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

Appendix A.  Key Initialization Profiles R_C and generation of DSKPP

A.1.  Introduction K_TOKEN take
   place as specified in the cryptographic module.  This appendix introduces three profiles applies even if
   malicious software is present in the DSKPP client.  However, as
   discussed in the following, DSKPP does not protect against certain
   other threats resulting from man-in-the-middle attacks and other
   forms of attacks.  DSKPP for 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
   initialization.  They exchanges are
   not suitable in those situations.

14.2.  Active Attacks

14.2.1.  Introduction

   An active attacker MAY all be used attempt to modify, delete, insert, replay, or
   reorder messages for two- as well as one-pass
   initialization a variety of purposes including service denial
   and compromise of generated key material.  Section 14.2.2 through
   Section 14.2.7.

14.2.2.  Message Modifications

   Modifications to a <DSKPPTrigger> message will either cause denial-
   of-service (modifications of any of the identifiers or the nonce) or
   will cause the DSKPP client to contact the wrong DSKPP server.  The
   latter is in effect a man-in-the-middle attack and is discussed
   further in Section 14.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 DSKPP client, and could also suggest other
   cryptographic modules.  Further profiles MAY be
   defined algorithms than the ones preferred by external entities or through the IETF process.

A.2.  Key Transport Profile

A.2.1.  Introduction

   This profile initializes DSKPP client,
   e.g., cryptographically weaker ones.  The attacker could also suggest
   earlier versions 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 with than the one intended (i.e., the server
   assigning the generated key to the wrong module), or gaining access
   to a symmetric
   key, K_TOKEN, through generated key transport through the use of weak cryptographic algorithms
   or protocol versions.  DSKPP implementations MAY protect against the
   latter by having strict policies about what versions and key derivation. algorithms
   they support and accept.  The key
   transport is carried out using former threat (assignment of a public key, K_CLIENT, whose private
   generated key part resides in to the cryptographic module as wrong module) is not possible when the transport key.  A shared-
   key K from which two keys, K_TOKEN and K_MAC variant of DSKPP is employed (assuming existing shared keys are derived
   unique per cryptographic module), but is possible in the public-key
   variant.  Therefore, DSKPP servers MUST be
   transported.

A.2.2.  Identification NOT accept unilaterally
   provided device identifiers in the public-key variant.  This profile MUST be identified with is also
   indicated in the following URN:

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

A.2.3.  Payloads protocol description.  In the two-pass version of DSKPP, shared-key variant,
   however, an attacker may be able to provide the client MUST send a payload wrong identifier
   (possibly also leading to the incorrect user being associated with this key initialization method.  The payload MUST be
   of type ds:KeyInfoType ([XMLDSIG]), and only those choices of the ds:
   KeyInfoType that identify a public key are allowed.  The ds:
   X509Certificate option of
   the ds:X509Data alternative is RECOMMENDED
   when generated key) if the public key corresponding attacker has real-time access to the private
   cryptographic module with the identified key.  In other words, the
   generated key on is associated with the correct cryptographic module has been certified.

   The server payload but
   the module is associated with this key initialization method
   MUST be the incorrect user.  See further
   Section 14.5 for a discussion of type xenc:EncryptedKeyType ([XMLENC]), this threat and only those
   encryption methods utilizing possible
   countermeasures.

   An attacker may also modify a public key <KeyProvServerHello> message.  This
   means that are supported by the
   DSKPP client (as indicated in the <SupportedEncryptionAlgorithms>
   element of the <ClientHello> message in the case of 2-pass DSKPP, attacker could indicate different key types,
   algorithms, or
   as otherwise known in the case of 1-pass DSKPP) are allowed as values
   for the <xenc:EncryptionMethod> element.  Further, in protocol versions than the case of
   2-pass DSKPP, legitimate server would,
   e.g., cryptographically weaker ones.  The attacker may also provide a
   different nonce than the <ds:KeyInfo> element MUST contain one sent by the same value
   (i.e. identify legitimate server.  Clients
   MAY protect against the same public key) former through strict adherence to policies
   regarding permissible algorithms and protocol versions.  The latter
   (wrong nonce) will not constitute a security problem, as the <Payload> of the
   corresponding supported a generated
   key initialization method in will not match the
   <ClientHello> message that triggered key generated on the response.  The
   <CarriedKeyName> element MAY be present, but MUST, when present,
   contain legitimate server.  Also,
   whenever the same value as DSKPP run would result in the <KeyID> element replacement of an existing
   key, the <ServerFinished>
   message.  The Type attribute <Mac> element protects against modifications of R_S.

   Modifications of <KeyProvClientNonce> messages are also possible.  If
   an attacker modifies the xenc:EncryptedKeyType MUST be
   present and MUST identify SessionID attribute, then, in effect, a
   switch to another session will occur at the type of server, assuming the wrapped key.  The type MUST
   be one of new
   SessionID is valid at that time on the types supported by server.  It still will not
   allow the DSKPP client (as reported in attacker to learn a generated K_TOKEN since R_C has been
   wrapped for the
   <SupportedKeyTypes> legitimate server.  Modifications of the preceding <ClientHello> message
   <EncryptedNonce> element, e.g., replacing it with a value for which
   the attacker knows an underlying R'C, will not result in the
   case of 2-pass DSKPP, or as otherwise known client
   changing its pre-DSKPP state, since the server will be unable to
   provide a valid MAC in its final message to the case of 1-pass
   DSKPP).  The transported key MUST consist of two parts of equal
   length. client.  The first half constitutes K_MAC and the second half
   constitutes server
   MAY, however, end up storing K'TOKEN rather than K_TOKEN.  The length of K_TOKEN (and hence also the
   length of K_MAC) is determined by  If the type of K_TOKEN.

   DSKPP servers and
   cryptographic modules supporting module has been associated with a particular user, then
   this could constitute a security problem.  For a further discussion
   about this threat, and a possible countermeasure, see Section 14.5
   below.  Note that use of Secure Socket Layer (SSL) or TLS does not
   protect against this profile MUST
   support attack if the http://www.w3.org/2001/04/xmlenc#rsa-1_5 key-wrapping
   mechanism defined in [XMLENC].

   When this profile is used, attacker has access to the MacAlgorithm attribute of DSKPP
   client (e.g., through malicious software, "trojans").

   Finally, attackers may also modify the <KeyProvServerFinished>
   message.  Replacing the <Mac> element will only result in denial-of-
   service.  Replacement of any other element may cause the <ServerFinished> message MUST DSKPP client
   to associate, e.g., the wrong service with the generated key.  DSKPP
   SHOULD be present run over a transport providing privacy and integrity when
   this 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
   identify the selected MAC algorithm.  The selected MAC algorithm MUST
   be one of NOT change its state
   (i.e., "commit" to a generated key) until it receives the MAC algorithms supported by final
   message from the DSKPP client (as
   indicated in the <SupportedMACAlgorithms> element server and successfully has processed that
   message, including validation of the
   <ClientHello> its MAC.  A deleted
   <KeyProvServerFinished> message in the case of 2-pass DSKPP, or as otherwise
   known in the case of 1-pass DSKPP).  The MAC MUST be calculated as
   described in Section 4.8

   In addition, DSKPP servers MUST include the AuthenticationDataType
   element (see further Section 4.8) in their <ServerFinished> messages
   whenever a successful protocol run will result not cause the server to end up
   in an existing K_TOKEN
   being replaced.

A.3.  Key wrap profile

A.3.1.  Introduction

   This profile initializes inconsistent state vis-a-vis the cryptographic module with if the
   server implements 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 symmetric
   key, K_TOKEN, through key wrap and or inadvertently
   replacing an existing key derivation.  The or assigning a key wrap MUST
   be carried out using to a (symmetric) key-wrapping key, K_SHARED, known
   in advance by both the cryptographic
   module and by initializing the DSKPP server.  A
   key K from which two keys, K_TOKEN and K_MAC are derived MUST be
   wrapped.

A.3.2.  Identification

   This profile MUST be identified with the following URI:

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

A.3.3.  Payloads

   In the 2-pass version run by use of DSKPP, the client MUST send a payload
   associated with this key initialization method. <KeyProvTrigger>.
   The payload MUST be
   of type ds:KeyInfoType ([XMLDSIG]), and only those choices of <TriggerNonce> element allows the ds:
   KeyInfoType that identify server to associate a symmetric key are allowed.  The ds:
   KeyName alternative is RECOMMENDED. DSKPP
   protocol run with, e.g., an earlier user-authenticated session.  The server payload associated with this key initialization method
   MUST be
   security of type xenc:EncryptedKeyType ([XMLENC]), and only those
   encryption methods utilizing a symmetric key that are supported by this method, therefore, depends on the DSKPP client (as indicated in ability to protect
   the <SupportedEncryptionAlgorithms> <TriggerNonce> element of the <ClientHello> message in the case of 2-pass DSKPP, or
   as otherwise known in DSKPP initialization message.  If
   an eavesdropper is able to capture this message, he may race the case of 1-pass DSKPP) are allowed as values
   legitimate user for a key initialization.  DSKPP over a transport
   providing privacy and integrity, coupled with the <xenc:EncryptionMethod> element.  Further, recommendations in the case
   Section 14.5, is RECOMMENDED when this is a concern.

   Insertion of
   2-pass DSKPP, the <ds:KeyInfo> element MUST contain the same value
   (i.e. identify the same symmetric key) other messages into an existing protocol run is seen as the <Payload>
   equivalent to modification of the
   corresponding supported key initialization method in the
   <ClientHello> legitimately sent messages.

14.2.5.  Message Replay

   During 4-pass DSKPP, attempts to replay a previously recorded DSKPP
   message that triggered the response.  The
   <CarriedKeyName> element MAY will be present, and MUST, when present,
   contain the same value detected, as the <KeyID> element of the <ServerFinished>
   message.  The Type attribute 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 xenc:EncryptedKeyType MUST be
   present and server MUST identify the type of create a MAC on
   information sent by the wrapped key. client.

   The type MUST
   be one of same is true for 2-pass DSKPP thanks to the types supported by requirement that the DSKPP
   client (as reported sends R in the
   <SupportedKeyTypes> of the preceding <ClientHello> <KeyProvClientHello> message in and that the
   case of 2-pass DSKPP, or as otherwise known
   server includes R in the case of MAC computation.

   In 1-pass
   DSKPP).  The wrapped key MUST consist of two parts of equal length.
   The first half constitutes K_MAC and DSKPP clients that record the second half constitutes
   K_TOKEN.  The length 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 DSKPP messages but this
   will be detected, as each message is of K_TOKEN (and hence also a unique type.  Note: Message
   re-ordering attacks cannot occur in 2- and 1-pass DSKPP since each
   party sends at most one message each.

14.2.7.  Man-in-the-Middle

   In addition to other active attacks, an attacker posing as a man in
   the length of K_MAC)
   is determined by middle may be able to provide his own public key to the type of K_TOKEN.

   DSKP servers DSKPP
   client.  This threat and countermeasures to it are discussed in
   Section 4.3.  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 14.3.

14.3.  Passive Attacks

   Passive attackers may eavesdrop on DSKPP runs to 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 supporting this profile MUST
   support the http://www.w3.org/2001/04/xmlenc#kw-aes128 key-wrapping
   mechanism defined in [XMLENC].

   When this profile a particular user is used, the MacAlgorithm attribute of the <Mac>
   element in possession of;
   o  The identifiers of the <ServerFinished> message MUST be present keys on those cryptographic modules and MUST
   identify other
      attributes pertaining to those keys, e.g., the selected MAC algorithm.  The selected MAC algorithm MUST
   be one lifetime of the MAC
      keys; and
   o  DSKPP versions and cryptographic algorithms supported by the a
      particular DSKPP client (as
   indicated in the <SupportedMACAlgorithms> element of the
   <ClientHello> message in the case of 2-pass DSKPP, or as otherwise
   known in the case of 1-pass DSKPP).  The MAC MUST be calculated as
   described in Section 4.8

   In addition, DSKPP servers MUST include server.
   Whenever the AuthenticationDataType
   element (see further Section 4.8) in their <ServerFinished> messages
   whenever above is a successful protocol concern, DSKPP SHOULD be run will result in an existing K_TOKEN
   being replaced.

A.4.  Passphrase-based key wrap profile

A.4.1.  Introduction

   This profile is over a variation of the key wrap profile.  It initializes transport
   providing privacy.  If man-in-the-middle attacks for the purposes
   described above are a concern, the transport SHOULD also offer
   server-side authentication.

14.4.  Cryptographic Attacks

   An attacker with unlimited access to an initialized cryptographic
   module with a symmetric key, K_TOKEN, through key
   wrap and key derivation, using a passphrase-derived key-wrapping key,
   K_DERIVED.  The passphrase is known in advance by both may use the device
   user and module as an "oracle" to pre-compute values that
   later on may be used to impersonate the DSKPP server.  To preserve the property  Section 5.2
   and Section 4 contain discussions of not exposing
   K_TOKEN this threat and steps
   RECOMMENDED to any other entity than protect against it.

14.5.  Attacks on the Interaction between DSKPP server and the
   cryptographic module itself, the method SHOULD User Authentication

   If keys generated in DSKPP will be employed only when
   the device contains facilities (e.g. associated with a keypad) for direct entry of particular user
   at the passphrase.  A key K from which two keys, K_TOKEN DSKPP server (or a server trusted by, and K_MAC are
   derived MUST be wrapped.

A.4.2.  Identification

   This profile MUST be identified communicating with
   the following URI:

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

A.4.3.  Payloads

   In DSKPP server), then 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 2-pass version public-key variant or the shared-secret
   variant of DSKPP, DSKPP is employed to encrypt the client MUST send nonce), the server
   SHOULD not commit to associate a payload
   associated generated K_TOKEN with this key initialization method.  The payload MUST be
   of type ds:KeyInfoType ([XMLDSIG]).  The ds:KeyName option MUST be
   used and the key name MUST identify given
   cryptographic module until the passphrase that will be used
   by user simultaneously has proven both
   possession of the server to generate device that hosts the key-wrapping key.  As an cryptographic module
   containing K_TOKEN and some out-of-band provided authenticating
   information (e.g., a temporary password).  For example, if the
   identifier could be a user identifier or
   cryptographic module is a registration identifier
   issued by the server to one-time password token, the user during a session preceding the DSKPP
   protocol run.

   The server payload associated with this key initialization method
   MUST could be of type xenc:EncryptedKeyType ([XMLENC]), and only those
   encryption methods utilizing a passphrase
   required to derive the key-wrapping
   key that are supported authenticate with both a one-time password generated by
   the DSKPP client (as indicated in the
   <SupportedEncryptionAlgorithms> element of the <ClientHello> message cryptographic module and an out-of-band provided temporary PIN in
   order to have the case of 2-pass DSKPP, or as otherwise known in server "commit" to the case of
   1-pass DSKPP) are allowed as values generated OTP value for the <xenc:EncryptionMethod>
   element.  Further, in the case of 2-pass DSKPP,
   given user.  Preferably, the <ds:KeyInfo>
   element MUST contain user SHOULD perform this operation from
   another host than the same value (i.e. identify one used to initialize keys on the same
   passphrase) as
   cryptographic module, in order to minimize the <Payload> risk of malicious
   software on the corresponding supported key
   initialization method in client interfering with the <ClientHello> message that triggered process.

   Note: This scenario, wherein the
   response.  The <CarriedKeyName> element MAY be present, attacker replaces a client-provided
   R_C with his own R'C, does not apply to 2- and MUST,
   when present, contain the same value 1-pass DSKPP as the <KeyID> element of the
   <ServerFinished> message.  The Type attribute of the xenc:
   EncryptedKeyType MUST be present
   client does not provide any entropy to K_TOKEN.  The attack as such
   (and its countermeasures) still applies to 2- and MUST identify the type of 1-pass DSKPP,
   however, as it essentially is a man-in-the-middle attack.

   Another threat arises when an attacker is able to trick a user to
   authenticate to the
   wrapped key.  The type MUST be one of attacker rather than to the types supported by legitimate service
   before the DSKPP client (as reported in the <SupportedKeyTypes> of protocol run.  If successful, the preceding
   <ClientHello> message in attacker will then
   be able to impersonate the case of 2-pass DSKPP, or as otherwise
   known in user towards the case of 1-pass DSKPP).  The wrapped key MUST consist of
   two parts of equal length.  The first half constitutes K_MAC legitimate service, and
   subsequently receive a valid DSKPP trigger.  If the
   second half constitutes K_TOKEN.  The length of K_TOKEN (and hence
   also the length public-key
   variant of K_MAC) DSKPP is determined by used, this may result in the type of K_TOKEN. attacker being able
   to (after a successful DSKPP servers and cryptographic modules supporting this profile MUST
   support protocol run) impersonate the PBES2 password based encryption scheme defined in
   [PKCS-5] (and identified as
   http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2 user.
   Ordinary precautions MUST, therefore, be in
   [PKCS-5-XML]), 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 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]), client and the http://www.w3.org/2001/04/xmlenc#kw-aes128
   key-wrapping mechanism defined server provide randomizing
   material to K_TOKEN , in [XMLENC].

   When this profile is used, the MacAlgorithm attribute of a manner that allows both parties to verify
   that they did contribute to the <Mac>
   element of resulting key.  In the <ServerFinished> message MUST be present 1- and MUST
   identify 2-pass
   DSKPP versions defined herein, only the selected MAC algorithm.  The selected MAC algorithm MUST
   be one of server contributes to the MAC algorithms supported by
   entropy of K_TOKEN.  This means that a broken or compromised
   (pseudo-)random number generator in the DSKPP client (as
   indicated server may cause more damage
   than it would in the <SupportedMACAlgorithms> element of 4-pass variant.  Server implementations SHOULD
   therefore take extreme care to ensure that this situation does not
   occur.

14.6.2.  Key Confirmation

   4-pass DSKPP servers provide key confirmation through the
   <ClientHello> message MAC on R_C
   in the case of <KeyProvServerFinished> message.  In the 1- and 2-pass DSKPP, or as otherwise
   known in DSKPP
   variants described herein, key confirmation is provided by the case of 1-pass DSKPP).  The MAC MUST be calculated as
   described in Section 4.8

   In addition,
   including I (in the 1-pass case) or R (2-pass case), using K_MAC.

14.6.3.  Server Authentication

   DSKPP servers MUST include the AuthenticationDataType
   element (see further Section 4.8) in their <ServerFinished> messages authenticate themselves whenever a successful
   DSKPP 1- or 2-pass protocol run will would result in an existing K_TOKEN
   being replaced.

Appendix B.  Example Messages

   All examples are syntactically correct.  MAC 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 cipher values are
   fictitious however.

B.1.  Example Messages 2-pass DSKPP, servers authenticate
   by including the AuthenticationDataType extension containing a MAC as
   described in Section 4.4 for Two-Pass DSKPP and Section 4.5 for One-
   Pass DSKPP.

14.6.4.  Client Authentication

   A DSKPP server MUST authenticate a Four-pass Exchange client to ensure that K_TOKEN is
   delivered to the intended device.  The examples below illustrate following measures SHOULD be
   considered:
   o  When a complete four-pass device certificate is used for client authentication, the
      DSKPP exchange.

B.1.1.  Example of server SHOULD follow standard certificate verification
      processes to ensure that it is a DSKPP Initialization (Trigger) Message

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:DSKPPTrigger Version="1.0"
     xmlns:dskpp="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:ietf:params:xml:schema:keyprov:protocol">
     <InitializationTrigger>
       <DeviceIdentifierData>
         <pskc:DeviceID>
           <Manufacturer>ManufacturerABC</Manufacturer>
           <SerialNo>XL0000000001234</SerialNo>
           <Model>U2</Model>
         </DeviceID>
       </DeviceIdentifierData>
       <TriggerNonce>112dsdfwf312asder394jw==</TriggerNonce>
     </InitializationTrigger>
   </dskpp:DSKPPTrigger>

B.1.2.  Example of trusted device.
   o  When an Authentication Code is used for client authentication, a <ClientHello> Message

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:ClientHello Version="1.0"
     xmlns:dskpp="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
     <DeviceIdentifierData>
       <pskc:DeviceID>
         <Manufacturer>ManufacturerABC</Manufacturer>
         <SerialNo>XL0000000001234</SerialNo>
         <Model>U2</Model>
       </DeviceID>
     </DeviceIdentifierData>
     <TriggerNonce>112dsdfwf312asder394jw==</TriggerNonce>
     <SupportedKeyTypes>
       <Algorithm>http://www.rsa.com/rsalabs/otps/schemas/2005/09/
         otps-wst#SecurID-AES</Algorithm>
       <Algorithm>http://www.openauthentication.org/OATH/2006/10/PSKC#
         HOTP</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>
     </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
       </KeyContainerFormat>
     </SupportedKeyContainers>
     <AuthenticationData>
       <AuthenticationCode>1erd354657689102abcd</AuthenticationCode>
     </AuthenticationData>
   </dskpp:ClientHello>

B.1.3.  Example
      password dictionary attack on the authentication data is possible.
   o  The length of the Authentication Code when used over a <ServerHello> Message

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:ServerHello Version="1.0" SessionID="4114" Status="Success"
     xmlns:dskpp="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
     <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
     </KeyContainerFormat>
     <Payload>
       <Nonce>qw2ewasde312asder394jw==</Nonce>
     </Payload>
   </dskpp:ServerHello>

B.1.4.  Example of non-secure
      channel SHOULD be longer than what is used over a <ClientNonce> Message

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:ClientNonce Version="1.0" SessionID="4114"
     xmlns:dskpp="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
     <EncryptedNonce>VXENc+Um/9/NvmYKiHDLaErK0gk=</EncryptedNonce>
     <AuthenticationData>
       <AuthenticationCode>1erd354657689102abcd</AuthenticationCode>
     </AuthenticationData>
   </dskpp:ClientNonce>

B.1.5.  Example of secure channel.
      When a <ServerFinished> Message
   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:ServerFinished Version="1.0" SessionID="4114" Status="Success"
     xmlns:dskpp="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:ietf:params:xml:schema:keyprov:protocol">
     <pskc:KeyContainer version="1.0">
       <Device>
         <Secret SecretAlgorithm="other" SecretAlgorithm-ext="SecurID"
           SecretId="XL0000000001234">
           <Issuer>CredentialIssuer</Issuer>
           <Usage otp="true">
             <ResponseFormat format="DECIMAL" length="6"/>
           </Usage>
           <FriendlyName>MyFirstToken</FriendlyName>
           <Data Name="TIME">
             <Value>Time</Value>
           </Data>
           <Expiry>10/30/2009</Expiry>
         </Secret>
       </Device>
     </pskc:KeyContainer>
     <Mac>miidfasde312asder394jw==</Mac>
   </dskpp:ServerFinished>

B.2.  Example Messages device, e.g., some mobile phones with small screens, cannot
      handle a long Authentication Code in a Two- or One-pass Exchange user-friendly manner, DSKPP
      SHOULD rely on a secure channel for communication.
   o  In the case that a non-secure channel has to be used, the
      Authentication Code SHOULD be sent to the server MAC's as
      specified in Section 5.3.  The examples illustrate 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 a complete two-pass non-secure transport, the
      cryptographic strength of the AuthenticationData depends more on
      the quality of the AuthenticationCode.
   o  When the AuthenticationCode is sent from the DSKPP exchange.  The server messages MAY also constitute to the only messages
      device in a one-pass
   DSKPP exchange.

B.2.1.  Example of a <ClientHello> Message Indicating Support for Two-
        pass DSKPP

   The client indicates support both for initialization trigger message, an eavesdropper
      may be able to capture this message and race the two-pass legitimate user
      for a key initialization.  To prevent this, the transport
   variant as well as layer
      used to send the two-pass DSKPP trigger MUST provide privacy and integrity
      e.g. secure browser session.

14.6.5.  Key Protection in the Passphrase Profile

   The passphrase-based key wrap variant.

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:ClientHello Version="1.0"
     xmlns:dskpp="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
     xmlns:pkcs-5=
     "http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5v2-0#">
     <DeviceIdentifierData>
       <pskc:DeviceID>
         <Manufacturer>ManufacturerABC</Manufacturer>
         <SerialNo>XL0000000001234</SerialNo>
         <Model>U2</Model>
       </DeviceID>
     </DeviceIdentifierData>
     <ClientNonce>1523sdfxe798jowie913ol==</ClientNonce>
     <SupportedKeyTypes>
       <Algorithm>
         http://www.rsa.com/rsalabs/otps/schemas/2005/09/otps-wst#
           SecurID-AES
       </Algorithm>
       <Algorithm>
         http://www.openauthentication.org/OATH/2006/10/PSKC#HOTP
       </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>
     </SupportedMACAlgorithms>
       <Algorithm>urn:ietf:params:xml:schema:keyprov:protocol#
         dskpp-prf-aes</Algorithm>
     </SupportedMACAlgorithms>
     <SupportedProtocolVariants>
       <Variant>
         <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>
           <Payload xsi:type="ds:KeyInfoType">
             <ds:X509Data>
               <ds:X509Certificate>miib</ds:X509Certificate>
             </ds:X509Data>
           </Payload>
         </TwoPass>
       </Variant>
     </SupportedProtocolVariants
     <SupportedKeyContainers>
       <KeyContainerFormat>
         urn:ietf:params:xml:schema:keyprov:container
       </KeyContainerFormat>
     </SupportedKeyContainers>
     <AuthenticationData>
       <AuthenticationCode>1erd354657689102abcd</AuthenticationCode>
     </AuthenticationData>
   </dskpp:ClientHello>

B.2.2.  Example of a <ServerFinished> Message Using profile uses the Key Transport
        Profile

   In this example, PBKDF2 function from
   [PKCS-5] to generate an encryption key from a passphrase and salt
   string.  The derived key, K_DERIVED is used by the server responds to encrypt
   K_TOKEN and by the previous request using cryptographic module to decrypt the newly
   delivered K_TOKEN.  It is important to note that passphrase-based
   encryption is generally limited in the security that it provides
   despite the use of salt and iteration count in PBKDF2 to increase the
   complexity of attack.  Implementations SHOULD therefore take
   additional measures to strengthen the security of the passphrase-
   based key wrap profile.  The following measures SHOULD be considered
   where applicable:

   o  The passphrase SHOULD be selected well, 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 transport profile.

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:ServerFinished Version="1.0" SessionID="4114" Status="Success"
     xmlns:dskpp="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
     xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
     <pskc:KeyContainer version="1.0">
       <EncryptionMethod
         algorithm="http://www.w3.org/2001/05/xmlenc#rsa_1_5">
         <EncKeyLabel>43212093<
         <ds:KeyInfo>
           <ds:X509Data>
             <ds:X509Certificate>miib</ds:X509Certificate>
           </ds:X509Data>
         </ds:KeyInfo>
       </EncryptionMethod>
       <Device>
         <Secret SecretAlgorithm="HOTP" SecretId="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>
               9AEDpd4td44mRSASab625oPqlvHHIplzADer+pPOlL118JW/AhIoHB==
             </ValueDigest>
           </Data>
           <Data Name="COUNTER">
             <Value>1</Value>
           </Data>
           <Expiry>10/30/2009</Expiry>
         </Secret>
       </Device>
     </pskc:KeyContainer>
     <Mac MacAlgorithm=
       "urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes">
       miidfasde312asder394jw==
     </Mac>
   </dskpp:ServerFinished>

B.2.3.  Example initialization
      wherever possible (the use of a <ServerFinished> Message Using the Key Wrap Profile

   In global passphrase for a batch of
      cryptographic modules SHOULD be avoided, for example).  One way to
      achieve this example, is to use randomly-generated passphrases.
   o  The passphrase SHOULD be protected well if stored on the server responds
      and/or on the cryptographic module and SHOULD be delivered to the previous request
      device's user using
   the key wrap profile.

   <?xml version="1.0" encoding="UTF-8"?>
   <dskpp:ServerFinished Version="1.0" SessionID="4114" Status="Success"
     xmlns:dskpp="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:ietf:params:xml:schema:keyprov:protocol"
     xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
     xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
     <pskc:KeyContainer version="1.0">
       <EncryptionMethod
         algorithm="http://www.w3.org/2001/05/xmlenc#kw-aes128">
         <EncKeyLabel>43212093</EncKeyLabel>
         <ds:KeyInfo>
           <ds:KeyName>Key-001</ds:KeyName>
         </ds:KeyInfo>
       </EncryptionMethod>
       <Device>
         <Secret SecretAlgorithm="HOTP" SecretId="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>
               9AEDpd4td44mRSASab625oPqlvHHIplzADer+pPOlL118JW/AhIoHB==
             </ValueDigest>
           </Data>
           <Data Name="COUNTER">
             <Value>1</Value>
           </Data>
           <Expiry>10/30/2009</Expiry>
         </Secret>
       </Device>
     </pskc:KeyContainer>
     <Mac MacAlgorithm=
       "urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes">
       miidfasde312asder394jw==
     </Mac>
   </dskpp:ServerFinished>

B.2.4.  Example of secure methods.
   o  User pre-authentication SHOULD be implemented to ensure that
      K_TOKEN is not delivered to a <ServerFinished> Message 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 Passphrase-based
        Key Wrap Profile

   In this example, higher the
      count, the more work is required on the legitimate cryptographic
      module to decrypt the server responds newly delivered K_TOKEN.  Servers MAY use
      relatively low iteration counts to accommodate devices with
      limited processing power such as some PDA and cell phones when
      other security measures are implemented and the previous request using security of the
      passphrase-based key wrap profile.

 <?xml version="1.0" encoding="UTF-8"?>
 <dskpp:ServerFinished Version="1.0" SessionID="4114" Status="Success"
   xmlns:dskpp="urn:ietf:params:xml:schema:keyprov:protocol"
   xmlns:pskc="urn:ietf:params:xml:ns:keyprov:container"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:schema:keyprov:protocol"
   xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
   xmlns:xenc=http://www.w3.org/2001/04/xmlenc#
   xmlns:pkcs-5=
   "http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5v2-0#">
   <pskc:KeyContainer version="1.0">
     <EncryptionMethod algorithm=
         "http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#pbes2">
       <pkcs-5:PBES2-params>
         <KeyDerivationFunc Algorithm=
           "http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#
           pbkdf2">
           <pkcs-5:PBKDF2-params>
             <Salt>
               <Specified>32113435</Specified>
             </Salt>
             <IterationCount>1024</IterationCount>
             <KeyLength>128</KeyLength>
             <PRF/>
           </pkcs-5:PBKDF2-params>
         </KeyDerivationFunc>
         <EncryptionScheme Algorithm=
           "http://www.w3.org/2001/04/xmlenc#kw-aes128-cbc">
         </EncryptionScheme
       </pkcs-5:PBES2-params>
       <EncKeyLabel>43212093</EncKeyLabel>
       <ds:KeyInfo>
         <ds:KeyName>Passphrase1</ds:KeyName>
       </ds:KeyInfo>
     </EncryptionMethod>
     <Device>
       <Secret SecretAlgorithm="HOTP" SecretId="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>
             9AEDpd4td44mRSASab625oPqlvHHIplzADer+pPOlL118JW/AhIoHB==
           </ValueDigest>
         </Data>
         <Data Name="COUNTER">
           <Value>1</Value>
         </Data>
         <Expiry>10/30/2009</Expiry>
       </Secret>
     </Device>
   </pskc:KeyContainer>
   <Mac MacAlgorithm=
     "urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes">
     miidfasde312asder394jw==
   </Mac>
 </dskpp:ServerFinished>

Appendix C.  Requirements

   This section specifies mandatory and desirable protocol requirements.

   Req-1:

      The method is not weakened.
   o  Transport level security (e.g.  TLS) SHOULD be used where possible
      to protect a 2-pass or 1-pass protocol MUST support provisioning run.  Transport level
      security provides a second layer of keys protection for use with
      multiple types of symmetric cryptographic algorithms.

   Req-2:

      The protocol MUST support pre-generated symmetric keys (by
      separate key issuance service) or locally generated keys in real-
      time (by provisioning server).

   Req-3:

      The protocol MUST support mutually the newly
      generated symmetric keys by
      both client and server (i.e., joint key control).

   Req-4:

      The protocol MUST allow cryptographic modules to acquire multiple
      symmetric keys; each key MAY be acquired in a separate
      provisioning session.

   Req-5: K_TOKEN.

15.  Internationalization Considerations

   The DSKPP protocol MUST support renewal is mostly meant for machine-to-machine
   communications; as such, most of a symmetric key with its elements are tokens not meant
   for direct human consumption.  If these tokens are presented to the
      original key ID.

   Req-6:

      The protocol MUST allow clients
   end user, some localization may need to specify their cryptographic
      capabilities occur.  DSKPP exchanges
   information using XML.  All XML processors are required to the server 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 new URNs within the server to indicate the
      cryptography and algorithm types that it will be using.

   Req-7: IETF sub-
   namespace per RFC3553 [RFC3553].  The protocol MUST support mutual authentication 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
      confidentiality RSA Security are registered trademarks or trademarks of sensitive data during provisioning.

   Req-8: RSA
   Security Inc. in the United States and/or other countries.  The protocol MAY use a public-key infrastructure names
   of other products and services mentioned may be the use trademarks of
      client certificates
   their respective owners.

18.  Contributors

   This work is based on information contained in [RFC4758], authored by
   Magnus Nystrom, with enhancements (esp.  Client Authentication, and
   support for device authentication or symmetric multiple key
      data protection.  The protocol MUST allow for other mechanisms,
      such as symmetric key-based techniques, container formats) from an individual
   Internet-Draft co-authored by Mingliang Pei and Salah Machani.

   We would like to be used.

   Req-9:

      The protocol SHOULD NOT only rely on transport layer security.  It
      SHOULD be compatible with transport layer security when available.

   Req-10:

      The protocol SHOULD allow thank Shuh Chang for contributing the server DSKPP object
   model, and Philip Hoyer for his work in aligning DSKPP and PSKC
   schemas.

   We would also like to use pre-loaded symmetric
      transport keys if available on the device that hosts the
      cryptographic module (i.e., smart card update keys, such as used
      by Global Platform thank Hannes Tschofenig for establishing a secure channel).

   Req-11:

      The protocol MUST protect against replay attacks.

   Req-12:

      The protocol MUST protect against MITM attacks.

   Req-13:

      The protocol MAY support a cryptographic module request his draft reviews,
   feedback, and text contributions.

19.  Acknowledgements

   We would like to acquire
      multiple symmetric keys in the same session.

   Req-14:

      The protocol MAY allow thank the provisioning server 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 also like to verify that thank the
      key has been correctly provisioned following for their input to selected
   design aspects of the cryptographic module
      (i.e., key confirmation).

   Req-15:

      The protocol MAY allow a cryptographic module 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 notify thank Robert Griffin for opening
   communication channels for us with the IEEE P1619.3 Key Management
   Group, and facilitating our groups in staying informed of potential
   areas (esp. key provisioning server upon symmetric and global key deletion.

   Req-16:

      The protocol MAY limit a protocol run to complete within a certain
      time window.

   Req-17:

      The protocol MAY support download identifiers of a key to a cryptographic
      module via SMS depending upon whether the application can provide
      an acceptable level
   collaboration) of protection 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 transport of the symmetric
      key.

   The following is a list
              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 features that are not required by 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
   protocol:

   Non-Req-1:

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

   [OATH]     "Initiative for cryptographic module generated symmetric key upload to
      a provisioning server.

   Non-Req-2:

      Support 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 other key lifecycle management functions, such as key
      suspension, lock, 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 activation.  These functions are supported R. Canetti, "HMAC: Keyed-
              Hashing for Message Authentication", RFC 2104,
              February 1997.

   [RFC2119]  "Key words for use in a symmetric key-based application, such as an authentication
      system.

   Non-Req-3:

      Support 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 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 D. Solo, "Internet
              X.509 Public Key Infrastructure Certificate and
              Certificate Revocation List (CRL) Profile", RFC 3280,
              April 2002.

   [RFC3553]  Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An
              IETF URN Sub-namespace for asymmetric key pair provisioning. Registered Protocol
              Parameters", RFC 3553, BCP 73, June 2003.

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

Appendix D. A.  Integration with PKCS #11

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

D.1.

A.1.  The 4-pass Variant

   When performing 4-pass DSKPP with a cryptographic module using the
   PKCS #11 programming interface, the procedure described in
   [CT-KIP-P11], Appendix B, is RECOMMENDED.

D.2.

A.2.  The 2-pass Variant

   A suggested procedure to perform 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_TOKEN | K _MAC (where '|' denotes
           concatenation) is generated, e.g. by calling C_GenerateKey
           (using key type CKK_GENERIC_SECRET).  The template for K 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 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 by two.
       2.  The server wraps K with either the token's public key
           K_CLIENT, the shared secret key K_SHARED, or the derived
           shared secret key K_DERIVED by using C_WrapKey.  If use of
           the DSKPP key wrap algorithm has been 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 nonce R provided by
           the DSKPP client, and the ulSeedLen parameter MUST indicate
           the length of R. The hWrappingKey parameter in the call to
           C_WrapKey MUST be set to refer to the wrapping key.

       3.  Next, the server needs to 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 and the 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 and MUST
           be 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 MUST
           calculate a second MAC.  Again, 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 this call to C_SignInit, the K_MAC
           existing before this DSKPP protocol run MUST be the signature
           key, the hKey parameter in the CK_KIP_PARAMS structure MUST
           be set to NULL, the pSeed parameter of the CT_KIP_PARAMS
           structure MUST be set to NULL_PTR, and the 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 and the nonce R, and the ulDataLen parameter MUST
           be set to the length of concatenated string.  The desired
           length of the MAC MUST be specified through the
           pulSignatureLen parameter 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 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 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 and
           the 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 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.
       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.

D.3.

A.3.  The 1-pass Variant

   A suggested procedure to perform 1-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 server side,
       1.  A generic key K = K_TOKEN | K _MAC (where '|' denotes
           concatenation) is generated, e.g. by calling C_GenerateKey
           (using key type CKK_GENERIC_SECRET).  The template for K 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 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 by two.

       2.  The server wraps K with either the token's public key,
           K_CLIENT, the shared secret key, K_SHARED, or the derived
           shared secret key, K_DERIVED by using C_WrapKey.  If use of
           the DSKPP key wrap algorithm has been 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, and the ulSeedLen
           parameter MUST indicate the length of the octet-string
           representation of I. 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 the server's message to the client, 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 and the octet-string representation of the
           integer I, and the ulDataLen parameter MUST be set to the
           length of 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).
       4.  If the server also needs to authenticate its message (due to
           an existing K_TOKEN being replaced), the server calculates a
           second MAC.  If the DSKPP MAC mechanism is used, the server
           does this by calling C_SignInit with the CKM_KIP_MAC
           mechanism followed by a call to C_Sign.  In the call to
           C_SignInit, the K_MAC existing on the token before this
           protocol run 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 and the octet-string
           representation of the integer I+1 (i.e.  I MUST be
           incremented before each use), 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).
       5.  The server sends its message to the client, including the MAC
           and possibly also the authenticating MAC.
   b.  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 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 and
           the octet-string representation of the provided value for I,
           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 K_TOKEN
           will replace an existing key on the token), it is verified in
           a similar vein but using the K_MAC 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 E. B.  Example of DSKPP-PRF Realizations

E.1.

B.1.  Introduction

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

E.2.

B.2.  DSKPP-PRF-AES

E.2.1.

B.2.1.  Identification

   For cryptographic modules supporting this realization of DSKPP-PRF,
   the following URI MAY be used to identify this algorithm in DSKPP:

   urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-aes

   When this URI is used to identify the encryption algorithm to use,
   the method for encryption of R_C values described in Section 4.7 5.2 MUST
   be used.

E.2.2.

B.2.2.  Definition

   DSKPP-PRF-AES (k, s, dsLen)

   Input:
   k         Encryption keyto 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.

E.2.3.

B.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)

E.3.

B.3.  DSKPP-PRF-SHA256

E.3.1.

B.3.1.  Identification

   For cryptographic modules supporting this realization of DSKPP-PRF,
   the following URI MAY be used to identify this algorithm in DSKPP:

   urn:ietf:params:xml:schema:keyprov:protocol#dskpp-prf-sha256

   When this URI is used to identify the encryption algorithm to use,
   the method for encryption of R_C values described in Section 4.7 5.2 MUST
   be used.

E.3.2.

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

E.3.3.

B.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,
   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 Nystroem Nystrom
   RSA, The Security Division of EMC
   Arenavagen 29
   Stockholm, Stockholm Ln  121 29
   SE

   Email: magnus@rsa.com

   Salah Machani
   Diversinet Corp.

   Email: smachani@diversinet.com mnystrom@rsa.com

Full Copyright Statement

   Copyright (C) The IETF Trust (2007).

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