<?xml version="1.0" encoding="UTF-8"?>
<!--
	Description
		BCAST enabler - SP/CP Backend Messages
	Version: 1.0.1
	Date:    09 Jan 2013

	FILE INFORMATION

	OMA Permanent Document
		File: OMA-SUP-XSD_bcast_spcp_backend-V1_0_1-20130109-A
		Type: Text - XML Schema Definition

	Public Reachable Information
		Path: http://www.openmobilealliance.org/tech/profiles
		Name: bcast_spcp_backend-v1_0_1.xsd

	NORMATIVE INFORMATION

	Information about this file can be found in the latest revision of
	the specification OMA-TS-BCAST_SvcCntProtection-V1_0_1 
	
	This is available at http://www.openmobilealliance.org/

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

CHANGE HISTORY

20100329 * File created from OMA-SUP-XSD_bcast_spcp_backend-V1_0-20090212-A:
				  - embedded file information header aligned with
				    http://member.openmobilealliance.org/ftp/rel/gen_info/Procs/SupportFiles_XSD-v1_0.shtml
		 * Alignment with OMA-TS-BCAST_SvcCntProtection-V1_0_1-20100122-D,
				  following CRs implemented:
				  - OMA-BCAST-2009-0124R01-CR_SecureChannelFlag_SP4

09012012 Notified to TP see TP Ref
         OMA-TP-2013-0001-INP_BCAST_V1_0_1_ERP_for_notification
 

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,
  provided, however, that section (d) under "Documents - Terms 
  of Use" which states, "no modifications are made to such 
  Documents" does not apply to your use.

  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.
