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

<!--
FILE INFORMATION

OMA Permanent Document
   File: OMA-SUP-XML_LWM2M_Security-V1_0-20131210-C
   Type: xml

Public Reachable Information
   Path: http://www.openmobilealliance.org/tech/profiles
   Name: LWM2M_Security-v1_0.xml

NORMATIVE INFORMATION

  Information about this file can be found in the latest revision of

    OMA-TS-LightweightM2M-V1_0

  This is available at http://www.openmobilealliance.org/

  Send comments to technical-comments@mail.openmobilealliance.org

CHANGE HISTORY

22102013 File created, see OMA-DM-LightweightM2M-2013-0164-INP_LWM2M_Objects_XML_files
31102013 Changed according to OMA-TS-LightweightM2M-V1_0-20131017-D
06112013 Changed according to OMA-TS-LightweightM2M-V1_0-20131105-D
03122013 Incorporated CR OMA-DM-LightweightM2M-2013-0172-CR_SUP_files_schema_reference
10122013 Status changed to Candidate by TP, TP Ref # OMA-TP-2013-0368-INP_LightweightM2M_V1_0_ERP_and_ETR_for_Candidate_approval

	
LEGAL DISCLAIMER

Use of this document is subject to all of the terms and conditions
of the Use Agreement located at
	http://www.openmobilealliance.org/UseAgreement.html

You may use this document or any part of the document for internal
or educational purposes only, provided you do not modify, edit or
take out of context the information in this document in any manner.
Information contained in this document may be used, at your sole
risk, for any purposes.

You may not use this document in any other manner without the prior
written permission of the Open Mobile Alliance.  The Open Mobile
Alliance authorizes you to copy this document, provided that you
retain all copyright and other proprietary notices contained in the
original materials on any copies of the materials and that you
comply strictly with these terms.  This copyright permission does
not constitute an endorsement of the products or services.  The
Open Mobile Alliance assumes no responsibility for errors or
omissions in this document.

Each Open Mobile Alliance member has agreed to use reasonable
endeavors to inform the Open Mobile Alliance in a timely manner of
Essential IPR as it becomes aware that the Essential IPR is related
to the prepared or published specification.  However, the members
do not have an obligation to conduct IPR searches.  The declared
Essential IPR is publicly available to members and non-members of
the Open Mobile Alliance and may be found on the "OMA IPR
Declarations" list at http://www.openmobilealliance.org/ipr.html.
The Open Mobile Alliance has not conducted an independent IPR review
of this document and the information contained herein, and makes no
representations or warranties regarding third party IPR, including
without limitation patents, copyrights or trade secret rights.  This
document may contain inventions for which you must obtain licenses
from third parties before making, using or selling the inventions.
Defined terms above are set forth in the schedule to the Open Mobile
Alliance Application Form.

NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE
MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER
OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE "OMA
IPR DECLARATIONS" LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY,
COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR
NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL.

THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY
DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR
EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF
DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS.

Copyright 2013 Open Mobile Alliance Ltd.  All Rights Reserved.
Used with the permission of the Open Mobile Alliance Ltd. under the
terms set forth above.
-->