-->
<xs:schema
	targetNamespace="urn:oma:xml:bcast:spcp:backend:1.0"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns="urn:oma:xml:bcast:spcp:backend:1.0"
	elementFormDefault="qualified"
	attributeFormDefault="unqualified">
	<!-- ============== All messages in this schema apply to Interface SP-4 ===============-->
	<!--
		==================================================
		Service and Program key material delivery - Key Request
		==================================================
	-->
	<xs:element name="KeyRequest">
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="KeyRequestType"/>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="KeyRequestType">
		<xs:sequence>
			<xs:element name="GlobalServiceID" type="xs:anyURI"/>
			<xs:element name="GlobalContentID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="ScheduleID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="KeyStartTime" type="xs:unsignedInt"/>
			<xs:element name="KeyEndTime" type="xs:unsignedInt"/>
		</xs:sequence>
		<xs:attribute name="tag" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="messageID" type="xs:string" use="required"/>
		<xs:attribute name="destination" type="xs:string" use="required"/>
		<xs:attribute name="source" type="xs:string" use="required"/>
		<xs:attribute name="time" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<!--
		==================================================
		Service and Program key material delivery - Key Request Response
		==================================================
	-->
	<xs:element name="KeyRequestResponse" type="KeyRequestResponseType"/>
	<xs:complexType name="KeyRequestResponseType">
		<xs:sequence>
			<xs:element name="GlobalServiceID" type="xs:anyURI"/>
			<xs:element name="GlobalContentID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="ScheduleID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="SPPType" type="SPPRangeType"/>
			<xs:element name="ServiceKey" type="ServiceKeyType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ProgramKey" minOccurs="0">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:hexBinary">
							<xs:attribute name="keyIdentifier" type="xs:hexBinary" use="required"/>
							<xs:attribute name="value" type="xs:hexBinary" use="required"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="AccessCriteriaDescriptor" type="xs:hexBinary" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ProtectionAfterReceptionFlag" type="xs:unsignedByte"/>
			<xs:element name="TerminalBindingKey" minOccurs="0">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:hexBinary">
							<xs:attribute name="keyIdentifier" type="xs:hexBinary" use="required"/>
							<xs:attribute name="value" type="xs:hexBinary" use="required"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="tag" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="messageID" type="xs:string" use="required"/>
		<xs:attribute name="destination" type="xs:string" use="required"/>
		<xs:attribute name="source" type="xs:string" use="required"/>
		<xs:attribute name="status" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="time" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="secureChannelFlag" type="xs:boolean" use="optional" default="true"/>
	</xs:complexType>
	<!--
		This specifies the type of the Service protection profile used by the BSM.
		0 if service protection profile == DRM Profile
		1 if service protection profile == Smartcard Profile
		2-127 reserved for future use
		128-255 reserved for proprietary use
	-->
	<xs:simpleType name="SPPRangeType">
		<xs:union memberTypes="SPPLRType ReservedProprietaryExtByteRangeType"/>
	</xs:simpleType>
	<xs:simpleType name="SPPLRType">
		<xs:restriction base="xs:unsignedByte">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="1"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="ServiceKeyType">
		<xs:sequence>
			<xs:element name="ServiceKeyStart" type="xs:unsignedInt"/>
			<xs:element name="ServiceKeyEnd" type="xs:unsignedInt"/>
			<xs:element name="ServiceKeyMTKStart" type="xs:hexBinary" minOccurs="0"/>
			<xs:element name="ServiceKeyMTKEnd" type="xs:hexBinary" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="keyIdentifier" type="xs:hexBinary" use="required"/>
		<xs:attribute name="value" type="xs:hexBinary" use="required"/>
		<xs:attribute name="rand" type="xs:hexBinary" use="required"/>
	</xs:complexType>
	<!--
		=====================================================
		Service and Program key material delivery - Key Delivery Confirmation
		=====================================================
	-->
	<xs:element name="KeyDeliveryConfirmation" type="KeyDeliveryConfirmationType"/>
	<xs:complexType name="KeyDeliveryConfirmationType">
		<xs:sequence>
			<xs:element name="GlobalServiceID" type="xs:anyURI"/>
			<xs:element name="GlobalContentID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="ScheduleID" type="xs:anyURI" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="tag" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="messageID" type="xs:string" use="required"/>
		<xs:attribute name="destination" type="xs:string" use="required"/>
		<xs:attribute name="source" type="xs:string" use="required"/>
		<xs:attribute name="status" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="time" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<!--
		==================================================
		LTKM and Registration key material delivery - LTKM Request
		==================================================
	-->
	<xs:element name="LTKMorRegRequest" type="LTKMorRegRequestType"/>
	<xs:complexType name="LTKMorRegRequestType">
		<xs:sequence>
			<xs:element name="GlobalServiceID" type="xs:anyURI"/>
			<xs:element name="GlobalContentID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="ScheduleID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="DistributionStart" type="xs:unsignedInt"/>
			<xs:element name="DistributionEnd" type="xs:unsignedInt"/>
		</xs:sequence>
		<xs:attribute name="tag" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="messageID" type="xs:string" use="required"/>
		<xs:attribute name="destination" type="xs:string" use="required"/>
		<xs:attribute name="source" type="xs:string" use="required"/>
		<xs:attribute name="time" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<!--
		======================================================
		LTKM and Registration key material delivery - LTKM Request Response
		======================================================
	-->
	<xs:element name="LTKMorRegRequestResponse" type="LTKMorRegRequestResponseType"/>
	<xs:complexType name="LTKMorRegRequestResponseType">
		<xs:sequence>
			<xs:element name="GlobalServiceID" type="xs:anyURI"/>
			<xs:element name="GlobalContentID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="ScheduleID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="Data" type="xs:hexBinary" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="DistributionStart" type="xs:unsignedInt" minOccurs="0"/>
			<xs:element name="DistributionEnd" type="xs:unsignedInt" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="tag" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="messageID" type="xs:string" use="required"/>
		<xs:attribute name="destination" type="xs:string" use="required"/>
		<xs:attribute name="source" type="xs:string" use="required"/>
		<xs:attribute name="status" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="time" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<!--
		========================================================================
		LTKM and Registration key material delivery - LTKM or RegistrationKeyMaterial Key Delivery
		========================================================================
	-->
	<xs:element name="LTKMorRegDelivery" type="LTKMorRegRequestResponseType"/>
	<!--
		=================================================================================
		LTKM and Registration key material delivery - LTKM or Registration Key Material Key  Delivery Confirmation
		=================================================================================
	-->
	<xs:element name="LTKMorRegDeliveryConfirmation" type="KeyDeliveryConfirmationType"/>
	<!--
		===============================================
		STKM delivery - STKM Request
		===============================================
	-->
	<xs:element name="STKMRequest" type="STKMRequestType"/>
	<xs:complexType name="STKMRequestType">
		<xs:sequence>
			<xs:element name="GlobalServiceID" type="xs:anyURI"/>
			<xs:element name="GlobalContentID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="ScheduleID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="SPPType" type="SPPRangeType"/>
			<xs:element name="KeyMaterial" type="KeyMaterialType" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="tag" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="messageID" type="xs:string" use="required"/>
		<xs:attribute name="destination" type="xs:string" use="required"/>
		<xs:attribute name="source" type="xs:string" use="required"/>
		<xs:attribute name="time" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<xs:complexType name="KeyMaterialType">
		<xs:sequence>
			<xs:element name="TrafficProtectionProtocolParameters" type="TrafficProtectionProtocolParametersType"/>
			<xs:element name="NextTrafficKey" type="NextTrafficKeyType" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="masterKey" type="xs:hexBinary" use="required"/>
		<xs:attribute name="masterSalt" type="xs:hexBinary" use="required"/>
		<xs:attribute name="type" type="KeyMaterialRangeType" use="required"/>
		<xs:attribute name="traffic_authentication_flag" type="xs:boolean" use="required"/>
		<xs:attribute name="validityTime" type="xs:unsignedInt" use="required"/>
		<xs:attribute name="cryptoPeriod" type="xs:unsignedInt" use="required"/>
		<xs:attribute name="wrapAroundTime" type="xs:unsignedInt" use="required"/>
		<xs:attribute name="wrapAroundIndicator" type="xs:boolean" use="required"/>
	</xs:complexType>
	<!--
		Allowed values are:
		 0 if traffic_protection_protocol == TKM_ALGO_IPSEC
		 1 if traffic_protection_protocol == TKM_ALGO_SRTP
		 2 if traffic_protection_protocol == TKM_ALGO_AUENCRYP
		 3 if traffic_protection_protocol == TKM_ALGO_DCF
		 4-127 reserved for future use
		 128-255 reserved for proprietary use
	-->
	<xs:simpleType name="KeyMaterialRangeType">
		<xs:union memberTypes="KeyMaterialLRType ReservedProprietaryExtByteRangeType"/>
	</xs:simpleType>
	<xs:simpleType name="KeyMaterialLRType">
		<xs:restriction base="xs:unsignedByte">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="3"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ReservedProprietaryExtByteRangeType">
		<xs:restriction base="xs:unsignedByte">
			<xs:minInclusive value="128"/>
			<xs:maxInclusive value="255"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="TrafficProtectionProtocolParametersType">
		<xs:sequence>
			<xs:element name="SPI" minOccurs="0">
				<xs:complexType>
					<xs:attribute name="spi" type="xs:unsignedInt" use="required"/>
					<xs:attribute name="nextSpi" type="xs:unsignedInt" use="required"/>
				</xs:complexType>
			</xs:element>
			<xs:element name="MKI" minOccurs="0">
				<xs:complexType>
					<xs:attribute name="mkiLength" type="xs:unsignedInt" use="required"/>
					<xs:attribute name="mki" type="xs:unsignedInt" use="required"/>
					<xs:attribute name="mediaFlows" type="xs:int" use="required"/>
				</xs:complexType>
			</xs:element>
			<xs:element name="KeyIndicator" minOccurs="0">
				<xs:complexType>
					<xs:attribute name="keyIndicatorLength" type="xs:unsignedInt" use="required"/>
					<xs:attribute name="keyIndicator" type="xs:unsignedInt" use="required"/>
				</xs:complexType>
			</xs:element>
			<xs:element name="KeyIdentifier" minOccurs="0">
				<xs:complexType>
					<xs:attribute name="keyIdentifierLength" type="xs:unsignedInt" use="required"/>
					<xs:attribute name="keyIdentifier" type="xs:hexBinary" use="required"/>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="NextTrafficKeyType">
		<xs:simpleContent>
			<xs:extension base="xs:boolean">
				<xs:attribute name="masterKey" type="xs:hexBinary" use="optional"/>
				<xs:attribute name="masterSalt" type="xs:hexBinary" use="optional"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<!--
		===============================================
		STKM delivery - STKM Response
		===============================================
	-->
	<xs:element name="STKMResponse" type="STKMResponseType"/>
	<xs:complexType name="STKMResponseType">
		<xs:sequence>
			<xs:element name="GlobalServiceID" type="xs:anyURI"/>
			<xs:element name="GlobalContentID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="ScheduleID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="STKM" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:hexBinary">
							<xs:attribute name="validityTime" type="xs:unsignedInt" use="required"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="tag" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="messageID" type="xs:string" use="required"/>
		<xs:attribute name="destination" type="xs:string" use="required"/>
		<xs:attribute name="source" type="xs:string" use="required"/>
		<xs:attribute name="status" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="time" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<!--
		===============================================
		STKM delivery - Partial STKM Request
		===============================================
	-->
	<xs:element name="PartialSTKMRequest" type="PartialSTKMRequestType"/>
	<xs:complexType name="PartialSTKMRequestType">
		<xs:sequence>
			<xs:element name="GlobalServiceID" type="xs:anyURI"/>
			<xs:element name="GlobalContentID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="ScheduleID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="TEKStartTime" type="xs:unsignedInt"/>
			<xs:element name="TEKEndTime" type="xs:unsignedInt"/>
		</xs:sequence>
		<xs:attribute name="tag" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="messageID" type="xs:string" use="required"/>
		<xs:attribute name="destination" type="xs:string" use="required"/>
		<xs:attribute name="source" type="xs:string" use="required"/>
		<xs:attribute name="time" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<!--
		===============================================
		STKM delivery - Partial STKM Response
		===============================================
	-->
	<xs:element name="PartialSTKMResponse" type="PartialSTKMResponseType"/>
	<xs:complexType name="PartialSTKMResponseType">
		<xs:sequence>
			<xs:element name="GlobalServiceID" type="xs:anyURI"/>
			<xs:element name="GlobalContentID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="ScheduleID" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="SPPType" type="SPPRangeType"/>
			<xs:element name="KeyMaterial" type="KeyMaterialType"/>
		</xs:sequence>
		<xs:attribute name="tag" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="messageID" type="xs:string" use="required"/>
		<xs:attribute name="destination" type="xs:string" use="required"/>
		<xs:attribute name="source" type="xs:string" use="required"/>
		<xs:attribute name="status" type="xs:unsignedByte" use="required"/>
		<xs:attribute name="time" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<!--
		===============================================
		STKM delivery - STKM Delivery Message
		===============================================
	-->
	<xs:element name="STKMDelivery" type="STKMResponseType"/>
	<xs:element name="STKMDeliveryConfirmation" type="KeyDeliveryConfirmationType"/>
</xs:schema>