<LWM2M xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://openmobilealliance.org/tech/profiles/LWM2M.xsd" >
  <Object ObjectType="MODefinition">
		<Name>LWM2M Security</Name>
		<Description1><![CDATA[This LWM2M Object provides the keying material of a LWM2M Client appropriate to access a specified LWM2M Server. One Object Instance SHOULD address a LWM2M Bootstrap Server.
    These LWM2M Object Resources MUST only be changed by a LWM2M Bootstrap Server or Bootstrap from Smartcardand MUST NOT be accessible by any other LWM2M Server.]]></Description1>
		<ObjectID>0</ObjectID>
		<ObjectURN>TBD</ObjectURN>
		<MultipleInstances>Multiple</MultipleInstances>
		<Mandatory>Mandatory</Mandatory>
		<Resources>
			<Item ID="0">
				<Name>LWM2M  Server URI</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>String</Type>
				<RangeEnumeration>0-255 bytes</RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[Uniquely identifies the LWM2M Server or LWM2M Bootstrap Server, and is in the form:
"coaps://host:port", where host is an IP address or FQDN, and port is the UDP port of the Server.]]></Description>
			</Item>
			<Item ID="1">
				<Name>Bootstrap Server</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Boolean</Type>
				<RangeEnumeration></RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[Determines if the current instance concerns a LWM2M Bootstrap Server (true) or a standard LWM2M Server (false)]]></Description>
			</Item>
			<Item ID="2">
				<Name>Security Mode</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Integer</Type>
				<RangeEnumeration>0-3</RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[Determines which UDP payload security mode is used
0: Pre-Shared Key mode
1: Raw Public Key mode
2: Certificate mode
3: NoSec mode]]></Description>
			</Item>
			<Item ID="3">
				<Name>Public Key or Identity</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Opaque</Type>
				<RangeEnumeration></RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[Stores the LWM2M Client’s Certificate (Certificate mode), public key (RPK mode) or PSK Identity (PSK mode). The format is defined in Section E.1.1.]]></Description>
			</Item>
			<Item ID="4">
				<Name>Server Public Key or Identity</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Opaque</Type>
				<RangeEnumeration></RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[Stores the LWM2M Server’s or LWM2M Bootstrap Server’s Certificate (Certificate mode), public key (RPK mode) or PSK Identity (PSK mode). The format is defined in Section E.1.1.]]></Description>
			</Item>
			<Item ID="5">
				<Name>Secret Key</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Opaque</Type>
				<RangeEnumeration></RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[Stores the secret key or private key of the security mode. The format of the keying material is defined by the security mode in  Section E.1.1. This Resource MUST only be changed by a bootstrap server and MUST NOT be readable by any server.]]></Description>
			</Item>
			<Item ID="6">
				<Name>SMS Security Mode</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Integer</Type>
				<RangeEnumeration>0-255</RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[Determines which SMS payload security mode is used (see section 7.2)
0: Reserved for future use
1: Secure Packet Structure mode device terminated
2: Secure Packet Structure mode smartcard terminated
3: NoSec mode
255: Proprietary modes]]></Description>
			</Item>
			<Item ID="7">
				<Name>SMS Binding Key Parameters</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Opaque</Type>
				<RangeEnumeration>6 bytes</RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[Stores the KIc, KID, SPI and TAR. The format is defined in Section D.1.2.]]></Description>
			</Item>
			<Item ID="8">
				<Name>SMS Binding Secret Keys</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Opaque</Type>
				<RangeEnumeration>32-48 bytes</RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[Stores the values of the keys for the SMS binding. 
This resource MUST only be changed by a bootstrap server and MUST NOT be readable by any server.]]></Description>
			</Item>
			<Item ID="9">
				<Name>LWM2M Server SMS Number</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Integer</Type>
				<RangeEnumeration></RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[MSISDN used by the LWM2M Client  to send messages to the LWM2M Server via the SMS binding. 
The LWM2M Client SHALL silently ignore any SMS not originated from unknown MSISDN]]></Description>
			</Item>
			<Item ID="10">
				<Name>Short Server ID</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Optional</Mandatory>
				<Type>Integer</Type>
				<RangeEnumeration>1-65535</RangeEnumeration>
				<Units></Units>
				<Description><![CDATA[This identifier uniquely identifies each LWM2M Server configured for the LWM2M Client.
This Resource MUST be set when the Bootstrap Server Resource has false value.
Default Short Server ID (i.e. 0) MUST NOT be used for identifying the LWM2M Server.]]></Description>
			</Item>
			<Item ID="11">
				<Name>Client Hold Off Time</Name>
        <Operations></Operations>
        <MultipleInstances>Single</MultipleInstances>
				<Mandatory>Mandatory</Mandatory>
				<Type>Integer</Type>
				<RangeEnumeration></RangeEnumeration>
				<Units>s</Units>
				<Description><![CDATA[Relevant information for a Bootstrap Server only.
The number of seconds to wait before initiating a Client Initiated Bootstrap once the LWM2M Client has determined it should initiate this bootstrap mode]]></Description>
			</Item>
		</Resources>
			<Description2><![CDATA[==E.1.1	UDP Channel Security: Security Key Resource Format==
This section defines the format of the Secret Key and Public Key and Identity Resources of the LWM2M Server and LWM2M Bootstrap Objects when using UDP Channel security. These Resources are used to configure the security mode and keying material that a Client uses with a particular Server. The Objects are configured on the Client using one of the Bootstrap mechanisms described in Section 5.1. The use of this keying material for each security mode is defined in Section 7.1.
==E.1.1.1	Pre-Shared Key (PSK) Mode==
The PSK is a binary shared secret key between the Client and Server of the appropriate length for the Cipher Suite used [RFC4279]. This key is composed of a sequence of binary bytes in the Secret Key Resource. The default PSK Cipher Suites defined in this specification use a 128-bit AES key. Thus this key would be represented in 16 bytes in the Secret Key Resource.
The corresponding PSK Identity for this PSK is stored in the Public Key or Identity Resource. The PSK Identity is simply stored as a UTF-8 String as per [RFC4279]. Clients and Servers MUST support a PSK Identity of at least 128 bytes in length as required by [RFC4279].
==E.1.1.2	Raw-Public Key (RPK) Mode==
The raw-public key mode requires a public key and a private key of the appropriate type and length for the Cipher Suite used. These keys are carried as a sequence of binary bytes with the public key stored in the Public Key or Identity Resource, and the private key stored in the Secret Key Resource. The default RPK Cipher Suites defines in this specification use a 256-bit ECC key. Thus the Certificate Resource would contain a 32 byte public key and the Secret Key Resource a 32 byte private key.
==E.1.1.3	Certificate Mode==
The Certificate mode requires an X.509v3 Certificate along with a matching private key. The private key is stored in the Secret Key Resource as in RPK mode. The Certificate is simply represented as binary X.509v3 in the value of the Public Key or Identity Resource.
==E.1.2	SMS Payload Security: Security Key Resource Format==
This section defines the format of the Secret Key and Public Key and Identity resources of the LWM2M Server and LWM2M Bootstrap Objects when using SMS Payload security. These resources are used to configure keying material that a Client uses with a particular Server. The Objects are configured on the Client using one of the Bootstrap mechanisms described in Section 5.1. The use of this keying material is defined in Section 7.2.
The SMS key parameters are stored in the order KIc, KID, SPI, TAR (KIc is byte 0).
Ordering of bits within bytes SHALL follow ETSI TS 102 221, section 3.4 “Coding Conventions” (b8 MSB, b1 LSB).
==E.1.3	Unbootstrapping==
Unbootstrapping is the process of deleting a Security Object Instance. If a Security Object Instance is to be deleted, certain related resources and configurations need to be deleted or modified. Therefore, when the Delete operation is sent via the Bootstrap Interface, the Client MUST execute the following procedure.
#If there is an Object Instance that can be accessed only by a Server of the Server Object Instance (i.e., the Server is Access Control Owner and the LWM2M Server can access the Object Instance only in an Access Control Object Instance), the Object Instance and the corresponding Access Control Object Instance MUST be deleted
#If an Object Instance can be accessed by multiple Servers including the Server which Security Object Instance is to be deleted, then:
- The ACL Resource Instance for the Server in the Access Control Object Instance for the Object Instance MUST be deleted
- If the Server is the Access Control Owner of the Access Control Object Instance, then the Access Control Owner MUST be changed to another Server according to the rules below:
The Client MUST choose the Server who has highest sum of each number assigned to an access right (Write: 1, Delete: 1) for the Access Control Owner. If two or more Servers have the same sum, the Client MUST choose one of them as the new Access Control Owner.
#Observation operations from the Server MUST be deleted
#Server Object Instance MUST be deleted
#Client MAY send “De-register” operation to the Server
Note: To monitor the change of the Access Control Owner, the Server MAY observe Access Control Owner Resource.]]></Description2>
	</Object>
</LWM2M>
