+
+
- ).*/);
+ const wrmHeader = wrmHeaderMatch ? wrmHeaderMatch[1] : null;
+ const encodedWrmHeader = encodeUtf16LE(wrmHeader);
+ const playreadyHeader = wrmHeaderToPlayReadyHeader(encodedWrmHeader);
+ pssh_data_string = psshDataToPsshBoxB64(playreadyHeader, PLAYREADY_SYSTEM_ID);
+ } else {
+ // If body is in a different format, process as Widevine content
+ const uint8Array = stringToUint8Array(result.body);
+ let signed_message;
+ let license_request;
+ try {
+ signed_message = SignedMessage.decode(uint8Array);
+ license_request = LicenseRequest.decode(signed_message.msg);
+ } catch (decodeError) {
+ // If error occurs during decoding, return an empty pssh
+ console.error('Decoding failed, returning empty pssh', decodeError);
+ pssh_data_string = ''; // Empty pssh if decoding fails
+ }
+
+ if (license_request && license_request.contentId && license_request.contentId.widevinePsshData) {
+ const pssh_data = license_request.contentId.widevinePsshData.psshData[0];
+ pssh_data_string = psshDataToPsshBoxB64(pssh_data, WIDEVINE_SYSTEM_ID);
+ }
+
+ // Check if the body contains binary data (non-UTF-8 characters)
+ if (isBinary(uint8Array)) {
+ payload_string = uint8ArrayToBase64(uint8Array);
+ } else {
+ // If it's text, return it as is
+ payload_string = result.body;
+ }
+ }
+
+ // Output the result
+ document.getElementById("licurl").value = result.url;
+ document.getElementById("headers").value = JSON.stringify(result.headers);
+ document.getElementById("pssh").value = pssh_data_string;
+ document.getElementById("data").value = payload_string;
+ } catch (error) {
+ console.error('Failed to read clipboard contents:', error);
+ }
+}
+
+// Helper function to check if the data is binary
+function isBinary(uint8Array) {
+ // Check for non-text (non-ASCII) bytes (basic heuristic)
+ return uint8Array.some(byte => byte > 127); // Non-ASCII byte indicates binary
+}
+
+
diff --git a/cdrm-frontend/src/components/Functions/license_protocol.min.js b/cdrm-frontend/src/components/Functions/license_protocol.min.js
new file mode 100644
index 0000000..ea12861
--- /dev/null
+++ b/cdrm-frontend/src/components/Functions/license_protocol.min.js
@@ -0,0 +1 @@
+(function($protobuf){"use strict";var $Reader=$protobuf.Reader,$Writer=$protobuf.Writer,$util=$protobuf.util;var $root=$protobuf.roots["default"]||($protobuf.roots["default"]={});$root.license_protocol=(function(){var license_protocol={};license_protocol.LicenseType=(function(){var valuesById={},values=Object.create(valuesById);values[valuesById[1]="STREAMING"]=1;values[valuesById[2]="OFFLINE"]=2;values[valuesById[3]="AUTOMATIC"]=3;return values})();license_protocol.PlatformVerificationStatus=(function(){var valuesById={},values=Object.create(valuesById);values[valuesById[0]="PLATFORM_UNVERIFIED"]=0;values[valuesById[1]="PLATFORM_TAMPERED"]=1;values[valuesById[2]="PLATFORM_SOFTWARE_VERIFIED"]=2;values[valuesById[3]="PLATFORM_HARDWARE_VERIFIED"]=3;values[valuesById[4]="PLATFORM_NO_VERIFICATION"]=4;values[valuesById[5]="PLATFORM_SECURE_STORAGE_SOFTWARE_VERIFIED"]=5;return values})();license_protocol.LicenseIdentification=(function(){function LicenseIdentification(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.requestId=reader.bytes();break}case 2:{message.sessionId=reader.bytes();break}case 3:{message.purchaseId=reader.bytes();break}case 4:{message.type=reader.int32();break}case 5:{message.version=reader.int32();break}case 6:{message.providerSessionToken=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};LicenseIdentification.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};LicenseIdentification.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.requestId!=null&&message.hasOwnProperty("requestId")){if(!(message.requestId&&typeof message.requestId.length==="number"||$util.isString(message.requestId))){return "requestId: buffer expected"}}if(message.sessionId!=null&&message.hasOwnProperty("sessionId")){if(!(message.sessionId&&typeof message.sessionId.length==="number"||$util.isString(message.sessionId))){return "sessionId: buffer expected"}}if(message.purchaseId!=null&&message.hasOwnProperty("purchaseId")){if(!(message.purchaseId&&typeof message.purchaseId.length==="number"||$util.isString(message.purchaseId))){return "purchaseId: buffer expected"}}if(message.type!=null&&message.hasOwnProperty("type")){switch(message.type){default:return "type: enum value expected";case 1:case 2:case 3:break}}if(message.version!=null&&message.hasOwnProperty("version")){if(!$util.isInteger(message.version)){return "version: integer expected"}}if(message.providerSessionToken!=null&&message.hasOwnProperty("providerSessionToken")){if(!(message.providerSessionToken&&typeof message.providerSessionToken.length==="number"||$util.isString(message.providerSessionToken))){return "providerSessionToken: buffer expected"}}return null};LicenseIdentification.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.LicenseIdentification){return object}var message=new $root.license_protocol.LicenseIdentification();if(object.requestId!=null){if(typeof object.requestId==="string"){$util.base64.decode(object.requestId,message.requestId=$util.newBuffer($util.base64.length(object.requestId)),0)}else if(object.requestId.length>=0){message.requestId=object.requestId}}if(object.sessionId!=null){if(typeof object.sessionId==="string"){$util.base64.decode(object.sessionId,message.sessionId=$util.newBuffer($util.base64.length(object.sessionId)),0)}else if(object.sessionId.length>=0){message.sessionId=object.sessionId}}if(object.purchaseId!=null){if(typeof object.purchaseId==="string"){$util.base64.decode(object.purchaseId,message.purchaseId=$util.newBuffer($util.base64.length(object.purchaseId)),0)}else if(object.purchaseId.length>=0){message.purchaseId=object.purchaseId}}switch(object.type){default:if(typeof object.type==="number"){message.type=object.type;break}break;case "STREAMING":case 1:message.type=1;break;case "OFFLINE":case 2:message.type=2;break;case "AUTOMATIC":case 3:message.type=3;break}if(object.version!=null){message.version=object.version|0}if(object.providerSessionToken!=null){if(typeof object.providerSessionToken==="string"){$util.base64.decode(object.providerSessionToken,message.providerSessionToken=$util.newBuffer($util.base64.length(object.providerSessionToken)),0)}else if(object.providerSessionToken.length>=0){message.providerSessionToken=object.providerSessionToken}}return message};LicenseIdentification.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){if(options.bytes===String){object.requestId=""}else{object.requestId=[];if(options.bytes!==Array){object.requestId=$util.newBuffer(object.requestId)}}if(options.bytes===String){object.sessionId=""}else{object.sessionId=[];if(options.bytes!==Array){object.sessionId=$util.newBuffer(object.sessionId)}}if(options.bytes===String){object.purchaseId=""}else{object.purchaseId=[];if(options.bytes!==Array){object.purchaseId=$util.newBuffer(object.purchaseId)}}object.type=options.enums===String?"STREAMING":1;object.version=0;if(options.bytes===String){object.providerSessionToken=""}else{object.providerSessionToken=[];if(options.bytes!==Array){object.providerSessionToken=$util.newBuffer(object.providerSessionToken)}}}if(message.requestId!=null&&message.hasOwnProperty("requestId")){object.requestId=options.bytes===String?$util.base64.encode(message.requestId,0,message.requestId.length):options.bytes===Array?Array.prototype.slice.call(message.requestId):message.requestId}if(message.sessionId!=null&&message.hasOwnProperty("sessionId")){object.sessionId=options.bytes===String?$util.base64.encode(message.sessionId,0,message.sessionId.length):options.bytes===Array?Array.prototype.slice.call(message.sessionId):message.sessionId}if(message.purchaseId!=null&&message.hasOwnProperty("purchaseId")){object.purchaseId=options.bytes===String?$util.base64.encode(message.purchaseId,0,message.purchaseId.length):options.bytes===Array?Array.prototype.slice.call(message.purchaseId):message.purchaseId}if(message.type!=null&&message.hasOwnProperty("type")){object.type=options.enums===String?$root.license_protocol.LicenseType[message.type]===undefined?message.type:$root.license_protocol.LicenseType[message.type]:message.type}if(message.version!=null&&message.hasOwnProperty("version")){object.version=message.version}if(message.providerSessionToken!=null&&message.hasOwnProperty("providerSessionToken")){object.providerSessionToken=options.bytes===String?$util.base64.encode(message.providerSessionToken,0,message.providerSessionToken.length):options.bytes===Array?Array.prototype.slice.call(message.providerSessionToken):message.providerSessionToken}return object};LicenseIdentification.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};LicenseIdentification.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.LicenseIdentification"};return LicenseIdentification})();license_protocol.License=(function(){function License(properties){this.key=[];this.groupIds=[];if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.id=$root.license_protocol.LicenseIdentification.decode(reader,reader.uint32());break}case 2:{message.policy=$root.license_protocol.License.Policy.decode(reader,reader.uint32());break}case 3:{if(!(message.key&&message.key.length)){message.key=[]}message.key.push($root.license_protocol.License.KeyContainer.decode(reader,reader.uint32()));break}case 4:{message.licenseStartTime=reader.int64();break}case 5:{message.remoteAttestationVerified=reader.bool();break}case 6:{message.providerClientToken=reader.bytes();break}case 7:{message.protectionScheme=reader.uint32();break}case 8:{message.srmRequirement=reader.bytes();break}case 9:{message.srmUpdate=reader.bytes();break}case 10:{message.platformVerificationStatus=reader.int32();break}case 11:{if(!(message.groupIds&&message.groupIds.length)){message.groupIds=[]}message.groupIds.push(reader.bytes());break}default:reader.skipType(tag&7);break}}return message};License.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};License.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.id!=null&&message.hasOwnProperty("id")){var error=$root.license_protocol.LicenseIdentification.verify(message.id);if(error){return "id."+error}}if(message.policy!=null&&message.hasOwnProperty("policy")){var error=$root.license_protocol.License.Policy.verify(message.policy);if(error){return "policy."+error}}if(message.key!=null&&message.hasOwnProperty("key")){if(!Array.isArray(message.key)){return "key: array expected"}for(var i=0;i>>0,object.licenseStartTime.high>>>0).toNumber()}}if(object.remoteAttestationVerified!=null){message.remoteAttestationVerified=Boolean(object.remoteAttestationVerified)}if(object.providerClientToken!=null){if(typeof object.providerClientToken==="string"){$util.base64.decode(object.providerClientToken,message.providerClientToken=$util.newBuffer($util.base64.length(object.providerClientToken)),0)}else if(object.providerClientToken.length>=0){message.providerClientToken=object.providerClientToken}}if(object.protectionScheme!=null){message.protectionScheme=object.protectionScheme>>>0}if(object.srmRequirement!=null){if(typeof object.srmRequirement==="string"){$util.base64.decode(object.srmRequirement,message.srmRequirement=$util.newBuffer($util.base64.length(object.srmRequirement)),0)}else if(object.srmRequirement.length>=0){message.srmRequirement=object.srmRequirement}}if(object.srmUpdate!=null){if(typeof object.srmUpdate==="string"){$util.base64.decode(object.srmUpdate,message.srmUpdate=$util.newBuffer($util.base64.length(object.srmUpdate)),0)}else if(object.srmUpdate.length>=0){message.srmUpdate=object.srmUpdate}}switch(object.platformVerificationStatus){case "PLATFORM_UNVERIFIED":case 0:message.platformVerificationStatus=0;break;case "PLATFORM_TAMPERED":case 1:message.platformVerificationStatus=1;break;case "PLATFORM_SOFTWARE_VERIFIED":case 2:message.platformVerificationStatus=2;break;case "PLATFORM_HARDWARE_VERIFIED":case 3:message.platformVerificationStatus=3;break;default:if(typeof object.platformVerificationStatus==="number"){message.platformVerificationStatus=object.platformVerificationStatus;break}break;case "PLATFORM_NO_VERIFICATION":case 4:message.platformVerificationStatus=4;break;case "PLATFORM_SECURE_STORAGE_SOFTWARE_VERIFIED":case 5:message.platformVerificationStatus=5;break}if(object.groupIds){if(!Array.isArray(object.groupIds)){throw TypeError(".license_protocol.License.groupIds: array expected")}message.groupIds=[];for(var i=0;i=0){message.groupIds[i]=object.groupIds[i]}}}return message};License.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.arrays||options.defaults){object.key=[];object.groupIds=[]}if(options.defaults){object.id=null;object.policy=null;if($util.Long){var long=new $util.Long(0,0,false);object.licenseStartTime=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.licenseStartTime=options.longs===String?"0":0}object.remoteAttestationVerified=false;if(options.bytes===String){object.providerClientToken=""}else{object.providerClientToken=[];if(options.bytes!==Array){object.providerClientToken=$util.newBuffer(object.providerClientToken)}}object.protectionScheme=0;if(options.bytes===String){object.srmRequirement=""}else{object.srmRequirement=[];if(options.bytes!==Array){object.srmRequirement=$util.newBuffer(object.srmRequirement)}}if(options.bytes===String){object.srmUpdate=""}else{object.srmUpdate=[];if(options.bytes!==Array){object.srmUpdate=$util.newBuffer(object.srmUpdate)}}object.platformVerificationStatus=options.enums===String?"PLATFORM_NO_VERIFICATION":4}if(message.id!=null&&message.hasOwnProperty("id")){object.id=$root.license_protocol.LicenseIdentification.toObject(message.id,options)}if(message.policy!=null&&message.hasOwnProperty("policy")){object.policy=$root.license_protocol.License.Policy.toObject(message.policy,options)}if(message.key&&message.key.length){object.key=[];for(var j=0;j>>0,message.licenseStartTime.high>>>0).toNumber():message.licenseStartTime}}if(message.remoteAttestationVerified!=null&&message.hasOwnProperty("remoteAttestationVerified")){object.remoteAttestationVerified=message.remoteAttestationVerified}if(message.providerClientToken!=null&&message.hasOwnProperty("providerClientToken")){object.providerClientToken=options.bytes===String?$util.base64.encode(message.providerClientToken,0,message.providerClientToken.length):options.bytes===Array?Array.prototype.slice.call(message.providerClientToken):message.providerClientToken}if(message.protectionScheme!=null&&message.hasOwnProperty("protectionScheme")){object.protectionScheme=message.protectionScheme}if(message.srmRequirement!=null&&message.hasOwnProperty("srmRequirement")){object.srmRequirement=options.bytes===String?$util.base64.encode(message.srmRequirement,0,message.srmRequirement.length):options.bytes===Array?Array.prototype.slice.call(message.srmRequirement):message.srmRequirement}if(message.srmUpdate!=null&&message.hasOwnProperty("srmUpdate")){object.srmUpdate=options.bytes===String?$util.base64.encode(message.srmUpdate,0,message.srmUpdate.length):options.bytes===Array?Array.prototype.slice.call(message.srmUpdate):message.srmUpdate}if(message.platformVerificationStatus!=null&&message.hasOwnProperty("platformVerificationStatus")){object.platformVerificationStatus=options.enums===String?$root.license_protocol.PlatformVerificationStatus[message.platformVerificationStatus]===undefined?message.platformVerificationStatus:$root.license_protocol.PlatformVerificationStatus[message.platformVerificationStatus]:message.platformVerificationStatus}if(message.groupIds&&message.groupIds.length){object.groupIds=[];for(var j=0;j>>3){case 1:{message.canPlay=reader.bool();break}case 2:{message.canPersist=reader.bool();break}case 3:{message.canRenew=reader.bool();break}case 4:{message.rentalDurationSeconds=reader.int64();break}case 5:{message.playbackDurationSeconds=reader.int64();break}case 6:{message.licenseDurationSeconds=reader.int64();break}case 7:{message.renewalRecoveryDurationSeconds=reader.int64();break}case 8:{message.renewalServerUrl=reader.string();break}case 9:{message.renewalDelaySeconds=reader.int64();break}case 10:{message.renewalRetryIntervalSeconds=reader.int64();break}case 11:{message.renewWithUsage=reader.bool();break}case 12:{message.alwaysIncludeClientId=reader.bool();break}case 13:{message.playStartGracePeriodSeconds=reader.int64();break}case 14:{message.softEnforcePlaybackDuration=reader.bool();break}case 15:{message.softEnforceRentalDuration=reader.bool();break}default:reader.skipType(tag&7);break}}return message};Policy.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};Policy.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.canPlay!=null&&message.hasOwnProperty("canPlay")){if(typeof message.canPlay!=="boolean"){return "canPlay: boolean expected"}}if(message.canPersist!=null&&message.hasOwnProperty("canPersist")){if(typeof message.canPersist!=="boolean"){return "canPersist: boolean expected"}}if(message.canRenew!=null&&message.hasOwnProperty("canRenew")){if(typeof message.canRenew!=="boolean"){return "canRenew: boolean expected"}}if(message.rentalDurationSeconds!=null&&message.hasOwnProperty("rentalDurationSeconds")){if(!$util.isInteger(message.rentalDurationSeconds)&&!(message.rentalDurationSeconds&&$util.isInteger(message.rentalDurationSeconds.low)&&$util.isInteger(message.rentalDurationSeconds.high))){return "rentalDurationSeconds: integer|Long expected"}}if(message.playbackDurationSeconds!=null&&message.hasOwnProperty("playbackDurationSeconds")){if(!$util.isInteger(message.playbackDurationSeconds)&&!(message.playbackDurationSeconds&&$util.isInteger(message.playbackDurationSeconds.low)&&$util.isInteger(message.playbackDurationSeconds.high))){return "playbackDurationSeconds: integer|Long expected"}}if(message.licenseDurationSeconds!=null&&message.hasOwnProperty("licenseDurationSeconds")){if(!$util.isInteger(message.licenseDurationSeconds)&&!(message.licenseDurationSeconds&&$util.isInteger(message.licenseDurationSeconds.low)&&$util.isInteger(message.licenseDurationSeconds.high))){return "licenseDurationSeconds: integer|Long expected"}}if(message.renewalRecoveryDurationSeconds!=null&&message.hasOwnProperty("renewalRecoveryDurationSeconds")){if(!$util.isInteger(message.renewalRecoveryDurationSeconds)&&!(message.renewalRecoveryDurationSeconds&&$util.isInteger(message.renewalRecoveryDurationSeconds.low)&&$util.isInteger(message.renewalRecoveryDurationSeconds.high))){return "renewalRecoveryDurationSeconds: integer|Long expected"}}if(message.renewalServerUrl!=null&&message.hasOwnProperty("renewalServerUrl")){if(!$util.isString(message.renewalServerUrl)){return "renewalServerUrl: string expected"}}if(message.renewalDelaySeconds!=null&&message.hasOwnProperty("renewalDelaySeconds")){if(!$util.isInteger(message.renewalDelaySeconds)&&!(message.renewalDelaySeconds&&$util.isInteger(message.renewalDelaySeconds.low)&&$util.isInteger(message.renewalDelaySeconds.high))){return "renewalDelaySeconds: integer|Long expected"}}if(message.renewalRetryIntervalSeconds!=null&&message.hasOwnProperty("renewalRetryIntervalSeconds")){if(!$util.isInteger(message.renewalRetryIntervalSeconds)&&!(message.renewalRetryIntervalSeconds&&$util.isInteger(message.renewalRetryIntervalSeconds.low)&&$util.isInteger(message.renewalRetryIntervalSeconds.high))){return "renewalRetryIntervalSeconds: integer|Long expected"}}if(message.renewWithUsage!=null&&message.hasOwnProperty("renewWithUsage")){if(typeof message.renewWithUsage!=="boolean"){return "renewWithUsage: boolean expected"}}if(message.alwaysIncludeClientId!=null&&message.hasOwnProperty("alwaysIncludeClientId")){if(typeof message.alwaysIncludeClientId!=="boolean"){return "alwaysIncludeClientId: boolean expected"}}if(message.playStartGracePeriodSeconds!=null&&message.hasOwnProperty("playStartGracePeriodSeconds")){if(!$util.isInteger(message.playStartGracePeriodSeconds)&&!(message.playStartGracePeriodSeconds&&$util.isInteger(message.playStartGracePeriodSeconds.low)&&$util.isInteger(message.playStartGracePeriodSeconds.high))){return "playStartGracePeriodSeconds: integer|Long expected"}}if(message.softEnforcePlaybackDuration!=null&&message.hasOwnProperty("softEnforcePlaybackDuration")){if(typeof message.softEnforcePlaybackDuration!=="boolean"){return "softEnforcePlaybackDuration: boolean expected"}}if(message.softEnforceRentalDuration!=null&&message.hasOwnProperty("softEnforceRentalDuration")){if(typeof message.softEnforceRentalDuration!=="boolean"){return "softEnforceRentalDuration: boolean expected"}}return null};Policy.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.License.Policy){return object}var message=new $root.license_protocol.License.Policy();if(object.canPlay!=null){message.canPlay=Boolean(object.canPlay)}if(object.canPersist!=null){message.canPersist=Boolean(object.canPersist)}if(object.canRenew!=null){message.canRenew=Boolean(object.canRenew)}if(object.rentalDurationSeconds!=null){if($util.Long){(message.rentalDurationSeconds=$util.Long.fromValue(object.rentalDurationSeconds)).unsigned=false}else if(typeof object.rentalDurationSeconds==="string"){message.rentalDurationSeconds=parseInt(object.rentalDurationSeconds,10)}else if(typeof object.rentalDurationSeconds==="number"){message.rentalDurationSeconds=object.rentalDurationSeconds}else if(typeof object.rentalDurationSeconds==="object"){message.rentalDurationSeconds=new $util.LongBits(object.rentalDurationSeconds.low>>>0,object.rentalDurationSeconds.high>>>0).toNumber()}}if(object.playbackDurationSeconds!=null){if($util.Long){(message.playbackDurationSeconds=$util.Long.fromValue(object.playbackDurationSeconds)).unsigned=false}else if(typeof object.playbackDurationSeconds==="string"){message.playbackDurationSeconds=parseInt(object.playbackDurationSeconds,10)}else if(typeof object.playbackDurationSeconds==="number"){message.playbackDurationSeconds=object.playbackDurationSeconds}else if(typeof object.playbackDurationSeconds==="object"){message.playbackDurationSeconds=new $util.LongBits(object.playbackDurationSeconds.low>>>0,object.playbackDurationSeconds.high>>>0).toNumber()}}if(object.licenseDurationSeconds!=null){if($util.Long){(message.licenseDurationSeconds=$util.Long.fromValue(object.licenseDurationSeconds)).unsigned=false}else if(typeof object.licenseDurationSeconds==="string"){message.licenseDurationSeconds=parseInt(object.licenseDurationSeconds,10)}else if(typeof object.licenseDurationSeconds==="number"){message.licenseDurationSeconds=object.licenseDurationSeconds}else if(typeof object.licenseDurationSeconds==="object"){message.licenseDurationSeconds=new $util.LongBits(object.licenseDurationSeconds.low>>>0,object.licenseDurationSeconds.high>>>0).toNumber()}}if(object.renewalRecoveryDurationSeconds!=null){if($util.Long){(message.renewalRecoveryDurationSeconds=$util.Long.fromValue(object.renewalRecoveryDurationSeconds)).unsigned=false}else if(typeof object.renewalRecoveryDurationSeconds==="string"){message.renewalRecoveryDurationSeconds=parseInt(object.renewalRecoveryDurationSeconds,10)}else if(typeof object.renewalRecoveryDurationSeconds==="number"){message.renewalRecoveryDurationSeconds=object.renewalRecoveryDurationSeconds}else if(typeof object.renewalRecoveryDurationSeconds==="object"){message.renewalRecoveryDurationSeconds=new $util.LongBits(object.renewalRecoveryDurationSeconds.low>>>0,object.renewalRecoveryDurationSeconds.high>>>0).toNumber()}}if(object.renewalServerUrl!=null){message.renewalServerUrl=String(object.renewalServerUrl)}if(object.renewalDelaySeconds!=null){if($util.Long){(message.renewalDelaySeconds=$util.Long.fromValue(object.renewalDelaySeconds)).unsigned=false}else if(typeof object.renewalDelaySeconds==="string"){message.renewalDelaySeconds=parseInt(object.renewalDelaySeconds,10)}else if(typeof object.renewalDelaySeconds==="number"){message.renewalDelaySeconds=object.renewalDelaySeconds}else if(typeof object.renewalDelaySeconds==="object"){message.renewalDelaySeconds=new $util.LongBits(object.renewalDelaySeconds.low>>>0,object.renewalDelaySeconds.high>>>0).toNumber()}}if(object.renewalRetryIntervalSeconds!=null){if($util.Long){(message.renewalRetryIntervalSeconds=$util.Long.fromValue(object.renewalRetryIntervalSeconds)).unsigned=false}else if(typeof object.renewalRetryIntervalSeconds==="string"){message.renewalRetryIntervalSeconds=parseInt(object.renewalRetryIntervalSeconds,10)}else if(typeof object.renewalRetryIntervalSeconds==="number"){message.renewalRetryIntervalSeconds=object.renewalRetryIntervalSeconds}else if(typeof object.renewalRetryIntervalSeconds==="object"){message.renewalRetryIntervalSeconds=new $util.LongBits(object.renewalRetryIntervalSeconds.low>>>0,object.renewalRetryIntervalSeconds.high>>>0).toNumber()}}if(object.renewWithUsage!=null){message.renewWithUsage=Boolean(object.renewWithUsage)}if(object.alwaysIncludeClientId!=null){message.alwaysIncludeClientId=Boolean(object.alwaysIncludeClientId)}if(object.playStartGracePeriodSeconds!=null){if($util.Long){(message.playStartGracePeriodSeconds=$util.Long.fromValue(object.playStartGracePeriodSeconds)).unsigned=false}else if(typeof object.playStartGracePeriodSeconds==="string"){message.playStartGracePeriodSeconds=parseInt(object.playStartGracePeriodSeconds,10)}else if(typeof object.playStartGracePeriodSeconds==="number"){message.playStartGracePeriodSeconds=object.playStartGracePeriodSeconds}else if(typeof object.playStartGracePeriodSeconds==="object"){message.playStartGracePeriodSeconds=new $util.LongBits(object.playStartGracePeriodSeconds.low>>>0,object.playStartGracePeriodSeconds.high>>>0).toNumber()}}if(object.softEnforcePlaybackDuration!=null){message.softEnforcePlaybackDuration=Boolean(object.softEnforcePlaybackDuration)}if(object.softEnforceRentalDuration!=null){message.softEnforceRentalDuration=Boolean(object.softEnforceRentalDuration)}return message};Policy.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.canPlay=false;object.canPersist=false;object.canRenew=false;if($util.Long){var long=new $util.Long(0,0,false);object.rentalDurationSeconds=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.rentalDurationSeconds=options.longs===String?"0":0}if($util.Long){var long=new $util.Long(0,0,false);object.playbackDurationSeconds=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.playbackDurationSeconds=options.longs===String?"0":0}if($util.Long){var long=new $util.Long(0,0,false);object.licenseDurationSeconds=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.licenseDurationSeconds=options.longs===String?"0":0}if($util.Long){var long=new $util.Long(0,0,false);object.renewalRecoveryDurationSeconds=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.renewalRecoveryDurationSeconds=options.longs===String?"0":0}object.renewalServerUrl="";if($util.Long){var long=new $util.Long(0,0,false);object.renewalDelaySeconds=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.renewalDelaySeconds=options.longs===String?"0":0}if($util.Long){var long=new $util.Long(0,0,false);object.renewalRetryIntervalSeconds=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.renewalRetryIntervalSeconds=options.longs===String?"0":0}object.renewWithUsage=false;object.alwaysIncludeClientId=false;if($util.Long){var long=new $util.Long(0,0,false);object.playStartGracePeriodSeconds=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.playStartGracePeriodSeconds=options.longs===String?"0":0}object.softEnforcePlaybackDuration=false;object.softEnforceRentalDuration=true}if(message.canPlay!=null&&message.hasOwnProperty("canPlay")){object.canPlay=message.canPlay}if(message.canPersist!=null&&message.hasOwnProperty("canPersist")){object.canPersist=message.canPersist}if(message.canRenew!=null&&message.hasOwnProperty("canRenew")){object.canRenew=message.canRenew}if(message.rentalDurationSeconds!=null&&message.hasOwnProperty("rentalDurationSeconds")){if(typeof message.rentalDurationSeconds==="number"){object.rentalDurationSeconds=options.longs===String?String(message.rentalDurationSeconds):message.rentalDurationSeconds}else{object.rentalDurationSeconds=options.longs===String?$util.Long.prototype.toString.call(message.rentalDurationSeconds):options.longs===Number?new $util.LongBits(message.rentalDurationSeconds.low>>>0,message.rentalDurationSeconds.high>>>0).toNumber():message.rentalDurationSeconds}}if(message.playbackDurationSeconds!=null&&message.hasOwnProperty("playbackDurationSeconds")){if(typeof message.playbackDurationSeconds==="number"){object.playbackDurationSeconds=options.longs===String?String(message.playbackDurationSeconds):message.playbackDurationSeconds}else{object.playbackDurationSeconds=options.longs===String?$util.Long.prototype.toString.call(message.playbackDurationSeconds):options.longs===Number?new $util.LongBits(message.playbackDurationSeconds.low>>>0,message.playbackDurationSeconds.high>>>0).toNumber():message.playbackDurationSeconds}}if(message.licenseDurationSeconds!=null&&message.hasOwnProperty("licenseDurationSeconds")){if(typeof message.licenseDurationSeconds==="number"){object.licenseDurationSeconds=options.longs===String?String(message.licenseDurationSeconds):message.licenseDurationSeconds}else{object.licenseDurationSeconds=options.longs===String?$util.Long.prototype.toString.call(message.licenseDurationSeconds):options.longs===Number?new $util.LongBits(message.licenseDurationSeconds.low>>>0,message.licenseDurationSeconds.high>>>0).toNumber():message.licenseDurationSeconds}}if(message.renewalRecoveryDurationSeconds!=null&&message.hasOwnProperty("renewalRecoveryDurationSeconds")){if(typeof message.renewalRecoveryDurationSeconds==="number"){object.renewalRecoveryDurationSeconds=options.longs===String?String(message.renewalRecoveryDurationSeconds):message.renewalRecoveryDurationSeconds}else{object.renewalRecoveryDurationSeconds=options.longs===String?$util.Long.prototype.toString.call(message.renewalRecoveryDurationSeconds):options.longs===Number?new $util.LongBits(message.renewalRecoveryDurationSeconds.low>>>0,message.renewalRecoveryDurationSeconds.high>>>0).toNumber():message.renewalRecoveryDurationSeconds}}if(message.renewalServerUrl!=null&&message.hasOwnProperty("renewalServerUrl")){object.renewalServerUrl=message.renewalServerUrl}if(message.renewalDelaySeconds!=null&&message.hasOwnProperty("renewalDelaySeconds")){if(typeof message.renewalDelaySeconds==="number"){object.renewalDelaySeconds=options.longs===String?String(message.renewalDelaySeconds):message.renewalDelaySeconds}else{object.renewalDelaySeconds=options.longs===String?$util.Long.prototype.toString.call(message.renewalDelaySeconds):options.longs===Number?new $util.LongBits(message.renewalDelaySeconds.low>>>0,message.renewalDelaySeconds.high>>>0).toNumber():message.renewalDelaySeconds}}if(message.renewalRetryIntervalSeconds!=null&&message.hasOwnProperty("renewalRetryIntervalSeconds")){if(typeof message.renewalRetryIntervalSeconds==="number"){object.renewalRetryIntervalSeconds=options.longs===String?String(message.renewalRetryIntervalSeconds):message.renewalRetryIntervalSeconds}else{object.renewalRetryIntervalSeconds=options.longs===String?$util.Long.prototype.toString.call(message.renewalRetryIntervalSeconds):options.longs===Number?new $util.LongBits(message.renewalRetryIntervalSeconds.low>>>0,message.renewalRetryIntervalSeconds.high>>>0).toNumber():message.renewalRetryIntervalSeconds}}if(message.renewWithUsage!=null&&message.hasOwnProperty("renewWithUsage")){object.renewWithUsage=message.renewWithUsage}if(message.alwaysIncludeClientId!=null&&message.hasOwnProperty("alwaysIncludeClientId")){object.alwaysIncludeClientId=message.alwaysIncludeClientId}if(message.playStartGracePeriodSeconds!=null&&message.hasOwnProperty("playStartGracePeriodSeconds")){if(typeof message.playStartGracePeriodSeconds==="number"){object.playStartGracePeriodSeconds=options.longs===String?String(message.playStartGracePeriodSeconds):message.playStartGracePeriodSeconds}else{object.playStartGracePeriodSeconds=options.longs===String?$util.Long.prototype.toString.call(message.playStartGracePeriodSeconds):options.longs===Number?new $util.LongBits(message.playStartGracePeriodSeconds.low>>>0,message.playStartGracePeriodSeconds.high>>>0).toNumber():message.playStartGracePeriodSeconds}}if(message.softEnforcePlaybackDuration!=null&&message.hasOwnProperty("softEnforcePlaybackDuration")){object.softEnforcePlaybackDuration=message.softEnforcePlaybackDuration}if(message.softEnforceRentalDuration!=null&&message.hasOwnProperty("softEnforceRentalDuration")){object.softEnforceRentalDuration=message.softEnforceRentalDuration}return object};Policy.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};Policy.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.License.Policy"};return Policy})();License.KeyContainer=(function(){function KeyContainer(properties){this.videoResolutionConstraints=[];if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.id=reader.bytes();break}case 2:{message.iv=reader.bytes();break}case 3:{message.key=reader.bytes();break}case 4:{message.type=reader.int32();break}case 5:{message.level=reader.int32();break}case 6:{message.requiredProtection=$root.license_protocol.License.KeyContainer.OutputProtection.decode(reader,reader.uint32());break}case 7:{message.requestedProtection=$root.license_protocol.License.KeyContainer.OutputProtection.decode(reader,reader.uint32());break}case 8:{message.keyControl=$root.license_protocol.License.KeyContainer.KeyControl.decode(reader,reader.uint32());break}case 9:{message.operatorSessionKeyPermissions=$root.license_protocol.License.KeyContainer.OperatorSessionKeyPermissions.decode(reader,reader.uint32());break}case 10:{if(!(message.videoResolutionConstraints&&message.videoResolutionConstraints.length)){message.videoResolutionConstraints=[]}message.videoResolutionConstraints.push($root.license_protocol.License.KeyContainer.VideoResolutionConstraint.decode(reader,reader.uint32()));break}case 11:{message.antiRollbackUsageTable=reader.bool();break}case 12:{message.trackLabel=reader.string();break}default:reader.skipType(tag&7);break}}return message};KeyContainer.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};KeyContainer.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.id!=null&&message.hasOwnProperty("id")){if(!(message.id&&typeof message.id.length==="number"||$util.isString(message.id))){return "id: buffer expected"}}if(message.iv!=null&&message.hasOwnProperty("iv")){if(!(message.iv&&typeof message.iv.length==="number"||$util.isString(message.iv))){return "iv: buffer expected"}}if(message.key!=null&&message.hasOwnProperty("key")){if(!(message.key&&typeof message.key.length==="number"||$util.isString(message.key))){return "key: buffer expected"}}if(message.type!=null&&message.hasOwnProperty("type")){switch(message.type){default:return "type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:break}}if(message.level!=null&&message.hasOwnProperty("level")){switch(message.level){default:return "level: enum value expected";case 1:case 2:case 3:case 4:case 5:break}}if(message.requiredProtection!=null&&message.hasOwnProperty("requiredProtection")){var error=$root.license_protocol.License.KeyContainer.OutputProtection.verify(message.requiredProtection);if(error){return "requiredProtection."+error}}if(message.requestedProtection!=null&&message.hasOwnProperty("requestedProtection")){var error=$root.license_protocol.License.KeyContainer.OutputProtection.verify(message.requestedProtection);if(error){return "requestedProtection."+error}}if(message.keyControl!=null&&message.hasOwnProperty("keyControl")){var error=$root.license_protocol.License.KeyContainer.KeyControl.verify(message.keyControl);if(error){return "keyControl."+error}}if(message.operatorSessionKeyPermissions!=null&&message.hasOwnProperty("operatorSessionKeyPermissions")){var error=$root.license_protocol.License.KeyContainer.OperatorSessionKeyPermissions.verify(message.operatorSessionKeyPermissions);if(error){return "operatorSessionKeyPermissions."+error}}if(message.videoResolutionConstraints!=null&&message.hasOwnProperty("videoResolutionConstraints")){if(!Array.isArray(message.videoResolutionConstraints)){return "videoResolutionConstraints: array expected"}for(var i=0;i=0){message.id=object.id}}if(object.iv!=null){if(typeof object.iv==="string"){$util.base64.decode(object.iv,message.iv=$util.newBuffer($util.base64.length(object.iv)),0)}else if(object.iv.length>=0){message.iv=object.iv}}if(object.key!=null){if(typeof object.key==="string"){$util.base64.decode(object.key,message.key=$util.newBuffer($util.base64.length(object.key)),0)}else if(object.key.length>=0){message.key=object.key}}switch(object.type){default:if(typeof object.type==="number"){message.type=object.type;break}break;case "SIGNING":case 1:message.type=1;break;case "CONTENT":case 2:message.type=2;break;case "KEY_CONTROL":case 3:message.type=3;break;case "OPERATOR_SESSION":case 4:message.type=4;break;case "ENTITLEMENT":case 5:message.type=5;break;case "OEM_CONTENT":case 6:message.type=6;break}switch(object.level){default:if(typeof object.level==="number"){message.level=object.level;break}break;case "SW_SECURE_CRYPTO":case 1:message.level=1;break;case "SW_SECURE_DECODE":case 2:message.level=2;break;case "HW_SECURE_CRYPTO":case 3:message.level=3;break;case "HW_SECURE_DECODE":case 4:message.level=4;break;case "HW_SECURE_ALL":case 5:message.level=5;break}if(object.requiredProtection!=null){if(typeof object.requiredProtection!=="object"){throw TypeError(".license_protocol.License.KeyContainer.requiredProtection: object expected")}message.requiredProtection=$root.license_protocol.License.KeyContainer.OutputProtection.fromObject(object.requiredProtection)}if(object.requestedProtection!=null){if(typeof object.requestedProtection!=="object"){throw TypeError(".license_protocol.License.KeyContainer.requestedProtection: object expected")}message.requestedProtection=$root.license_protocol.License.KeyContainer.OutputProtection.fromObject(object.requestedProtection)}if(object.keyControl!=null){if(typeof object.keyControl!=="object"){throw TypeError(".license_protocol.License.KeyContainer.keyControl: object expected")}message.keyControl=$root.license_protocol.License.KeyContainer.KeyControl.fromObject(object.keyControl)}if(object.operatorSessionKeyPermissions!=null){if(typeof object.operatorSessionKeyPermissions!=="object"){throw TypeError(".license_protocol.License.KeyContainer.operatorSessionKeyPermissions: object expected")}message.operatorSessionKeyPermissions=$root.license_protocol.License.KeyContainer.OperatorSessionKeyPermissions.fromObject(object.operatorSessionKeyPermissions)}if(object.videoResolutionConstraints){if(!Array.isArray(object.videoResolutionConstraints)){throw TypeError(".license_protocol.License.KeyContainer.videoResolutionConstraints: array expected")}message.videoResolutionConstraints=[];for(var i=0;i>>3){case 1:{message.keyControlBlock=reader.bytes();break}case 2:{message.iv=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};KeyControl.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};KeyControl.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.keyControlBlock!=null&&message.hasOwnProperty("keyControlBlock")){if(!(message.keyControlBlock&&typeof message.keyControlBlock.length==="number"||$util.isString(message.keyControlBlock))){return "keyControlBlock: buffer expected"}}if(message.iv!=null&&message.hasOwnProperty("iv")){if(!(message.iv&&typeof message.iv.length==="number"||$util.isString(message.iv))){return "iv: buffer expected"}}return null};KeyControl.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.License.KeyContainer.KeyControl){return object}var message=new $root.license_protocol.License.KeyContainer.KeyControl();if(object.keyControlBlock!=null){if(typeof object.keyControlBlock==="string"){$util.base64.decode(object.keyControlBlock,message.keyControlBlock=$util.newBuffer($util.base64.length(object.keyControlBlock)),0)}else if(object.keyControlBlock.length>=0){message.keyControlBlock=object.keyControlBlock}}if(object.iv!=null){if(typeof object.iv==="string"){$util.base64.decode(object.iv,message.iv=$util.newBuffer($util.base64.length(object.iv)),0)}else if(object.iv.length>=0){message.iv=object.iv}}return message};KeyControl.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){if(options.bytes===String){object.keyControlBlock=""}else{object.keyControlBlock=[];if(options.bytes!==Array){object.keyControlBlock=$util.newBuffer(object.keyControlBlock)}}if(options.bytes===String){object.iv=""}else{object.iv=[];if(options.bytes!==Array){object.iv=$util.newBuffer(object.iv)}}}if(message.keyControlBlock!=null&&message.hasOwnProperty("keyControlBlock")){object.keyControlBlock=options.bytes===String?$util.base64.encode(message.keyControlBlock,0,message.keyControlBlock.length):options.bytes===Array?Array.prototype.slice.call(message.keyControlBlock):message.keyControlBlock}if(message.iv!=null&&message.hasOwnProperty("iv")){object.iv=options.bytes===String?$util.base64.encode(message.iv,0,message.iv.length):options.bytes===Array?Array.prototype.slice.call(message.iv):message.iv}return object};KeyControl.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};KeyControl.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.License.KeyContainer.KeyControl"};return KeyControl})();KeyContainer.OutputProtection=(function(){function OutputProtection(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.hdcp=reader.int32();break}case 2:{message.cgmsFlags=reader.int32();break}case 3:{message.hdcpSrmRule=reader.int32();break}case 4:{message.disableAnalogOutput=reader.bool();break}case 5:{message.disableDigitalOutput=reader.bool();break}default:reader.skipType(tag&7);break}}return message};OutputProtection.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};OutputProtection.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.hdcp!=null&&message.hasOwnProperty("hdcp")){switch(message.hdcp){default:return "hdcp: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 255:break}}if(message.cgmsFlags!=null&&message.hasOwnProperty("cgmsFlags")){switch(message.cgmsFlags){default:return "cgmsFlags: enum value expected";case 42:case 0:case 2:case 3:break}}if(message.hdcpSrmRule!=null&&message.hasOwnProperty("hdcpSrmRule")){switch(message.hdcpSrmRule){default:return "hdcpSrmRule: enum value expected";case 0:case 1:break}}if(message.disableAnalogOutput!=null&&message.hasOwnProperty("disableAnalogOutput")){if(typeof message.disableAnalogOutput!=="boolean"){return "disableAnalogOutput: boolean expected"}}if(message.disableDigitalOutput!=null&&message.hasOwnProperty("disableDigitalOutput")){if(typeof message.disableDigitalOutput!=="boolean"){return "disableDigitalOutput: boolean expected"}}return null};OutputProtection.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.License.KeyContainer.OutputProtection){return object}var message=new $root.license_protocol.License.KeyContainer.OutputProtection();switch(object.hdcp){default:if(typeof object.hdcp==="number"){message.hdcp=object.hdcp;break}break;case "HDCP_NONE":case 0:message.hdcp=0;break;case "HDCP_V1":case 1:message.hdcp=1;break;case "HDCP_V2":case 2:message.hdcp=2;break;case "HDCP_V2_1":case 3:message.hdcp=3;break;case "HDCP_V2_2":case 4:message.hdcp=4;break;case "HDCP_V2_3":case 5:message.hdcp=5;break;case "HDCP_NO_DIGITAL_OUTPUT":case 255:message.hdcp=255;break}switch(object.cgmsFlags){default:if(typeof object.cgmsFlags==="number"){message.cgmsFlags=object.cgmsFlags;break}break;case "CGMS_NONE":case 42:message.cgmsFlags=42;break;case "COPY_FREE":case 0:message.cgmsFlags=0;break;case "COPY_ONCE":case 2:message.cgmsFlags=2;break;case "COPY_NEVER":case 3:message.cgmsFlags=3;break}switch(object.hdcpSrmRule){default:if(typeof object.hdcpSrmRule==="number"){message.hdcpSrmRule=object.hdcpSrmRule;break}break;case "HDCP_SRM_RULE_NONE":case 0:message.hdcpSrmRule=0;break;case "CURRENT_SRM":case 1:message.hdcpSrmRule=1;break}if(object.disableAnalogOutput!=null){message.disableAnalogOutput=Boolean(object.disableAnalogOutput)}if(object.disableDigitalOutput!=null){message.disableDigitalOutput=Boolean(object.disableDigitalOutput)}return message};OutputProtection.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.hdcp=options.enums===String?"HDCP_NONE":0;object.cgmsFlags=options.enums===String?"CGMS_NONE":42;object.hdcpSrmRule=options.enums===String?"HDCP_SRM_RULE_NONE":0;object.disableAnalogOutput=false;object.disableDigitalOutput=false}if(message.hdcp!=null&&message.hasOwnProperty("hdcp")){object.hdcp=options.enums===String?$root.license_protocol.License.KeyContainer.OutputProtection.HDCP[message.hdcp]===undefined?message.hdcp:$root.license_protocol.License.KeyContainer.OutputProtection.HDCP[message.hdcp]:message.hdcp}if(message.cgmsFlags!=null&&message.hasOwnProperty("cgmsFlags")){object.cgmsFlags=options.enums===String?$root.license_protocol.License.KeyContainer.OutputProtection.CGMS[message.cgmsFlags]===undefined?message.cgmsFlags:$root.license_protocol.License.KeyContainer.OutputProtection.CGMS[message.cgmsFlags]:message.cgmsFlags}if(message.hdcpSrmRule!=null&&message.hasOwnProperty("hdcpSrmRule")){object.hdcpSrmRule=options.enums===String?$root.license_protocol.License.KeyContainer.OutputProtection.HdcpSrmRule[message.hdcpSrmRule]===undefined?message.hdcpSrmRule:$root.license_protocol.License.KeyContainer.OutputProtection.HdcpSrmRule[message.hdcpSrmRule]:message.hdcpSrmRule}if(message.disableAnalogOutput!=null&&message.hasOwnProperty("disableAnalogOutput")){object.disableAnalogOutput=message.disableAnalogOutput}if(message.disableDigitalOutput!=null&&message.hasOwnProperty("disableDigitalOutput")){object.disableDigitalOutput=message.disableDigitalOutput}return object};OutputProtection.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};OutputProtection.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.License.KeyContainer.OutputProtection"};OutputProtection.HDCP=(function(){var valuesById={},values=Object.create(valuesById);values[valuesById[0]="HDCP_NONE"]=0;values[valuesById[1]="HDCP_V1"]=1;values[valuesById[2]="HDCP_V2"]=2;values[valuesById[3]="HDCP_V2_1"]=3;values[valuesById[4]="HDCP_V2_2"]=4;values[valuesById[5]="HDCP_V2_3"]=5;values[valuesById[255]="HDCP_NO_DIGITAL_OUTPUT"]=255;return values})();OutputProtection.CGMS=(function(){var valuesById={},values=Object.create(valuesById);values[valuesById[42]="CGMS_NONE"]=42;values[valuesById[0]="COPY_FREE"]=0;values[valuesById[2]="COPY_ONCE"]=2;values[valuesById[3]="COPY_NEVER"]=3;return values})();OutputProtection.HdcpSrmRule=(function(){var valuesById={},values=Object.create(valuesById);values[valuesById[0]="HDCP_SRM_RULE_NONE"]=0;values[valuesById[1]="CURRENT_SRM"]=1;return values})();return OutputProtection})();KeyContainer.VideoResolutionConstraint=(function(){function VideoResolutionConstraint(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.minResolutionPixels=reader.uint32();break}case 2:{message.maxResolutionPixels=reader.uint32();break}case 3:{message.requiredProtection=$root.license_protocol.License.KeyContainer.OutputProtection.decode(reader,reader.uint32());break}default:reader.skipType(tag&7);break}}return message};VideoResolutionConstraint.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};VideoResolutionConstraint.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.minResolutionPixels!=null&&message.hasOwnProperty("minResolutionPixels")){if(!$util.isInteger(message.minResolutionPixels)){return "minResolutionPixels: integer expected"}}if(message.maxResolutionPixels!=null&&message.hasOwnProperty("maxResolutionPixels")){if(!$util.isInteger(message.maxResolutionPixels)){return "maxResolutionPixels: integer expected"}}if(message.requiredProtection!=null&&message.hasOwnProperty("requiredProtection")){var error=$root.license_protocol.License.KeyContainer.OutputProtection.verify(message.requiredProtection);if(error){return "requiredProtection."+error}}return null};VideoResolutionConstraint.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.License.KeyContainer.VideoResolutionConstraint){return object}var message=new $root.license_protocol.License.KeyContainer.VideoResolutionConstraint();if(object.minResolutionPixels!=null){message.minResolutionPixels=object.minResolutionPixels>>>0}if(object.maxResolutionPixels!=null){message.maxResolutionPixels=object.maxResolutionPixels>>>0}if(object.requiredProtection!=null){if(typeof object.requiredProtection!=="object"){throw TypeError(".license_protocol.License.KeyContainer.VideoResolutionConstraint.requiredProtection: object expected")}message.requiredProtection=$root.license_protocol.License.KeyContainer.OutputProtection.fromObject(object.requiredProtection)}return message};VideoResolutionConstraint.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.minResolutionPixels=0;object.maxResolutionPixels=0;object.requiredProtection=null}if(message.minResolutionPixels!=null&&message.hasOwnProperty("minResolutionPixels")){object.minResolutionPixels=message.minResolutionPixels}if(message.maxResolutionPixels!=null&&message.hasOwnProperty("maxResolutionPixels")){object.maxResolutionPixels=message.maxResolutionPixels}if(message.requiredProtection!=null&&message.hasOwnProperty("requiredProtection")){object.requiredProtection=$root.license_protocol.License.KeyContainer.OutputProtection.toObject(message.requiredProtection,options)}return object};VideoResolutionConstraint.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};VideoResolutionConstraint.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.License.KeyContainer.VideoResolutionConstraint"};return VideoResolutionConstraint})();KeyContainer.OperatorSessionKeyPermissions=(function(){function OperatorSessionKeyPermissions(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.allowEncrypt=reader.bool();break}case 2:{message.allowDecrypt=reader.bool();break}case 3:{message.allowSign=reader.bool();break}case 4:{message.allowSignatureVerify=reader.bool();break}default:reader.skipType(tag&7);break}}return message};OperatorSessionKeyPermissions.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};OperatorSessionKeyPermissions.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.allowEncrypt!=null&&message.hasOwnProperty("allowEncrypt")){if(typeof message.allowEncrypt!=="boolean"){return "allowEncrypt: boolean expected"}}if(message.allowDecrypt!=null&&message.hasOwnProperty("allowDecrypt")){if(typeof message.allowDecrypt!=="boolean"){return "allowDecrypt: boolean expected"}}if(message.allowSign!=null&&message.hasOwnProperty("allowSign")){if(typeof message.allowSign!=="boolean"){return "allowSign: boolean expected"}}if(message.allowSignatureVerify!=null&&message.hasOwnProperty("allowSignatureVerify")){if(typeof message.allowSignatureVerify!=="boolean"){return "allowSignatureVerify: boolean expected"}}return null};OperatorSessionKeyPermissions.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.License.KeyContainer.OperatorSessionKeyPermissions){return object}var message=new $root.license_protocol.License.KeyContainer.OperatorSessionKeyPermissions();if(object.allowEncrypt!=null){message.allowEncrypt=Boolean(object.allowEncrypt)}if(object.allowDecrypt!=null){message.allowDecrypt=Boolean(object.allowDecrypt)}if(object.allowSign!=null){message.allowSign=Boolean(object.allowSign)}if(object.allowSignatureVerify!=null){message.allowSignatureVerify=Boolean(object.allowSignatureVerify)}return message};OperatorSessionKeyPermissions.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.allowEncrypt=false;object.allowDecrypt=false;object.allowSign=false;object.allowSignatureVerify=false}if(message.allowEncrypt!=null&&message.hasOwnProperty("allowEncrypt")){object.allowEncrypt=message.allowEncrypt}if(message.allowDecrypt!=null&&message.hasOwnProperty("allowDecrypt")){object.allowDecrypt=message.allowDecrypt}if(message.allowSign!=null&&message.hasOwnProperty("allowSign")){object.allowSign=message.allowSign}if(message.allowSignatureVerify!=null&&message.hasOwnProperty("allowSignatureVerify")){object.allowSignatureVerify=message.allowSignatureVerify}return object};OperatorSessionKeyPermissions.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};OperatorSessionKeyPermissions.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.License.KeyContainer.OperatorSessionKeyPermissions"};return OperatorSessionKeyPermissions})();return KeyContainer})();return License})();license_protocol.ProtocolVersion=(function(){var valuesById={},values=Object.create(valuesById);values[valuesById[20]="VERSION_2_0"]=20;values[valuesById[21]="VERSION_2_1"]=21;values[valuesById[22]="VERSION_2_2"]=22;return values})();license_protocol.LicenseRequest=(function(){function LicenseRequest(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.clientId=$root.license_protocol.ClientIdentification.decode(reader,reader.uint32());break}case 2:{message.contentId=$root.license_protocol.LicenseRequest.ContentIdentification.decode(reader,reader.uint32());break}case 3:{message.type=reader.int32();break}case 4:{message.requestTime=reader.int64();break}case 5:{message.keyControlNonceDeprecated=reader.bytes();break}case 6:{message.protocolVersion=reader.int32();break}case 7:{message.keyControlNonce=reader.uint32();break}case 8:{message.encryptedClientId=$root.license_protocol.EncryptedClientIdentification.decode(reader,reader.uint32());break}default:reader.skipType(tag&7);break}}return message};LicenseRequest.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};LicenseRequest.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.clientId!=null&&message.hasOwnProperty("clientId")){var error=$root.license_protocol.ClientIdentification.verify(message.clientId);if(error){return "clientId."+error}}if(message.contentId!=null&&message.hasOwnProperty("contentId")){var error=$root.license_protocol.LicenseRequest.ContentIdentification.verify(message.contentId);if(error){return "contentId."+error}}if(message.type!=null&&message.hasOwnProperty("type")){switch(message.type){default:return "type: enum value expected";case 1:case 2:case 3:break}}if(message.requestTime!=null&&message.hasOwnProperty("requestTime")){if(!$util.isInteger(message.requestTime)&&!(message.requestTime&&$util.isInteger(message.requestTime.low)&&$util.isInteger(message.requestTime.high))){return "requestTime: integer|Long expected"}}if(message.keyControlNonceDeprecated!=null&&message.hasOwnProperty("keyControlNonceDeprecated")){if(!(message.keyControlNonceDeprecated&&typeof message.keyControlNonceDeprecated.length==="number"||$util.isString(message.keyControlNonceDeprecated))){return "keyControlNonceDeprecated: buffer expected"}}if(message.protocolVersion!=null&&message.hasOwnProperty("protocolVersion")){switch(message.protocolVersion){default:return "protocolVersion: enum value expected";case 20:case 21:case 22:break}}if(message.keyControlNonce!=null&&message.hasOwnProperty("keyControlNonce")){if(!$util.isInteger(message.keyControlNonce)){return "keyControlNonce: integer expected"}}if(message.encryptedClientId!=null&&message.hasOwnProperty("encryptedClientId")){var error=$root.license_protocol.EncryptedClientIdentification.verify(message.encryptedClientId);if(error){return "encryptedClientId."+error}}return null};LicenseRequest.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.LicenseRequest){return object}var message=new $root.license_protocol.LicenseRequest();if(object.clientId!=null){if(typeof object.clientId!=="object"){throw TypeError(".license_protocol.LicenseRequest.clientId: object expected")}message.clientId=$root.license_protocol.ClientIdentification.fromObject(object.clientId)}if(object.contentId!=null){if(typeof object.contentId!=="object"){throw TypeError(".license_protocol.LicenseRequest.contentId: object expected")}message.contentId=$root.license_protocol.LicenseRequest.ContentIdentification.fromObject(object.contentId)}switch(object.type){default:if(typeof object.type==="number"){message.type=object.type;break}break;case "NEW":case 1:message.type=1;break;case "RENEWAL":case 2:message.type=2;break;case "RELEASE":case 3:message.type=3;break}if(object.requestTime!=null){if($util.Long){(message.requestTime=$util.Long.fromValue(object.requestTime)).unsigned=false}else if(typeof object.requestTime==="string"){message.requestTime=parseInt(object.requestTime,10)}else if(typeof object.requestTime==="number"){message.requestTime=object.requestTime}else if(typeof object.requestTime==="object"){message.requestTime=new $util.LongBits(object.requestTime.low>>>0,object.requestTime.high>>>0).toNumber()}}if(object.keyControlNonceDeprecated!=null){if(typeof object.keyControlNonceDeprecated==="string"){$util.base64.decode(object.keyControlNonceDeprecated,message.keyControlNonceDeprecated=$util.newBuffer($util.base64.length(object.keyControlNonceDeprecated)),0)}else if(object.keyControlNonceDeprecated.length>=0){message.keyControlNonceDeprecated=object.keyControlNonceDeprecated}}switch(object.protocolVersion){default:if(typeof object.protocolVersion==="number"){message.protocolVersion=object.protocolVersion;break}break;case "VERSION_2_0":case 20:message.protocolVersion=20;break;case "VERSION_2_1":case 21:message.protocolVersion=21;break;case "VERSION_2_2":case 22:message.protocolVersion=22;break}if(object.keyControlNonce!=null){message.keyControlNonce=object.keyControlNonce>>>0}if(object.encryptedClientId!=null){if(typeof object.encryptedClientId!=="object"){throw TypeError(".license_protocol.LicenseRequest.encryptedClientId: object expected")}message.encryptedClientId=$root.license_protocol.EncryptedClientIdentification.fromObject(object.encryptedClientId)}return message};LicenseRequest.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.clientId=null;object.contentId=null;object.type=options.enums===String?"NEW":1;if($util.Long){var long=new $util.Long(0,0,false);object.requestTime=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.requestTime=options.longs===String?"0":0}if(options.bytes===String){object.keyControlNonceDeprecated=""}else{object.keyControlNonceDeprecated=[];if(options.bytes!==Array){object.keyControlNonceDeprecated=$util.newBuffer(object.keyControlNonceDeprecated)}}object.protocolVersion=options.enums===String?"VERSION_2_0":20;object.keyControlNonce=0;object.encryptedClientId=null}if(message.clientId!=null&&message.hasOwnProperty("clientId")){object.clientId=$root.license_protocol.ClientIdentification.toObject(message.clientId,options)}if(message.contentId!=null&&message.hasOwnProperty("contentId")){object.contentId=$root.license_protocol.LicenseRequest.ContentIdentification.toObject(message.contentId,options)}if(message.type!=null&&message.hasOwnProperty("type")){object.type=options.enums===String?$root.license_protocol.LicenseRequest.RequestType[message.type]===undefined?message.type:$root.license_protocol.LicenseRequest.RequestType[message.type]:message.type}if(message.requestTime!=null&&message.hasOwnProperty("requestTime")){if(typeof message.requestTime==="number"){object.requestTime=options.longs===String?String(message.requestTime):message.requestTime}else{object.requestTime=options.longs===String?$util.Long.prototype.toString.call(message.requestTime):options.longs===Number?new $util.LongBits(message.requestTime.low>>>0,message.requestTime.high>>>0).toNumber():message.requestTime}}if(message.keyControlNonceDeprecated!=null&&message.hasOwnProperty("keyControlNonceDeprecated")){object.keyControlNonceDeprecated=options.bytes===String?$util.base64.encode(message.keyControlNonceDeprecated,0,message.keyControlNonceDeprecated.length):options.bytes===Array?Array.prototype.slice.call(message.keyControlNonceDeprecated):message.keyControlNonceDeprecated}if(message.protocolVersion!=null&&message.hasOwnProperty("protocolVersion")){object.protocolVersion=options.enums===String?$root.license_protocol.ProtocolVersion[message.protocolVersion]===undefined?message.protocolVersion:$root.license_protocol.ProtocolVersion[message.protocolVersion]:message.protocolVersion}if(message.keyControlNonce!=null&&message.hasOwnProperty("keyControlNonce")){object.keyControlNonce=message.keyControlNonce}if(message.encryptedClientId!=null&&message.hasOwnProperty("encryptedClientId")){object.encryptedClientId=$root.license_protocol.EncryptedClientIdentification.toObject(message.encryptedClientId,options)}return object};LicenseRequest.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};LicenseRequest.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.LicenseRequest"};LicenseRequest.ContentIdentification=(function(){function ContentIdentification(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.widevinePsshData=$root.license_protocol.LicenseRequest.ContentIdentification.WidevinePsshData.decode(reader,reader.uint32());break}case 2:{message.webmKeyId=$root.license_protocol.LicenseRequest.ContentIdentification.WebmKeyId.decode(reader,reader.uint32());break}case 3:{message.existingLicense=$root.license_protocol.LicenseRequest.ContentIdentification.ExistingLicense.decode(reader,reader.uint32());break}case 4:{message.initData=$root.license_protocol.LicenseRequest.ContentIdentification.InitData.decode(reader,reader.uint32());break}default:reader.skipType(tag&7);break}}return message};ContentIdentification.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};ContentIdentification.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}var properties={};if(message.widevinePsshData!=null&&message.hasOwnProperty("widevinePsshData")){properties.contentIdVariant=1;{var error=$root.license_protocol.LicenseRequest.ContentIdentification.WidevinePsshData.verify(message.widevinePsshData);if(error){return "widevinePsshData."+error}}}if(message.webmKeyId!=null&&message.hasOwnProperty("webmKeyId")){if(properties.contentIdVariant===1){return "contentIdVariant: multiple values"}properties.contentIdVariant=1;{var error=$root.license_protocol.LicenseRequest.ContentIdentification.WebmKeyId.verify(message.webmKeyId);if(error){return "webmKeyId."+error}}}if(message.existingLicense!=null&&message.hasOwnProperty("existingLicense")){if(properties.contentIdVariant===1){return "contentIdVariant: multiple values"}properties.contentIdVariant=1;{var error=$root.license_protocol.LicenseRequest.ContentIdentification.ExistingLicense.verify(message.existingLicense);if(error){return "existingLicense."+error}}}if(message.initData!=null&&message.hasOwnProperty("initData")){if(properties.contentIdVariant===1){return "contentIdVariant: multiple values"}properties.contentIdVariant=1;{var error=$root.license_protocol.LicenseRequest.ContentIdentification.InitData.verify(message.initData);if(error){return "initData."+error}}}return null};ContentIdentification.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.LicenseRequest.ContentIdentification){return object}var message=new $root.license_protocol.LicenseRequest.ContentIdentification();if(object.widevinePsshData!=null){if(typeof object.widevinePsshData!=="object"){throw TypeError(".license_protocol.LicenseRequest.ContentIdentification.widevinePsshData: object expected")}message.widevinePsshData=$root.license_protocol.LicenseRequest.ContentIdentification.WidevinePsshData.fromObject(object.widevinePsshData)}if(object.webmKeyId!=null){if(typeof object.webmKeyId!=="object"){throw TypeError(".license_protocol.LicenseRequest.ContentIdentification.webmKeyId: object expected")}message.webmKeyId=$root.license_protocol.LicenseRequest.ContentIdentification.WebmKeyId.fromObject(object.webmKeyId)}if(object.existingLicense!=null){if(typeof object.existingLicense!=="object"){throw TypeError(".license_protocol.LicenseRequest.ContentIdentification.existingLicense: object expected")}message.existingLicense=$root.license_protocol.LicenseRequest.ContentIdentification.ExistingLicense.fromObject(object.existingLicense)}if(object.initData!=null){if(typeof object.initData!=="object"){throw TypeError(".license_protocol.LicenseRequest.ContentIdentification.initData: object expected")}message.initData=$root.license_protocol.LicenseRequest.ContentIdentification.InitData.fromObject(object.initData)}return message};ContentIdentification.toObject=function toObject(message,options){if(!options){options={}}var object={};if(message.widevinePsshData!=null&&message.hasOwnProperty("widevinePsshData")){object.widevinePsshData=$root.license_protocol.LicenseRequest.ContentIdentification.WidevinePsshData.toObject(message.widevinePsshData,options);if(options.oneofs){object.contentIdVariant="widevinePsshData"}}if(message.webmKeyId!=null&&message.hasOwnProperty("webmKeyId")){object.webmKeyId=$root.license_protocol.LicenseRequest.ContentIdentification.WebmKeyId.toObject(message.webmKeyId,options);if(options.oneofs){object.contentIdVariant="webmKeyId"}}if(message.existingLicense!=null&&message.hasOwnProperty("existingLicense")){object.existingLicense=$root.license_protocol.LicenseRequest.ContentIdentification.ExistingLicense.toObject(message.existingLicense,options);if(options.oneofs){object.contentIdVariant="existingLicense"}}if(message.initData!=null&&message.hasOwnProperty("initData")){object.initData=$root.license_protocol.LicenseRequest.ContentIdentification.InitData.toObject(message.initData,options);if(options.oneofs){object.contentIdVariant="initData"}}return object};ContentIdentification.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};ContentIdentification.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.LicenseRequest.ContentIdentification"};ContentIdentification.WidevinePsshData=(function(){function WidevinePsshData(properties){this.psshData=[];if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{if(!(message.psshData&&message.psshData.length)){message.psshData=[]}message.psshData.push(reader.bytes());break}case 2:{message.licenseType=reader.int32();break}case 3:{message.requestId=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};WidevinePsshData.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};WidevinePsshData.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.psshData!=null&&message.hasOwnProperty("psshData")){if(!Array.isArray(message.psshData)){return "psshData: array expected"}for(var i=0;i=0){message.psshData[i]=object.psshData[i]}}}switch(object.licenseType){default:if(typeof object.licenseType==="number"){message.licenseType=object.licenseType;break}break;case "STREAMING":case 1:message.licenseType=1;break;case "OFFLINE":case 2:message.licenseType=2;break;case "AUTOMATIC":case 3:message.licenseType=3;break}if(object.requestId!=null){if(typeof object.requestId==="string"){$util.base64.decode(object.requestId,message.requestId=$util.newBuffer($util.base64.length(object.requestId)),0)}else if(object.requestId.length>=0){message.requestId=object.requestId}}return message};WidevinePsshData.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.arrays||options.defaults){object.psshData=[]}if(options.defaults){object.licenseType=options.enums===String?"STREAMING":1;if(options.bytes===String){object.requestId=""}else{object.requestId=[];if(options.bytes!==Array){object.requestId=$util.newBuffer(object.requestId)}}}if(message.psshData&&message.psshData.length){object.psshData=[];for(var j=0;j>>3){case 1:{message.header=reader.bytes();break}case 2:{message.licenseType=reader.int32();break}case 3:{message.requestId=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};WebmKeyId.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};WebmKeyId.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.header!=null&&message.hasOwnProperty("header")){if(!(message.header&&typeof message.header.length==="number"||$util.isString(message.header))){return "header: buffer expected"}}if(message.licenseType!=null&&message.hasOwnProperty("licenseType")){switch(message.licenseType){default:return "licenseType: enum value expected";case 1:case 2:case 3:break}}if(message.requestId!=null&&message.hasOwnProperty("requestId")){if(!(message.requestId&&typeof message.requestId.length==="number"||$util.isString(message.requestId))){return "requestId: buffer expected"}}return null};WebmKeyId.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.LicenseRequest.ContentIdentification.WebmKeyId){return object}var message=new $root.license_protocol.LicenseRequest.ContentIdentification.WebmKeyId();if(object.header!=null){if(typeof object.header==="string"){$util.base64.decode(object.header,message.header=$util.newBuffer($util.base64.length(object.header)),0)}else if(object.header.length>=0){message.header=object.header}}switch(object.licenseType){default:if(typeof object.licenseType==="number"){message.licenseType=object.licenseType;break}break;case "STREAMING":case 1:message.licenseType=1;break;case "OFFLINE":case 2:message.licenseType=2;break;case "AUTOMATIC":case 3:message.licenseType=3;break}if(object.requestId!=null){if(typeof object.requestId==="string"){$util.base64.decode(object.requestId,message.requestId=$util.newBuffer($util.base64.length(object.requestId)),0)}else if(object.requestId.length>=0){message.requestId=object.requestId}}return message};WebmKeyId.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){if(options.bytes===String){object.header=""}else{object.header=[];if(options.bytes!==Array){object.header=$util.newBuffer(object.header)}}object.licenseType=options.enums===String?"STREAMING":1;if(options.bytes===String){object.requestId=""}else{object.requestId=[];if(options.bytes!==Array){object.requestId=$util.newBuffer(object.requestId)}}}if(message.header!=null&&message.hasOwnProperty("header")){object.header=options.bytes===String?$util.base64.encode(message.header,0,message.header.length):options.bytes===Array?Array.prototype.slice.call(message.header):message.header}if(message.licenseType!=null&&message.hasOwnProperty("licenseType")){object.licenseType=options.enums===String?$root.license_protocol.LicenseType[message.licenseType]===undefined?message.licenseType:$root.license_protocol.LicenseType[message.licenseType]:message.licenseType}if(message.requestId!=null&&message.hasOwnProperty("requestId")){object.requestId=options.bytes===String?$util.base64.encode(message.requestId,0,message.requestId.length):options.bytes===Array?Array.prototype.slice.call(message.requestId):message.requestId}return object};WebmKeyId.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};WebmKeyId.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.LicenseRequest.ContentIdentification.WebmKeyId"};return WebmKeyId})();ContentIdentification.ExistingLicense=(function(){function ExistingLicense(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.licenseId=$root.license_protocol.LicenseIdentification.decode(reader,reader.uint32());break}case 2:{message.secondsSinceStarted=reader.int64();break}case 3:{message.secondsSinceLastPlayed=reader.int64();break}case 4:{message.sessionUsageTableEntry=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};ExistingLicense.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};ExistingLicense.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.licenseId!=null&&message.hasOwnProperty("licenseId")){var error=$root.license_protocol.LicenseIdentification.verify(message.licenseId);if(error){return "licenseId."+error}}if(message.secondsSinceStarted!=null&&message.hasOwnProperty("secondsSinceStarted")){if(!$util.isInteger(message.secondsSinceStarted)&&!(message.secondsSinceStarted&&$util.isInteger(message.secondsSinceStarted.low)&&$util.isInteger(message.secondsSinceStarted.high))){return "secondsSinceStarted: integer|Long expected"}}if(message.secondsSinceLastPlayed!=null&&message.hasOwnProperty("secondsSinceLastPlayed")){if(!$util.isInteger(message.secondsSinceLastPlayed)&&!(message.secondsSinceLastPlayed&&$util.isInteger(message.secondsSinceLastPlayed.low)&&$util.isInteger(message.secondsSinceLastPlayed.high))){return "secondsSinceLastPlayed: integer|Long expected"}}if(message.sessionUsageTableEntry!=null&&message.hasOwnProperty("sessionUsageTableEntry")){if(!(message.sessionUsageTableEntry&&typeof message.sessionUsageTableEntry.length==="number"||$util.isString(message.sessionUsageTableEntry))){return "sessionUsageTableEntry: buffer expected"}}return null};ExistingLicense.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.LicenseRequest.ContentIdentification.ExistingLicense){return object}var message=new $root.license_protocol.LicenseRequest.ContentIdentification.ExistingLicense();if(object.licenseId!=null){if(typeof object.licenseId!=="object"){throw TypeError(".license_protocol.LicenseRequest.ContentIdentification.ExistingLicense.licenseId: object expected")}message.licenseId=$root.license_protocol.LicenseIdentification.fromObject(object.licenseId)}if(object.secondsSinceStarted!=null){if($util.Long){(message.secondsSinceStarted=$util.Long.fromValue(object.secondsSinceStarted)).unsigned=false}else if(typeof object.secondsSinceStarted==="string"){message.secondsSinceStarted=parseInt(object.secondsSinceStarted,10)}else if(typeof object.secondsSinceStarted==="number"){message.secondsSinceStarted=object.secondsSinceStarted}else if(typeof object.secondsSinceStarted==="object"){message.secondsSinceStarted=new $util.LongBits(object.secondsSinceStarted.low>>>0,object.secondsSinceStarted.high>>>0).toNumber()}}if(object.secondsSinceLastPlayed!=null){if($util.Long){(message.secondsSinceLastPlayed=$util.Long.fromValue(object.secondsSinceLastPlayed)).unsigned=false}else if(typeof object.secondsSinceLastPlayed==="string"){message.secondsSinceLastPlayed=parseInt(object.secondsSinceLastPlayed,10)}else if(typeof object.secondsSinceLastPlayed==="number"){message.secondsSinceLastPlayed=object.secondsSinceLastPlayed}else if(typeof object.secondsSinceLastPlayed==="object"){message.secondsSinceLastPlayed=new $util.LongBits(object.secondsSinceLastPlayed.low>>>0,object.secondsSinceLastPlayed.high>>>0).toNumber()}}if(object.sessionUsageTableEntry!=null){if(typeof object.sessionUsageTableEntry==="string"){$util.base64.decode(object.sessionUsageTableEntry,message.sessionUsageTableEntry=$util.newBuffer($util.base64.length(object.sessionUsageTableEntry)),0)}else if(object.sessionUsageTableEntry.length>=0){message.sessionUsageTableEntry=object.sessionUsageTableEntry}}return message};ExistingLicense.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.licenseId=null;if($util.Long){var long=new $util.Long(0,0,false);object.secondsSinceStarted=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.secondsSinceStarted=options.longs===String?"0":0}if($util.Long){var long=new $util.Long(0,0,false);object.secondsSinceLastPlayed=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.secondsSinceLastPlayed=options.longs===String?"0":0}if(options.bytes===String){object.sessionUsageTableEntry=""}else{object.sessionUsageTableEntry=[];if(options.bytes!==Array){object.sessionUsageTableEntry=$util.newBuffer(object.sessionUsageTableEntry)}}}if(message.licenseId!=null&&message.hasOwnProperty("licenseId")){object.licenseId=$root.license_protocol.LicenseIdentification.toObject(message.licenseId,options)}if(message.secondsSinceStarted!=null&&message.hasOwnProperty("secondsSinceStarted")){if(typeof message.secondsSinceStarted==="number"){object.secondsSinceStarted=options.longs===String?String(message.secondsSinceStarted):message.secondsSinceStarted}else{object.secondsSinceStarted=options.longs===String?$util.Long.prototype.toString.call(message.secondsSinceStarted):options.longs===Number?new $util.LongBits(message.secondsSinceStarted.low>>>0,message.secondsSinceStarted.high>>>0).toNumber():message.secondsSinceStarted}}if(message.secondsSinceLastPlayed!=null&&message.hasOwnProperty("secondsSinceLastPlayed")){if(typeof message.secondsSinceLastPlayed==="number"){object.secondsSinceLastPlayed=options.longs===String?String(message.secondsSinceLastPlayed):message.secondsSinceLastPlayed}else{object.secondsSinceLastPlayed=options.longs===String?$util.Long.prototype.toString.call(message.secondsSinceLastPlayed):options.longs===Number?new $util.LongBits(message.secondsSinceLastPlayed.low>>>0,message.secondsSinceLastPlayed.high>>>0).toNumber():message.secondsSinceLastPlayed}}if(message.sessionUsageTableEntry!=null&&message.hasOwnProperty("sessionUsageTableEntry")){object.sessionUsageTableEntry=options.bytes===String?$util.base64.encode(message.sessionUsageTableEntry,0,message.sessionUsageTableEntry.length):options.bytes===Array?Array.prototype.slice.call(message.sessionUsageTableEntry):message.sessionUsageTableEntry}return object};ExistingLicense.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};ExistingLicense.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.LicenseRequest.ContentIdentification.ExistingLicense"};return ExistingLicense})();ContentIdentification.InitData=(function(){function InitData(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.initDataType=reader.int32();break}case 2:{message.initData=reader.bytes();break}case 3:{message.licenseType=reader.int32();break}case 4:{message.requestId=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};InitData.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};InitData.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.initDataType!=null&&message.hasOwnProperty("initDataType")){switch(message.initDataType){default:return "initDataType: enum value expected";case 1:case 2:break}}if(message.initData!=null&&message.hasOwnProperty("initData")){if(!(message.initData&&typeof message.initData.length==="number"||$util.isString(message.initData))){return "initData: buffer expected"}}if(message.licenseType!=null&&message.hasOwnProperty("licenseType")){switch(message.licenseType){default:return "licenseType: enum value expected";case 1:case 2:case 3:break}}if(message.requestId!=null&&message.hasOwnProperty("requestId")){if(!(message.requestId&&typeof message.requestId.length==="number"||$util.isString(message.requestId))){return "requestId: buffer expected"}}return null};InitData.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.LicenseRequest.ContentIdentification.InitData){return object}var message=new $root.license_protocol.LicenseRequest.ContentIdentification.InitData();switch(object.initDataType){default:if(typeof object.initDataType==="number"){message.initDataType=object.initDataType;break}break;case "CENC":case 1:message.initDataType=1;break;case "WEBM":case 2:message.initDataType=2;break}if(object.initData!=null){if(typeof object.initData==="string"){$util.base64.decode(object.initData,message.initData=$util.newBuffer($util.base64.length(object.initData)),0)}else if(object.initData.length>=0){message.initData=object.initData}}switch(object.licenseType){default:if(typeof object.licenseType==="number"){message.licenseType=object.licenseType;break}break;case "STREAMING":case 1:message.licenseType=1;break;case "OFFLINE":case 2:message.licenseType=2;break;case "AUTOMATIC":case 3:message.licenseType=3;break}if(object.requestId!=null){if(typeof object.requestId==="string"){$util.base64.decode(object.requestId,message.requestId=$util.newBuffer($util.base64.length(object.requestId)),0)}else if(object.requestId.length>=0){message.requestId=object.requestId}}return message};InitData.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.initDataType=options.enums===String?"CENC":1;if(options.bytes===String){object.initData=""}else{object.initData=[];if(options.bytes!==Array){object.initData=$util.newBuffer(object.initData)}}object.licenseType=options.enums===String?"STREAMING":1;if(options.bytes===String){object.requestId=""}else{object.requestId=[];if(options.bytes!==Array){object.requestId=$util.newBuffer(object.requestId)}}}if(message.initDataType!=null&&message.hasOwnProperty("initDataType")){object.initDataType=options.enums===String?$root.license_protocol.LicenseRequest.ContentIdentification.InitData.InitDataType[message.initDataType]===undefined?message.initDataType:$root.license_protocol.LicenseRequest.ContentIdentification.InitData.InitDataType[message.initDataType]:message.initDataType}if(message.initData!=null&&message.hasOwnProperty("initData")){object.initData=options.bytes===String?$util.base64.encode(message.initData,0,message.initData.length):options.bytes===Array?Array.prototype.slice.call(message.initData):message.initData}if(message.licenseType!=null&&message.hasOwnProperty("licenseType")){object.licenseType=options.enums===String?$root.license_protocol.LicenseType[message.licenseType]===undefined?message.licenseType:$root.license_protocol.LicenseType[message.licenseType]:message.licenseType}if(message.requestId!=null&&message.hasOwnProperty("requestId")){object.requestId=options.bytes===String?$util.base64.encode(message.requestId,0,message.requestId.length):options.bytes===Array?Array.prototype.slice.call(message.requestId):message.requestId}return object};InitData.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};InitData.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.LicenseRequest.ContentIdentification.InitData"};InitData.InitDataType=(function(){var valuesById={},values=Object.create(valuesById);values[valuesById[1]="CENC"]=1;values[valuesById[2]="WEBM"]=2;return values})();return InitData})();return ContentIdentification})();LicenseRequest.RequestType=(function(){var valuesById={},values=Object.create(valuesById);values[valuesById[1]="NEW"]=1;values[valuesById[2]="RENEWAL"]=2;values[valuesById[3]="RELEASE"]=3;return values})();return LicenseRequest})();license_protocol.MetricData=(function(){function MetricData(properties){this.metricData=[];if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.stageName=reader.string();break}case 2:{if(!(message.metricData&&message.metricData.length)){message.metricData=[]}message.metricData.push($root.license_protocol.MetricData.TypeValue.decode(reader,reader.uint32()));break}default:reader.skipType(tag&7);break}}return message};MetricData.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};MetricData.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.stageName!=null&&message.hasOwnProperty("stageName")){if(!$util.isString(message.stageName)){return "stageName: string expected"}}if(message.metricData!=null&&message.hasOwnProperty("metricData")){if(!Array.isArray(message.metricData)){return "metricData: array expected"}for(var i=0;i>>3){case 1:{message.type=reader.int32();break}case 2:{message.value=reader.int64();break}default:reader.skipType(tag&7);break}}return message};TypeValue.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};TypeValue.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.type!=null&&message.hasOwnProperty("type")){switch(message.type){default:return "type: enum value expected";case 1:case 2:break}}if(message.value!=null&&message.hasOwnProperty("value")){if(!$util.isInteger(message.value)&&!(message.value&&$util.isInteger(message.value.low)&&$util.isInteger(message.value.high))){return "value: integer|Long expected"}}return null};TypeValue.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.MetricData.TypeValue){return object}var message=new $root.license_protocol.MetricData.TypeValue();switch(object.type){default:if(typeof object.type==="number"){message.type=object.type;break}break;case "LATENCY":case 1:message.type=1;break;case "TIMESTAMP":case 2:message.type=2;break}if(object.value!=null){if($util.Long){(message.value=$util.Long.fromValue(object.value)).unsigned=false}else if(typeof object.value==="string"){message.value=parseInt(object.value,10)}else if(typeof object.value==="number"){message.value=object.value}else if(typeof object.value==="object"){message.value=new $util.LongBits(object.value.low>>>0,object.value.high>>>0).toNumber()}}return message};TypeValue.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.type=options.enums===String?"LATENCY":1;if($util.Long){var long=new $util.Long(0,0,false);object.value=options.longs===String?long.toString():options.longs===Number?long.toNumber():long}else{object.value=options.longs===String?"0":0}}if(message.type!=null&&message.hasOwnProperty("type")){object.type=options.enums===String?$root.license_protocol.MetricData.MetricType[message.type]===undefined?message.type:$root.license_protocol.MetricData.MetricType[message.type]:message.type}if(message.value!=null&&message.hasOwnProperty("value")){if(typeof message.value==="number"){object.value=options.longs===String?String(message.value):message.value}else{object.value=options.longs===String?$util.Long.prototype.toString.call(message.value):options.longs===Number?new $util.LongBits(message.value.low>>>0,message.value.high>>>0).toNumber():message.value}}return object};TypeValue.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};TypeValue.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.MetricData.TypeValue"};return TypeValue})();return MetricData})();license_protocol.VersionInfo=(function(){function VersionInfo(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.licenseSdkVersion=reader.string();break}case 2:{message.licenseServiceVersion=reader.string();break}default:reader.skipType(tag&7);break}}return message};VersionInfo.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};VersionInfo.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.licenseSdkVersion!=null&&message.hasOwnProperty("licenseSdkVersion")){if(!$util.isString(message.licenseSdkVersion)){return "licenseSdkVersion: string expected"}}if(message.licenseServiceVersion!=null&&message.hasOwnProperty("licenseServiceVersion")){if(!$util.isString(message.licenseServiceVersion)){return "licenseServiceVersion: string expected"}}return null};VersionInfo.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.VersionInfo){return object}var message=new $root.license_protocol.VersionInfo();if(object.licenseSdkVersion!=null){message.licenseSdkVersion=String(object.licenseSdkVersion)}if(object.licenseServiceVersion!=null){message.licenseServiceVersion=String(object.licenseServiceVersion)}return message};VersionInfo.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.licenseSdkVersion="";object.licenseServiceVersion=""}if(message.licenseSdkVersion!=null&&message.hasOwnProperty("licenseSdkVersion")){object.licenseSdkVersion=message.licenseSdkVersion}if(message.licenseServiceVersion!=null&&message.hasOwnProperty("licenseServiceVersion")){object.licenseServiceVersion=message.licenseServiceVersion}return object};VersionInfo.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};VersionInfo.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.VersionInfo"};return VersionInfo})();license_protocol.SignedMessage=(function(){function SignedMessage(properties){this.metricData=[];if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.type=reader.int32();break}case 2:{message.msg=reader.bytes();break}case 3:{message.signature=reader.bytes();break}case 4:{message.sessionKey=reader.bytes();break}case 5:{message.remoteAttestation=reader.bytes();break}case 6:{if(!(message.metricData&&message.metricData.length)){message.metricData=[]}message.metricData.push($root.license_protocol.MetricData.decode(reader,reader.uint32()));break}case 7:{message.serviceVersionInfo=$root.license_protocol.VersionInfo.decode(reader,reader.uint32());break}case 8:{message.sessionKeyType=reader.int32();break}case 9:{message.oemcryptoCoreMessage=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};SignedMessage.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};SignedMessage.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.type!=null&&message.hasOwnProperty("type")){switch(message.type){default:return "type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:break}}if(message.msg!=null&&message.hasOwnProperty("msg")){if(!(message.msg&&typeof message.msg.length==="number"||$util.isString(message.msg))){return "msg: buffer expected"}}if(message.signature!=null&&message.hasOwnProperty("signature")){if(!(message.signature&&typeof message.signature.length==="number"||$util.isString(message.signature))){return "signature: buffer expected"}}if(message.sessionKey!=null&&message.hasOwnProperty("sessionKey")){if(!(message.sessionKey&&typeof message.sessionKey.length==="number"||$util.isString(message.sessionKey))){return "sessionKey: buffer expected"}}if(message.remoteAttestation!=null&&message.hasOwnProperty("remoteAttestation")){if(!(message.remoteAttestation&&typeof message.remoteAttestation.length==="number"||$util.isString(message.remoteAttestation))){return "remoteAttestation: buffer expected"}}if(message.metricData!=null&&message.hasOwnProperty("metricData")){if(!Array.isArray(message.metricData)){return "metricData: array expected"}for(var i=0;i=0){message.msg=object.msg}}if(object.signature!=null){if(typeof object.signature==="string"){$util.base64.decode(object.signature,message.signature=$util.newBuffer($util.base64.length(object.signature)),0)}else if(object.signature.length>=0){message.signature=object.signature}}if(object.sessionKey!=null){if(typeof object.sessionKey==="string"){$util.base64.decode(object.sessionKey,message.sessionKey=$util.newBuffer($util.base64.length(object.sessionKey)),0)}else if(object.sessionKey.length>=0){message.sessionKey=object.sessionKey}}if(object.remoteAttestation!=null){if(typeof object.remoteAttestation==="string"){$util.base64.decode(object.remoteAttestation,message.remoteAttestation=$util.newBuffer($util.base64.length(object.remoteAttestation)),0)}else if(object.remoteAttestation.length>=0){message.remoteAttestation=object.remoteAttestation}}if(object.metricData){if(!Array.isArray(object.metricData)){throw TypeError(".license_protocol.SignedMessage.metricData: array expected")}message.metricData=[];for(var i=0;i=0){message.oemcryptoCoreMessage=object.oemcryptoCoreMessage}}return message};SignedMessage.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.arrays||options.defaults){object.metricData=[]}if(options.defaults){object.type=options.enums===String?"LICENSE_REQUEST":1;if(options.bytes===String){object.msg=""}else{object.msg=[];if(options.bytes!==Array){object.msg=$util.newBuffer(object.msg)}}if(options.bytes===String){object.signature=""}else{object.signature=[];if(options.bytes!==Array){object.signature=$util.newBuffer(object.signature)}}if(options.bytes===String){object.sessionKey=""}else{object.sessionKey=[];if(options.bytes!==Array){object.sessionKey=$util.newBuffer(object.sessionKey)}}if(options.bytes===String){object.remoteAttestation=""}else{object.remoteAttestation=[];if(options.bytes!==Array){object.remoteAttestation=$util.newBuffer(object.remoteAttestation)}}object.serviceVersionInfo=null;object.sessionKeyType=options.enums===String?"WRAPPED_AES_KEY":1;if(options.bytes===String){object.oemcryptoCoreMessage=""}else{object.oemcryptoCoreMessage=[];if(options.bytes!==Array){object.oemcryptoCoreMessage=$util.newBuffer(object.oemcryptoCoreMessage)}}}if(message.type!=null&&message.hasOwnProperty("type")){object.type=options.enums===String?$root.license_protocol.SignedMessage.MessageType[message.type]===undefined?message.type:$root.license_protocol.SignedMessage.MessageType[message.type]:message.type}if(message.msg!=null&&message.hasOwnProperty("msg")){object.msg=options.bytes===String?$util.base64.encode(message.msg,0,message.msg.length):options.bytes===Array?Array.prototype.slice.call(message.msg):message.msg}if(message.signature!=null&&message.hasOwnProperty("signature")){object.signature=options.bytes===String?$util.base64.encode(message.signature,0,message.signature.length):options.bytes===Array?Array.prototype.slice.call(message.signature):message.signature}if(message.sessionKey!=null&&message.hasOwnProperty("sessionKey")){object.sessionKey=options.bytes===String?$util.base64.encode(message.sessionKey,0,message.sessionKey.length):options.bytes===Array?Array.prototype.slice.call(message.sessionKey):message.sessionKey}if(message.remoteAttestation!=null&&message.hasOwnProperty("remoteAttestation")){object.remoteAttestation=options.bytes===String?$util.base64.encode(message.remoteAttestation,0,message.remoteAttestation.length):options.bytes===Array?Array.prototype.slice.call(message.remoteAttestation):message.remoteAttestation}if(message.metricData&&message.metricData.length){object.metricData=[];for(var j=0;j>>3){case 1:{message.type=reader.int32();break}case 2:{message.token=reader.bytes();break}case 3:{if(!(message.clientInfo&&message.clientInfo.length)){message.clientInfo=[]}message.clientInfo.push($root.license_protocol.ClientIdentification.NameValue.decode(reader,reader.uint32()));break}case 4:{message.providerClientToken=reader.bytes();break}case 5:{message.licenseCounter=reader.uint32();break}case 6:{message.clientCapabilities=$root.license_protocol.ClientIdentification.ClientCapabilities.decode(reader,reader.uint32());break}case 7:{message.vmpData=reader.bytes();break}case 8:{if(!(message.deviceCredentials&&message.deviceCredentials.length)){message.deviceCredentials=[]}message.deviceCredentials.push($root.license_protocol.ClientIdentification.ClientCredentials.decode(reader,reader.uint32()));break}default:reader.skipType(tag&7);break}}return message};ClientIdentification.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};ClientIdentification.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.type!=null&&message.hasOwnProperty("type")){switch(message.type){default:return "type: enum value expected";case 0:case 1:case 2:case 3:break}}if(message.token!=null&&message.hasOwnProperty("token")){if(!(message.token&&typeof message.token.length==="number"||$util.isString(message.token))){return "token: buffer expected"}}if(message.clientInfo!=null&&message.hasOwnProperty("clientInfo")){if(!Array.isArray(message.clientInfo)){return "clientInfo: array expected"}for(var i=0;i=0){message.token=object.token}}if(object.clientInfo){if(!Array.isArray(object.clientInfo)){throw TypeError(".license_protocol.ClientIdentification.clientInfo: array expected")}message.clientInfo=[];for(var i=0;i=0){message.providerClientToken=object.providerClientToken}}if(object.licenseCounter!=null){message.licenseCounter=object.licenseCounter>>>0}if(object.clientCapabilities!=null){if(typeof object.clientCapabilities!=="object"){throw TypeError(".license_protocol.ClientIdentification.clientCapabilities: object expected")}message.clientCapabilities=$root.license_protocol.ClientIdentification.ClientCapabilities.fromObject(object.clientCapabilities)}if(object.vmpData!=null){if(typeof object.vmpData==="string"){$util.base64.decode(object.vmpData,message.vmpData=$util.newBuffer($util.base64.length(object.vmpData)),0)}else if(object.vmpData.length>=0){message.vmpData=object.vmpData}}if(object.deviceCredentials){if(!Array.isArray(object.deviceCredentials)){throw TypeError(".license_protocol.ClientIdentification.deviceCredentials: array expected")}message.deviceCredentials=[];for(var i=0;i>>3){case 1:{message.name=reader.string();break}case 2:{message.value=reader.string();break}default:reader.skipType(tag&7);break}}return message};NameValue.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};NameValue.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.name!=null&&message.hasOwnProperty("name")){if(!$util.isString(message.name)){return "name: string expected"}}if(message.value!=null&&message.hasOwnProperty("value")){if(!$util.isString(message.value)){return "value: string expected"}}return null};NameValue.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.ClientIdentification.NameValue){return object}var message=new $root.license_protocol.ClientIdentification.NameValue();if(object.name!=null){message.name=String(object.name)}if(object.value!=null){message.value=String(object.value)}return message};NameValue.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.name="";object.value=""}if(message.name!=null&&message.hasOwnProperty("name")){object.name=message.name}if(message.value!=null&&message.hasOwnProperty("value")){object.value=message.value}return object};NameValue.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};NameValue.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.ClientIdentification.NameValue"};return NameValue})();ClientIdentification.ClientCapabilities=(function(){function ClientCapabilities(properties){this.supportedCertificateKeyType=[];if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.clientToken=reader.bool();break}case 2:{message.sessionToken=reader.bool();break}case 3:{message.videoResolutionConstraints=reader.bool();break}case 4:{message.maxHdcpVersion=reader.int32();break}case 5:{message.oemCryptoApiVersion=reader.uint32();break}case 6:{message.antiRollbackUsageTable=reader.bool();break}case 7:{message.srmVersion=reader.uint32();break}case 8:{message.canUpdateSrm=reader.bool();break}case 9:{if(!(message.supportedCertificateKeyType&&message.supportedCertificateKeyType.length)){message.supportedCertificateKeyType=[]}if((tag&7)===2){var end2=reader.uint32()+reader.pos;while(reader.pos>>0}if(object.antiRollbackUsageTable!=null){message.antiRollbackUsageTable=Boolean(object.antiRollbackUsageTable)}if(object.srmVersion!=null){message.srmVersion=object.srmVersion>>>0}if(object.canUpdateSrm!=null){message.canUpdateSrm=Boolean(object.canUpdateSrm)}if(object.supportedCertificateKeyType){if(!Array.isArray(object.supportedCertificateKeyType)){throw TypeError(".license_protocol.ClientIdentification.ClientCapabilities.supportedCertificateKeyType: array expected")}message.supportedCertificateKeyType=[];for(var i=0;i>>0}return message};ClientCapabilities.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.arrays||options.defaults){object.supportedCertificateKeyType=[]}if(options.defaults){object.clientToken=false;object.sessionToken=false;object.videoResolutionConstraints=false;object.maxHdcpVersion=options.enums===String?"HDCP_NONE":0;object.oemCryptoApiVersion=0;object.antiRollbackUsageTable=false;object.srmVersion=0;object.canUpdateSrm=false;object.analogOutputCapabilities=options.enums===String?"ANALOG_OUTPUT_UNKNOWN":0;object.canDisableAnalogOutput=false;object.resourceRatingTier=0}if(message.clientToken!=null&&message.hasOwnProperty("clientToken")){object.clientToken=message.clientToken}if(message.sessionToken!=null&&message.hasOwnProperty("sessionToken")){object.sessionToken=message.sessionToken}if(message.videoResolutionConstraints!=null&&message.hasOwnProperty("videoResolutionConstraints")){object.videoResolutionConstraints=message.videoResolutionConstraints}if(message.maxHdcpVersion!=null&&message.hasOwnProperty("maxHdcpVersion")){object.maxHdcpVersion=options.enums===String?$root.license_protocol.ClientIdentification.ClientCapabilities.HdcpVersion[message.maxHdcpVersion]===undefined?message.maxHdcpVersion:$root.license_protocol.ClientIdentification.ClientCapabilities.HdcpVersion[message.maxHdcpVersion]:message.maxHdcpVersion}if(message.oemCryptoApiVersion!=null&&message.hasOwnProperty("oemCryptoApiVersion")){object.oemCryptoApiVersion=message.oemCryptoApiVersion}if(message.antiRollbackUsageTable!=null&&message.hasOwnProperty("antiRollbackUsageTable")){object.antiRollbackUsageTable=message.antiRollbackUsageTable}if(message.srmVersion!=null&&message.hasOwnProperty("srmVersion")){object.srmVersion=message.srmVersion}if(message.canUpdateSrm!=null&&message.hasOwnProperty("canUpdateSrm")){object.canUpdateSrm=message.canUpdateSrm}if(message.supportedCertificateKeyType&&message.supportedCertificateKeyType.length){object.supportedCertificateKeyType=[];for(var j=0;j>>3){case 1:{message.type=reader.int32();break}case 2:{message.token=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};ClientCredentials.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};ClientCredentials.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.type!=null&&message.hasOwnProperty("type")){switch(message.type){default:return "type: enum value expected";case 0:case 1:case 2:case 3:break}}if(message.token!=null&&message.hasOwnProperty("token")){if(!(message.token&&typeof message.token.length==="number"||$util.isString(message.token))){return "token: buffer expected"}}return null};ClientCredentials.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.ClientIdentification.ClientCredentials){return object}var message=new $root.license_protocol.ClientIdentification.ClientCredentials();switch(object.type){default:if(typeof object.type==="number"){message.type=object.type;break}break;case "KEYBOX":case 0:message.type=0;break;case "DRM_DEVICE_CERTIFICATE":case 1:message.type=1;break;case "REMOTE_ATTESTATION_CERTIFICATE":case 2:message.type=2;break;case "OEM_DEVICE_CERTIFICATE":case 3:message.type=3;break}if(object.token!=null){if(typeof object.token==="string"){$util.base64.decode(object.token,message.token=$util.newBuffer($util.base64.length(object.token)),0)}else if(object.token.length>=0){message.token=object.token}}return message};ClientCredentials.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.type=options.enums===String?"KEYBOX":0;if(options.bytes===String){object.token=""}else{object.token=[];if(options.bytes!==Array){object.token=$util.newBuffer(object.token)}}}if(message.type!=null&&message.hasOwnProperty("type")){object.type=options.enums===String?$root.license_protocol.ClientIdentification.TokenType[message.type]===undefined?message.type:$root.license_protocol.ClientIdentification.TokenType[message.type]:message.type}if(message.token!=null&&message.hasOwnProperty("token")){object.token=options.bytes===String?$util.base64.encode(message.token,0,message.token.length):options.bytes===Array?Array.prototype.slice.call(message.token):message.token}return object};ClientCredentials.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};ClientCredentials.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.ClientIdentification.ClientCredentials"};return ClientCredentials})();return ClientIdentification})();license_protocol.EncryptedClientIdentification=(function(){function EncryptedClientIdentification(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.providerId=reader.string();break}case 2:{message.serviceCertificateSerialNumber=reader.bytes();break}case 3:{message.encryptedClientId=reader.bytes();break}case 4:{message.encryptedClientIdIv=reader.bytes();break}case 5:{message.encryptedPrivacyKey=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};EncryptedClientIdentification.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};EncryptedClientIdentification.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.providerId!=null&&message.hasOwnProperty("providerId")){if(!$util.isString(message.providerId)){return "providerId: string expected"}}if(message.serviceCertificateSerialNumber!=null&&message.hasOwnProperty("serviceCertificateSerialNumber")){if(!(message.serviceCertificateSerialNumber&&typeof message.serviceCertificateSerialNumber.length==="number"||$util.isString(message.serviceCertificateSerialNumber))){return "serviceCertificateSerialNumber: buffer expected"}}if(message.encryptedClientId!=null&&message.hasOwnProperty("encryptedClientId")){if(!(message.encryptedClientId&&typeof message.encryptedClientId.length==="number"||$util.isString(message.encryptedClientId))){return "encryptedClientId: buffer expected"}}if(message.encryptedClientIdIv!=null&&message.hasOwnProperty("encryptedClientIdIv")){if(!(message.encryptedClientIdIv&&typeof message.encryptedClientIdIv.length==="number"||$util.isString(message.encryptedClientIdIv))){return "encryptedClientIdIv: buffer expected"}}if(message.encryptedPrivacyKey!=null&&message.hasOwnProperty("encryptedPrivacyKey")){if(!(message.encryptedPrivacyKey&&typeof message.encryptedPrivacyKey.length==="number"||$util.isString(message.encryptedPrivacyKey))){return "encryptedPrivacyKey: buffer expected"}}return null};EncryptedClientIdentification.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.EncryptedClientIdentification){return object}var message=new $root.license_protocol.EncryptedClientIdentification();if(object.providerId!=null){message.providerId=String(object.providerId)}if(object.serviceCertificateSerialNumber!=null){if(typeof object.serviceCertificateSerialNumber==="string"){$util.base64.decode(object.serviceCertificateSerialNumber,message.serviceCertificateSerialNumber=$util.newBuffer($util.base64.length(object.serviceCertificateSerialNumber)),0)}else if(object.serviceCertificateSerialNumber.length>=0){message.serviceCertificateSerialNumber=object.serviceCertificateSerialNumber}}if(object.encryptedClientId!=null){if(typeof object.encryptedClientId==="string"){$util.base64.decode(object.encryptedClientId,message.encryptedClientId=$util.newBuffer($util.base64.length(object.encryptedClientId)),0)}else if(object.encryptedClientId.length>=0){message.encryptedClientId=object.encryptedClientId}}if(object.encryptedClientIdIv!=null){if(typeof object.encryptedClientIdIv==="string"){$util.base64.decode(object.encryptedClientIdIv,message.encryptedClientIdIv=$util.newBuffer($util.base64.length(object.encryptedClientIdIv)),0)}else if(object.encryptedClientIdIv.length>=0){message.encryptedClientIdIv=object.encryptedClientIdIv}}if(object.encryptedPrivacyKey!=null){if(typeof object.encryptedPrivacyKey==="string"){$util.base64.decode(object.encryptedPrivacyKey,message.encryptedPrivacyKey=$util.newBuffer($util.base64.length(object.encryptedPrivacyKey)),0)}else if(object.encryptedPrivacyKey.length>=0){message.encryptedPrivacyKey=object.encryptedPrivacyKey}}return message};EncryptedClientIdentification.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.providerId="";if(options.bytes===String){object.serviceCertificateSerialNumber=""}else{object.serviceCertificateSerialNumber=[];if(options.bytes!==Array){object.serviceCertificateSerialNumber=$util.newBuffer(object.serviceCertificateSerialNumber)}}if(options.bytes===String){object.encryptedClientId=""}else{object.encryptedClientId=[];if(options.bytes!==Array){object.encryptedClientId=$util.newBuffer(object.encryptedClientId)}}if(options.bytes===String){object.encryptedClientIdIv=""}else{object.encryptedClientIdIv=[];if(options.bytes!==Array){object.encryptedClientIdIv=$util.newBuffer(object.encryptedClientIdIv)}}if(options.bytes===String){object.encryptedPrivacyKey=""}else{object.encryptedPrivacyKey=[];if(options.bytes!==Array){object.encryptedPrivacyKey=$util.newBuffer(object.encryptedPrivacyKey)}}}if(message.providerId!=null&&message.hasOwnProperty("providerId")){object.providerId=message.providerId}if(message.serviceCertificateSerialNumber!=null&&message.hasOwnProperty("serviceCertificateSerialNumber")){object.serviceCertificateSerialNumber=options.bytes===String?$util.base64.encode(message.serviceCertificateSerialNumber,0,message.serviceCertificateSerialNumber.length):options.bytes===Array?Array.prototype.slice.call(message.serviceCertificateSerialNumber):message.serviceCertificateSerialNumber}if(message.encryptedClientId!=null&&message.hasOwnProperty("encryptedClientId")){object.encryptedClientId=options.bytes===String?$util.base64.encode(message.encryptedClientId,0,message.encryptedClientId.length):options.bytes===Array?Array.prototype.slice.call(message.encryptedClientId):message.encryptedClientId}if(message.encryptedClientIdIv!=null&&message.hasOwnProperty("encryptedClientIdIv")){object.encryptedClientIdIv=options.bytes===String?$util.base64.encode(message.encryptedClientIdIv,0,message.encryptedClientIdIv.length):options.bytes===Array?Array.prototype.slice.call(message.encryptedClientIdIv):message.encryptedClientIdIv}if(message.encryptedPrivacyKey!=null&&message.hasOwnProperty("encryptedPrivacyKey")){object.encryptedPrivacyKey=options.bytes===String?$util.base64.encode(message.encryptedPrivacyKey,0,message.encryptedPrivacyKey.length):options.bytes===Array?Array.prototype.slice.call(message.encryptedPrivacyKey):message.encryptedPrivacyKey}return object};EncryptedClientIdentification.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};EncryptedClientIdentification.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.EncryptedClientIdentification"};return EncryptedClientIdentification})();license_protocol.DrmCertificate=(function(){function DrmCertificate(properties){this.serviceTypes=[];if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.type=reader.int32();break}case 2:{message.serialNumber=reader.bytes();break}case 3:{message.creationTimeSeconds=reader.uint32();break}case 12:{message.expirationTimeSeconds=reader.uint32();break}case 4:{message.publicKey=reader.bytes();break}case 5:{message.systemId=reader.uint32();break}case 6:{message.testDeviceDeprecated=reader.bool();break}case 7:{message.providerId=reader.string();break}case 8:{if(!(message.serviceTypes&&message.serviceTypes.length)){message.serviceTypes=[]}if((tag&7)===2){var end2=reader.uint32()+reader.pos;while(reader.pos=0){message.serialNumber=object.serialNumber}}if(object.creationTimeSeconds!=null){message.creationTimeSeconds=object.creationTimeSeconds>>>0}if(object.expirationTimeSeconds!=null){message.expirationTimeSeconds=object.expirationTimeSeconds>>>0}if(object.publicKey!=null){if(typeof object.publicKey==="string"){$util.base64.decode(object.publicKey,message.publicKey=$util.newBuffer($util.base64.length(object.publicKey)),0)}else if(object.publicKey.length>=0){message.publicKey=object.publicKey}}if(object.systemId!=null){message.systemId=object.systemId>>>0}if(object.testDeviceDeprecated!=null){message.testDeviceDeprecated=Boolean(object.testDeviceDeprecated)}if(object.providerId!=null){message.providerId=String(object.providerId)}if(object.serviceTypes){if(!Array.isArray(object.serviceTypes)){throw TypeError(".license_protocol.DrmCertificate.serviceTypes: array expected")}message.serviceTypes=[];for(var i=0;i=0){message.rotId=object.rotId}}if(object.encryptionKey!=null){if(typeof object.encryptionKey!=="object"){throw TypeError(".license_protocol.DrmCertificate.encryptionKey: object expected")}message.encryptionKey=$root.license_protocol.DrmCertificate.EncryptionKey.fromObject(object.encryptionKey)}return message};DrmCertificate.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.arrays||options.defaults){object.serviceTypes=[]}if(options.defaults){object.type=options.enums===String?"ROOT":0;if(options.bytes===String){object.serialNumber=""}else{object.serialNumber=[];if(options.bytes!==Array){object.serialNumber=$util.newBuffer(object.serialNumber)}}object.creationTimeSeconds=0;if(options.bytes===String){object.publicKey=""}else{object.publicKey=[];if(options.bytes!==Array){object.publicKey=$util.newBuffer(object.publicKey)}}object.systemId=0;object.testDeviceDeprecated=false;object.providerId="";object.algorithm=options.enums===String?"RSA":1;if(options.bytes===String){object.rotId=""}else{object.rotId=[];if(options.bytes!==Array){object.rotId=$util.newBuffer(object.rotId)}}object.encryptionKey=null;object.expirationTimeSeconds=0}if(message.type!=null&&message.hasOwnProperty("type")){object.type=options.enums===String?$root.license_protocol.DrmCertificate.Type[message.type]===undefined?message.type:$root.license_protocol.DrmCertificate.Type[message.type]:message.type}if(message.serialNumber!=null&&message.hasOwnProperty("serialNumber")){object.serialNumber=options.bytes===String?$util.base64.encode(message.serialNumber,0,message.serialNumber.length):options.bytes===Array?Array.prototype.slice.call(message.serialNumber):message.serialNumber}if(message.creationTimeSeconds!=null&&message.hasOwnProperty("creationTimeSeconds")){object.creationTimeSeconds=message.creationTimeSeconds}if(message.publicKey!=null&&message.hasOwnProperty("publicKey")){object.publicKey=options.bytes===String?$util.base64.encode(message.publicKey,0,message.publicKey.length):options.bytes===Array?Array.prototype.slice.call(message.publicKey):message.publicKey}if(message.systemId!=null&&message.hasOwnProperty("systemId")){object.systemId=message.systemId}if(message.testDeviceDeprecated!=null&&message.hasOwnProperty("testDeviceDeprecated")){object.testDeviceDeprecated=message.testDeviceDeprecated}if(message.providerId!=null&&message.hasOwnProperty("providerId")){object.providerId=message.providerId}if(message.serviceTypes&&message.serviceTypes.length){object.serviceTypes=[];for(var j=0;j>>3){case 1:{message.publicKey=reader.bytes();break}case 2:{message.algorithm=reader.int32();break}default:reader.skipType(tag&7);break}}return message};EncryptionKey.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};EncryptionKey.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.publicKey!=null&&message.hasOwnProperty("publicKey")){if(!(message.publicKey&&typeof message.publicKey.length==="number"||$util.isString(message.publicKey))){return "publicKey: buffer expected"}}if(message.algorithm!=null&&message.hasOwnProperty("algorithm")){switch(message.algorithm){default:return "algorithm: enum value expected";case 0:case 1:case 2:case 3:case 4:break}}return null};EncryptionKey.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.DrmCertificate.EncryptionKey){return object}var message=new $root.license_protocol.DrmCertificate.EncryptionKey();if(object.publicKey!=null){if(typeof object.publicKey==="string"){$util.base64.decode(object.publicKey,message.publicKey=$util.newBuffer($util.base64.length(object.publicKey)),0)}else if(object.publicKey.length>=0){message.publicKey=object.publicKey}}switch(object.algorithm){case "UNKNOWN_ALGORITHM":case 0:message.algorithm=0;break;default:if(typeof object.algorithm==="number"){message.algorithm=object.algorithm;break}break;case "RSA":case 1:message.algorithm=1;break;case "ECC_SECP256R1":case 2:message.algorithm=2;break;case "ECC_SECP384R1":case 3:message.algorithm=3;break;case "ECC_SECP521R1":case 4:message.algorithm=4;break}return message};EncryptionKey.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){if(options.bytes===String){object.publicKey=""}else{object.publicKey=[];if(options.bytes!==Array){object.publicKey=$util.newBuffer(object.publicKey)}}object.algorithm=options.enums===String?"RSA":1}if(message.publicKey!=null&&message.hasOwnProperty("publicKey")){object.publicKey=options.bytes===String?$util.base64.encode(message.publicKey,0,message.publicKey.length):options.bytes===Array?Array.prototype.slice.call(message.publicKey):message.publicKey}if(message.algorithm!=null&&message.hasOwnProperty("algorithm")){object.algorithm=options.enums===String?$root.license_protocol.DrmCertificate.Algorithm[message.algorithm]===undefined?message.algorithm:$root.license_protocol.DrmCertificate.Algorithm[message.algorithm]:message.algorithm}return object};EncryptionKey.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};EncryptionKey.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.DrmCertificate.EncryptionKey"};return EncryptionKey})();return DrmCertificate})();license_protocol.SignedDrmCertificate=(function(){function SignedDrmCertificate(properties){if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.drmCertificate=reader.bytes();break}case 2:{message.signature=reader.bytes();break}case 3:{message.signer=$root.license_protocol.SignedDrmCertificate.decode(reader,reader.uint32());break}case 4:{message.hashAlgorithm=reader.int32();break}default:reader.skipType(tag&7);break}}return message};SignedDrmCertificate.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};SignedDrmCertificate.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.drmCertificate!=null&&message.hasOwnProperty("drmCertificate")){if(!(message.drmCertificate&&typeof message.drmCertificate.length==="number"||$util.isString(message.drmCertificate))){return "drmCertificate: buffer expected"}}if(message.signature!=null&&message.hasOwnProperty("signature")){if(!(message.signature&&typeof message.signature.length==="number"||$util.isString(message.signature))){return "signature: buffer expected"}}if(message.signer!=null&&message.hasOwnProperty("signer")){var error=$root.license_protocol.SignedDrmCertificate.verify(message.signer);if(error){return "signer."+error}}if(message.hashAlgorithm!=null&&message.hasOwnProperty("hashAlgorithm")){switch(message.hashAlgorithm){default:return "hashAlgorithm: enum value expected";case 0:case 1:case 2:case 3:break}}return null};SignedDrmCertificate.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.SignedDrmCertificate){return object}var message=new $root.license_protocol.SignedDrmCertificate();if(object.drmCertificate!=null){if(typeof object.drmCertificate==="string"){$util.base64.decode(object.drmCertificate,message.drmCertificate=$util.newBuffer($util.base64.length(object.drmCertificate)),0)}else if(object.drmCertificate.length>=0){message.drmCertificate=object.drmCertificate}}if(object.signature!=null){if(typeof object.signature==="string"){$util.base64.decode(object.signature,message.signature=$util.newBuffer($util.base64.length(object.signature)),0)}else if(object.signature.length>=0){message.signature=object.signature}}if(object.signer!=null){if(typeof object.signer!=="object"){throw TypeError(".license_protocol.SignedDrmCertificate.signer: object expected")}message.signer=$root.license_protocol.SignedDrmCertificate.fromObject(object.signer)}switch(object.hashAlgorithm){default:if(typeof object.hashAlgorithm==="number"){message.hashAlgorithm=object.hashAlgorithm;break}break;case "HASH_ALGORITHM_UNSPECIFIED":case 0:message.hashAlgorithm=0;break;case "HASH_ALGORITHM_SHA_1":case 1:message.hashAlgorithm=1;break;case "HASH_ALGORITHM_SHA_256":case 2:message.hashAlgorithm=2;break;case "HASH_ALGORITHM_SHA_384":case 3:message.hashAlgorithm=3;break}return message};SignedDrmCertificate.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){if(options.bytes===String){object.drmCertificate=""}else{object.drmCertificate=[];if(options.bytes!==Array){object.drmCertificate=$util.newBuffer(object.drmCertificate)}}if(options.bytes===String){object.signature=""}else{object.signature=[];if(options.bytes!==Array){object.signature=$util.newBuffer(object.signature)}}object.signer=null;object.hashAlgorithm=options.enums===String?"HASH_ALGORITHM_UNSPECIFIED":0}if(message.drmCertificate!=null&&message.hasOwnProperty("drmCertificate")){object.drmCertificate=options.bytes===String?$util.base64.encode(message.drmCertificate,0,message.drmCertificate.length):options.bytes===Array?Array.prototype.slice.call(message.drmCertificate):message.drmCertificate}if(message.signature!=null&&message.hasOwnProperty("signature")){object.signature=options.bytes===String?$util.base64.encode(message.signature,0,message.signature.length):options.bytes===Array?Array.prototype.slice.call(message.signature):message.signature}if(message.signer!=null&&message.hasOwnProperty("signer")){object.signer=$root.license_protocol.SignedDrmCertificate.toObject(message.signer,options)}if(message.hashAlgorithm!=null&&message.hasOwnProperty("hashAlgorithm")){object.hashAlgorithm=options.enums===String?$root.license_protocol.HashAlgorithmProto[message.hashAlgorithm]===undefined?message.hashAlgorithm:$root.license_protocol.HashAlgorithmProto[message.hashAlgorithm]:message.hashAlgorithm}return object};SignedDrmCertificate.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};SignedDrmCertificate.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.SignedDrmCertificate"};return SignedDrmCertificate})();license_protocol.WidevinePsshData=(function(){function WidevinePsshData(properties){this.keyIds=[];this.groupIds=[];this.entitledKeys=[];if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 2:{if(!(message.keyIds&&message.keyIds.length)){message.keyIds=[]}message.keyIds.push(reader.bytes());break}case 4:{message.contentId=reader.bytes();break}case 7:{message.cryptoPeriodIndex=reader.uint32();break}case 9:{message.protectionScheme=reader.uint32();break}case 10:{message.cryptoPeriodSeconds=reader.uint32();break}case 11:{message.type=reader.int32();break}case 12:{message.keySequence=reader.uint32();break}case 13:{if(!(message.groupIds&&message.groupIds.length)){message.groupIds=[]}message.groupIds.push(reader.bytes());break}case 14:{if(!(message.entitledKeys&&message.entitledKeys.length)){message.entitledKeys=[]}message.entitledKeys.push($root.license_protocol.WidevinePsshData.EntitledKey.decode(reader,reader.uint32()));break}case 15:{message.videoFeature=reader.string();break}case 1:{message.algorithm=reader.int32();break}case 3:{message.provider=reader.string();break}case 5:{message.trackType=reader.string();break}case 6:{message.policy=reader.string();break}case 8:{message.groupedLicense=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};WidevinePsshData.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};WidevinePsshData.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.keyIds!=null&&message.hasOwnProperty("keyIds")){if(!Array.isArray(message.keyIds)){return "keyIds: array expected"}for(var i=0;i=0){message.keyIds[i]=object.keyIds[i]}}}if(object.contentId!=null){if(typeof object.contentId==="string"){$util.base64.decode(object.contentId,message.contentId=$util.newBuffer($util.base64.length(object.contentId)),0)}else if(object.contentId.length>=0){message.contentId=object.contentId}}if(object.cryptoPeriodIndex!=null){message.cryptoPeriodIndex=object.cryptoPeriodIndex>>>0}if(object.protectionScheme!=null){message.protectionScheme=object.protectionScheme>>>0}if(object.cryptoPeriodSeconds!=null){message.cryptoPeriodSeconds=object.cryptoPeriodSeconds>>>0}switch(object.type){default:if(typeof object.type==="number"){message.type=object.type;break}break;case "SINGLE":case 0:message.type=0;break;case "ENTITLEMENT":case 1:message.type=1;break;case "ENTITLED_KEY":case 2:message.type=2;break}if(object.keySequence!=null){message.keySequence=object.keySequence>>>0}if(object.groupIds){if(!Array.isArray(object.groupIds)){throw TypeError(".license_protocol.WidevinePsshData.groupIds: array expected")}message.groupIds=[];for(var i=0;i=0){message.groupIds[i]=object.groupIds[i]}}}if(object.entitledKeys){if(!Array.isArray(object.entitledKeys)){throw TypeError(".license_protocol.WidevinePsshData.entitledKeys: array expected")}message.entitledKeys=[];for(var i=0;i=0){message.groupedLicense=object.groupedLicense}}return message};WidevinePsshData.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.arrays||options.defaults){object.keyIds=[];object.groupIds=[];object.entitledKeys=[]}if(options.defaults){object.algorithm=options.enums===String?"UNENCRYPTED":0;object.provider="";if(options.bytes===String){object.contentId=""}else{object.contentId=[];if(options.bytes!==Array){object.contentId=$util.newBuffer(object.contentId)}}object.trackType="";object.policy="";object.cryptoPeriodIndex=0;if(options.bytes===String){object.groupedLicense=""}else{object.groupedLicense=[];if(options.bytes!==Array){object.groupedLicense=$util.newBuffer(object.groupedLicense)}}object.protectionScheme=0;object.cryptoPeriodSeconds=0;object.type=options.enums===String?"SINGLE":0;object.keySequence=0;object.videoFeature=""}if(message.algorithm!=null&&message.hasOwnProperty("algorithm")){object.algorithm=options.enums===String?$root.license_protocol.WidevinePsshData.Algorithm[message.algorithm]===undefined?message.algorithm:$root.license_protocol.WidevinePsshData.Algorithm[message.algorithm]:message.algorithm}if(message.keyIds&&message.keyIds.length){object.keyIds=[];for(var j=0;j>>3){case 1:{message.entitlementKeyId=reader.bytes();break}case 2:{message.keyId=reader.bytes();break}case 3:{message.key=reader.bytes();break}case 4:{message.iv=reader.bytes();break}case 5:{message.entitlementKeySizeBytes=reader.uint32();break}default:reader.skipType(tag&7);break}}return message};EntitledKey.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};EntitledKey.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.entitlementKeyId!=null&&message.hasOwnProperty("entitlementKeyId")){if(!(message.entitlementKeyId&&typeof message.entitlementKeyId.length==="number"||$util.isString(message.entitlementKeyId))){return "entitlementKeyId: buffer expected"}}if(message.keyId!=null&&message.hasOwnProperty("keyId")){if(!(message.keyId&&typeof message.keyId.length==="number"||$util.isString(message.keyId))){return "keyId: buffer expected"}}if(message.key!=null&&message.hasOwnProperty("key")){if(!(message.key&&typeof message.key.length==="number"||$util.isString(message.key))){return "key: buffer expected"}}if(message.iv!=null&&message.hasOwnProperty("iv")){if(!(message.iv&&typeof message.iv.length==="number"||$util.isString(message.iv))){return "iv: buffer expected"}}if(message.entitlementKeySizeBytes!=null&&message.hasOwnProperty("entitlementKeySizeBytes")){if(!$util.isInteger(message.entitlementKeySizeBytes)){return "entitlementKeySizeBytes: integer expected"}}return null};EntitledKey.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.WidevinePsshData.EntitledKey){return object}var message=new $root.license_protocol.WidevinePsshData.EntitledKey();if(object.entitlementKeyId!=null){if(typeof object.entitlementKeyId==="string"){$util.base64.decode(object.entitlementKeyId,message.entitlementKeyId=$util.newBuffer($util.base64.length(object.entitlementKeyId)),0)}else if(object.entitlementKeyId.length>=0){message.entitlementKeyId=object.entitlementKeyId}}if(object.keyId!=null){if(typeof object.keyId==="string"){$util.base64.decode(object.keyId,message.keyId=$util.newBuffer($util.base64.length(object.keyId)),0)}else if(object.keyId.length>=0){message.keyId=object.keyId}}if(object.key!=null){if(typeof object.key==="string"){$util.base64.decode(object.key,message.key=$util.newBuffer($util.base64.length(object.key)),0)}else if(object.key.length>=0){message.key=object.key}}if(object.iv!=null){if(typeof object.iv==="string"){$util.base64.decode(object.iv,message.iv=$util.newBuffer($util.base64.length(object.iv)),0)}else if(object.iv.length>=0){message.iv=object.iv}}if(object.entitlementKeySizeBytes!=null){message.entitlementKeySizeBytes=object.entitlementKeySizeBytes>>>0}return message};EntitledKey.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){if(options.bytes===String){object.entitlementKeyId=""}else{object.entitlementKeyId=[];if(options.bytes!==Array){object.entitlementKeyId=$util.newBuffer(object.entitlementKeyId)}}if(options.bytes===String){object.keyId=""}else{object.keyId=[];if(options.bytes!==Array){object.keyId=$util.newBuffer(object.keyId)}}if(options.bytes===String){object.key=""}else{object.key=[];if(options.bytes!==Array){object.key=$util.newBuffer(object.key)}}if(options.bytes===String){object.iv=""}else{object.iv=[];if(options.bytes!==Array){object.iv=$util.newBuffer(object.iv)}}object.entitlementKeySizeBytes=32}if(message.entitlementKeyId!=null&&message.hasOwnProperty("entitlementKeyId")){object.entitlementKeyId=options.bytes===String?$util.base64.encode(message.entitlementKeyId,0,message.entitlementKeyId.length):options.bytes===Array?Array.prototype.slice.call(message.entitlementKeyId):message.entitlementKeyId}if(message.keyId!=null&&message.hasOwnProperty("keyId")){object.keyId=options.bytes===String?$util.base64.encode(message.keyId,0,message.keyId.length):options.bytes===Array?Array.prototype.slice.call(message.keyId):message.keyId}if(message.key!=null&&message.hasOwnProperty("key")){object.key=options.bytes===String?$util.base64.encode(message.key,0,message.key.length):options.bytes===Array?Array.prototype.slice.call(message.key):message.key}if(message.iv!=null&&message.hasOwnProperty("iv")){object.iv=options.bytes===String?$util.base64.encode(message.iv,0,message.iv.length):options.bytes===Array?Array.prototype.slice.call(message.iv):message.iv}if(message.entitlementKeySizeBytes!=null&&message.hasOwnProperty("entitlementKeySizeBytes")){object.entitlementKeySizeBytes=message.entitlementKeySizeBytes}return object};EntitledKey.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};EntitledKey.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.WidevinePsshData.EntitledKey"};return EntitledKey})();WidevinePsshData.Algorithm=(function(){var valuesById={},values=Object.create(valuesById);values[valuesById[0]="UNENCRYPTED"]=0;values[valuesById[1]="AESCTR"]=1;return values})();return WidevinePsshData})();license_protocol.FileHashes=(function(){function FileHashes(properties){this.signatures=[];if(properties){for(var keys=Object.keys(properties),i=0;i>>3){case 1:{message.signer=reader.bytes();break}case 2:{if(!(message.signatures&&message.signatures.length)){message.signatures=[]}message.signatures.push($root.license_protocol.FileHashes.Signature.decode(reader,reader.uint32()));break}default:reader.skipType(tag&7);break}}return message};FileHashes.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};FileHashes.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.signer!=null&&message.hasOwnProperty("signer")){if(!(message.signer&&typeof message.signer.length==="number"||$util.isString(message.signer))){return "signer: buffer expected"}}if(message.signatures!=null&&message.hasOwnProperty("signatures")){if(!Array.isArray(message.signatures)){return "signatures: array expected"}for(var i=0;i=0){message.signer=object.signer}}if(object.signatures){if(!Array.isArray(object.signatures)){throw TypeError(".license_protocol.FileHashes.signatures: array expected")}message.signatures=[];for(var i=0;i>>3){case 1:{message.filename=reader.string();break}case 2:{message.testSigning=reader.bool();break}case 3:{message.SHA512Hash=reader.bytes();break}case 4:{message.mainExe=reader.bool();break}case 5:{message.signature=reader.bytes();break}default:reader.skipType(tag&7);break}}return message};Signature.decodeDelimited=function decodeDelimited(reader){if(!(reader instanceof $Reader)){reader=new $Reader(reader)}return this.decode(reader,reader.uint32())};Signature.verify=function verify(message){if(typeof message!=="object"||message===null){return "object expected"}if(message.filename!=null&&message.hasOwnProperty("filename")){if(!$util.isString(message.filename)){return "filename: string expected"}}if(message.testSigning!=null&&message.hasOwnProperty("testSigning")){if(typeof message.testSigning!=="boolean"){return "testSigning: boolean expected"}}if(message.SHA512Hash!=null&&message.hasOwnProperty("SHA512Hash")){if(!(message.SHA512Hash&&typeof message.SHA512Hash.length==="number"||$util.isString(message.SHA512Hash))){return "SHA512Hash: buffer expected"}}if(message.mainExe!=null&&message.hasOwnProperty("mainExe")){if(typeof message.mainExe!=="boolean"){return "mainExe: boolean expected"}}if(message.signature!=null&&message.hasOwnProperty("signature")){if(!(message.signature&&typeof message.signature.length==="number"||$util.isString(message.signature))){return "signature: buffer expected"}}return null};Signature.fromObject=function fromObject(object){if(object instanceof $root.license_protocol.FileHashes.Signature){return object}var message=new $root.license_protocol.FileHashes.Signature();if(object.filename!=null){message.filename=String(object.filename)}if(object.testSigning!=null){message.testSigning=Boolean(object.testSigning)}if(object.SHA512Hash!=null){if(typeof object.SHA512Hash==="string"){$util.base64.decode(object.SHA512Hash,message.SHA512Hash=$util.newBuffer($util.base64.length(object.SHA512Hash)),0)}else if(object.SHA512Hash.length>=0){message.SHA512Hash=object.SHA512Hash}}if(object.mainExe!=null){message.mainExe=Boolean(object.mainExe)}if(object.signature!=null){if(typeof object.signature==="string"){$util.base64.decode(object.signature,message.signature=$util.newBuffer($util.base64.length(object.signature)),0)}else if(object.signature.length>=0){message.signature=object.signature}}return message};Signature.toObject=function toObject(message,options){if(!options){options={}}var object={};if(options.defaults){object.filename="";object.testSigning=false;if(options.bytes===String){object.SHA512Hash=""}else{object.SHA512Hash=[];if(options.bytes!==Array){object.SHA512Hash=$util.newBuffer(object.SHA512Hash)}}object.mainExe=false;if(options.bytes===String){object.signature=""}else{object.signature=[];if(options.bytes!==Array){object.signature=$util.newBuffer(object.signature)}}}if(message.filename!=null&&message.hasOwnProperty("filename")){object.filename=message.filename}if(message.testSigning!=null&&message.hasOwnProperty("testSigning")){object.testSigning=message.testSigning}if(message.SHA512Hash!=null&&message.hasOwnProperty("SHA512Hash")){object.SHA512Hash=options.bytes===String?$util.base64.encode(message.SHA512Hash,0,message.SHA512Hash.length):options.bytes===Array?Array.prototype.slice.call(message.SHA512Hash):message.SHA512Hash}if(message.mainExe!=null&&message.hasOwnProperty("mainExe")){object.mainExe=message.mainExe}if(message.signature!=null&&message.hasOwnProperty("signature")){object.signature=options.bytes===String?$util.base64.encode(message.signature,0,message.signature.length):options.bytes===Array?Array.prototype.slice.call(message.signature):message.signature}return object};Signature.prototype.toJSON=function toJSON(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)};Signature.getTypeUrl=function getTypeUrl(typeUrlPrefix){if(typeUrlPrefix===undefined){typeUrlPrefix="type.googleapis.com"}return typeUrlPrefix+"/license_protocol.FileHashes.Signature"};return Signature})();return FileHashes})();return license_protocol})();return $root})(protobuf);
\ No newline at end of file
diff --git a/cdrm-frontend/src/components/Functions/protobuf.min.js b/cdrm-frontend/src/components/Functions/protobuf.min.js
new file mode 100644
index 0000000..2708fe2
--- /dev/null
+++ b/cdrm-frontend/src/components/Functions/protobuf.min.js
@@ -0,0 +1,8 @@
+/*!
+ * protobuf.js v7.4.0 (c) 2016, daniel wirtz
+ * compiled thu, 22 aug 2024 20:30:39 utc
+ * licensed under the bsd-3-clause license
+ * see: https://github.com/dcodeio/protobuf.js for details
+ */
+!function(d){"use strict";!function(r,u,t){var n=function t(n){var i=u[n];return i||r[n][0].call(i=u[n]={exports:{}},t,i,i.exports),i.exports}(t[0]);n.util.global.protobuf=n,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(n.util.Long=t,n.configure()),n}),"object"==typeof module&&module&&module.exports&&(module.exports=n)}({1:[function(t,n,i){n.exports=function(t,n){var i=Array(arguments.length-1),e=0,r=2,s=!0;for(;r>2],r=(3&o)<<4,h=1;break;case 1:e[s++]=f[r|o>>4],r=(15&o)<<2,h=2;break;case 2:e[s++]=f[r|o>>6],e[s++]=f[63&o],h=0}8191>4,r=h,e=2;break;case 2:n[i++]=(15&r)<<4|(60&h)>>2,r=h,e=3;break;case 3:n[i++]=(3&r)<<6|h,e=0}}if(1===e)throw Error(c);return i-u},i.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,n,i){function r(){this.t={}}(n.exports=r).prototype.on=function(t,n,i){return(this.t[t]||(this.t[t]=[])).push({fn:n,ctx:i||this}),this},r.prototype.off=function(t,n){if(t===d)this.t={};else if(n===d)this.t[t]=[];else for(var i=this.t[t],r=0;r>>0:n<11754943508222875e-54?(u<<31|Math.round(n/1401298464324817e-60))>>>0:(u<<31|127+(t=Math.floor(Math.log(n)/Math.LN2))<<23|8388607&Math.round(n*Math.pow(2,-t)*8388608))>>>0,i,r)}function i(t,n,i){t=t(n,i),n=2*(t>>31)+1,i=t>>>23&255,t&=8388607;return 255==i?t?NaN:1/0*n:0==i?1401298464324817e-60*n*t:n*Math.pow(2,i-150)*(8388608+t)}function r(t,n,i){h[0]=t,n[i]=o[0],n[i+1]=o[1],n[i+2]=o[2],n[i+3]=o[3]}function u(t,n,i){h[0]=t,n[i]=o[3],n[i+1]=o[2],n[i+2]=o[1],n[i+3]=o[0]}function e(t,n){return o[0]=t[n],o[1]=t[n+1],o[2]=t[n+2],o[3]=t[n+3],h[0]}function s(t,n){return o[3]=t[n],o[2]=t[n+1],o[1]=t[n+2],o[0]=t[n+3],h[0]}var h,o,f,c,a;function l(t,n,i,r,u,e){var s,h=r<0?1:0;0===(r=h?-r:r)?(t(0,u,e+n),t(0<1/r?0:2147483648,u,e+i)):isNaN(r)?(t(0,u,e+n),t(2146959360,u,e+i)):17976931348623157e292>>0,u,e+i)):r<22250738585072014e-324?(t((s=r/5e-324)>>>0,u,e+n),t((h<<31|s/4294967296)>>>0,u,e+i)):(t(4503599627370496*(s=r*Math.pow(2,-(r=1024===(r=Math.floor(Math.log(r)/Math.LN2))?1023:r)))>>>0,u,e+n),t((h<<31|r+1023<<20|1048576*s&1048575)>>>0,u,e+i))}function v(t,n,i,r,u){n=t(r,u+n),t=t(r,u+i),r=2*(t>>31)+1,u=t>>>20&2047,i=4294967296*(1048575&t)+n;return 2047==u?i?NaN:1/0*r:0==u?5e-324*r*i:r*Math.pow(2,u-1075)*(i+4503599627370496)}function w(t,n,i){f[0]=t,n[i]=c[0],n[i+1]=c[1],n[i+2]=c[2],n[i+3]=c[3],n[i+4]=c[4],n[i+5]=c[5],n[i+6]=c[6],n[i+7]=c[7]}function b(t,n,i){f[0]=t,n[i]=c[7],n[i+1]=c[6],n[i+2]=c[5],n[i+3]=c[4],n[i+4]=c[3],n[i+5]=c[2],n[i+6]=c[1],n[i+7]=c[0]}function y(t,n){return c[0]=t[n],c[1]=t[n+1],c[2]=t[n+2],c[3]=t[n+3],c[4]=t[n+4],c[5]=t[n+5],c[6]=t[n+6],c[7]=t[n+7],f[0]}function g(t,n){return c[7]=t[n],c[6]=t[n+1],c[5]=t[n+2],c[4]=t[n+3],c[3]=t[n+4],c[2]=t[n+5],c[1]=t[n+6],c[0]=t[n+7],f[0]}return"undefined"!=typeof Float32Array?(h=new Float32Array([-0]),o=new Uint8Array(h.buffer),a=128===o[3],t.writeFloatLE=a?r:u,t.writeFloatBE=a?u:r,t.readFloatLE=a?e:s,t.readFloatBE=a?s:e):(t.writeFloatLE=n.bind(null,d),t.writeFloatBE=n.bind(null,A),t.readFloatLE=i.bind(null,p),t.readFloatBE=i.bind(null,m)),"undefined"!=typeof Float64Array?(f=new Float64Array([-0]),c=new Uint8Array(f.buffer),a=128===c[7],t.writeDoubleLE=a?w:b,t.writeDoubleBE=a?b:w,t.readDoubleLE=a?y:g,t.readDoubleBE=a?g:y):(t.writeDoubleLE=l.bind(null,d,0,4),t.writeDoubleBE=l.bind(null,A,4,0),t.readDoubleLE=v.bind(null,p,0,4),t.readDoubleBE=v.bind(null,m,4,0)),t}function d(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}function A(t,n,i){n[i]=t>>>24,n[i+1]=t>>>16&255,n[i+2]=t>>>8&255,n[i+3]=255&t}function p(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}function m(t,n){return(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}n.exports=r(r)},{}],5:[function(t,n,i){function r(t){try{var n=void 0;if(n&&(n.length||Object.keys(n).length))return n}catch(t){}return null}n.exports=r},{}],6:[function(t,n,i){n.exports=function(n,i,t){var r=t||8192,u=r>>>1,e=null,s=r;return function(t){if(t<1||u>10),e[s++]=56320+(1023&r)):e[s++]=(15&r)<<12|(63&t[n++])<<6|63&t[n++],8191>6|192:(55296==(64512&r)&&56320==(64512&(u=t.charCodeAt(s+1)))?(++s,n[i++]=(r=65536+((1023&r)<<10)+(1023&u))>>18|240,n[i++]=r>>12&63|128):n[i++]=r>>12|224,n[i++]=r>>6&63|128),n[i++]=63&r|128);return i-e}},{}],8:[function(t,n,i){var r=i;function u(){r.util.n(),r.Writer.n(r.BufferWriter),r.Reader.n(r.BufferReader)}r.build="minimal",r.Writer=t(16),r.BufferWriter=t(17),r.Reader=t(9),r.BufferReader=t(10),r.util=t(15),r.rpc=t(12),r.roots=t(11),r.configure=u,u()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(t,n,i){n.exports=o;var r,u=t(15),e=u.LongBits,s=u.utf8;function h(t,n){return RangeError("index out of range: "+t.pos+" + "+(n||1)+" > "+t.len)}function o(t){this.buf=t,this.pos=0,this.len=t.length}function f(){return u.Buffer?function(t){return(o.create=function(t){return u.Buffer.isBuffer(t)?new r(t):a(t)})(t)}:a}var c,a="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new o(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new o(t);throw Error("illegal buffer")};function l(){var t=new e(0,0),n=0;if(!(4=this.len)throw h(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*n)>>>0,t}for(;n<4;++n)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(n=0,4>>0,this.buf[this.pos++]<128)return t}else for(;n<5;++n){if(this.pos>=this.len)throw h(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function v(t,n){return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0}function w(){if(this.pos+8>this.len)throw h(this,8);return new e(v(this.buf,this.pos+=4),v(this.buf,this.pos+=4))}o.create=f(),o.prototype.i=u.Array.prototype.subarray||u.Array.prototype.slice,o.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128||(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128||(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128||!((this.pos+=5)>this.len))))))return c;throw this.pos=this.len,h(this,10)}),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw h(this,4);return v(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw h(this,4);return 0|v(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw h(this,4);var t=u.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},o.prototype.double=function(){if(this.pos+8>this.len)throw h(this,4);var t=u.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},o.prototype.bytes=function(){var t=this.uint32(),n=this.pos,i=this.pos+t;if(i>this.len)throw h(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,i):n===i?(t=u.Buffer)?t.alloc(0):new this.buf.constructor(0):this.i.call(this.buf,n,i)},o.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},o.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw h(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw h(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},o.n=function(t){r=t,o.create=f(),r.n();var n=u.Long?"toLong":"toNumber";u.merge(o.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return w.call(this)[n](!0)},sfixed64:function(){return w.call(this)[n](!1)}})}},{15:15}],10:[function(t,n,i){n.exports=e;var r=t(9),u=((e.prototype=Object.create(r.prototype)).constructor=e,t(15));function e(t){r.call(this,t)}e.n=function(){u.Buffer&&(e.prototype.i=u.Buffer.prototype.slice)},e.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},e.n()},{15:15,9:9}],11:[function(t,n,i){n.exports={}},{}],12:[function(t,n,i){i.Service=t(13)},{13:13}],13:[function(t,n,i){n.exports=r;var h=t(15);function r(t,n,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");h.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!n,this.responseDelimited=!!i}((r.prototype=Object.create(h.EventEmitter.prototype)).constructor=r).prototype.rpcCall=function t(i,n,r,u,e){if(!u)throw TypeError("request must be specified");var s=this;if(!e)return h.asPromise(t,s,i,n,r,u);if(!s.rpcImpl)return setTimeout(function(){e(Error("already ended"))},0),d;try{return s.rpcImpl(i,n[s.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(t,n){if(t)return s.emit("error",t,i),e(t);if(null===n)return s.end(!0),d;if(!(n instanceof r))try{n=r[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,i),e(t)}return s.emit("data",n,i),e(null,n)})}catch(t){return s.emit("error",t,i),setTimeout(function(){e(t)},0),d}},r.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(t,n,i){n.exports=u;var r=t(15);function u(t,n){this.lo=t>>>0,this.hi=n>>>0}var e=u.zero=new u(0,0),s=(e.toNumber=function(){return 0},e.zzEncode=e.zzDecode=function(){return this},e.length=function(){return 1},u.zeroHash="\0\0\0\0\0\0\0\0",u.fromNumber=function(t){var n,i;return 0===t?e:(i=(t=(n=t<0)?-t:t)>>>0,t=(t-i)/4294967296>>>0,n&&(t=~t>>>0,i=~i>>>0,4294967295<++i&&(i=0,4294967295<++t&&(t=0))),new u(i,t))},u.from=function(t){if("number"==typeof t)return u.fromNumber(t);if(r.isString(t)){if(!r.Long)return u.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new u(t.low>>>0,t.high>>>0):e},u.prototype.toNumber=function(t){var n;return!t&&this.hi>>>31?(t=1+~this.lo>>>0,n=~this.hi>>>0,-(t+4294967296*(n=t?n:n+1>>>0))):this.lo+4294967296*this.hi},u.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}},String.prototype.charCodeAt);u.fromHash=function(t){return"\0\0\0\0\0\0\0\0"===t?e:new u((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},u.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},u.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},u.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},u.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0==i?0==n?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:i<128?9:10}},{15:15}],15:[function(t,n,i){var r=i;function u(t,n,i){for(var r=Object.keys(n),u=0;u>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;n[i++]=t.lo}function y(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}a.create=l(),a.alloc=function(t){return new u.Array(t)},u.Array!==Array&&(a.alloc=u.pool(a.alloc,u.Array.prototype.subarray)),a.prototype.e=function(t,n,i){return this.tail=this.tail.next=new o(t,n,i),this.len+=n,this},(w.prototype=Object.create(o.prototype)).fn=function(t,n,i){for(;127>>=7;n[i]=t},a.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new w((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},a.prototype.int32=function(t){return t<0?this.e(b,10,e.fromNumber(t)):this.uint32(t)},a.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},a.prototype.int64=a.prototype.uint64=function(t){t=e.from(t);return this.e(b,t.length(),t)},a.prototype.sint64=function(t){t=e.from(t).zzEncode();return this.e(b,t.length(),t)},a.prototype.bool=function(t){return this.e(v,1,t?1:0)},a.prototype.sfixed32=a.prototype.fixed32=function(t){return this.e(y,4,t>>>0)},a.prototype.sfixed64=a.prototype.fixed64=function(t){t=e.from(t);return this.e(y,4,t.lo).e(y,4,t.hi)},a.prototype.float=function(t){return this.e(u.float.writeFloatLE,4,t)},a.prototype.double=function(t){return this.e(u.float.writeDoubleLE,8,t)};var g=u.Array.prototype.set?function(t,n,i){n.set(t,i)}:function(t,n,i){for(var r=0;r>>0;return i?(u.isString(t)&&(n=a.alloc(i=s.length(t)),s.decode(t,n,0),t=n),this.uint32(i).e(g,i,t)):this.e(v,1,0)},a.prototype.string=function(t){var n=h.length(t);return n?this.uint32(n).e(h.write,n,t):this.e(v,1,0)},a.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new o(f,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(f,0,0),this.len=0),this},a.prototype.ldelim=function(){var t=this.head,n=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=n,this.len+=i),this},a.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,n,i),i+=t.len,t=t.next;return n},a.n=function(t){r=t,a.create=l(),r.n()}},{15:15}],17:[function(t,n,i){n.exports=e;var r=t(16),u=((e.prototype=Object.create(r.prototype)).constructor=e,t(15));function e(){r.call(this)}function s(t,n,i){t.length<40?u.utf8.write(t,n,i):n.utf8Write?n.utf8Write(t,i):n.write(t,i)}e.n=function(){e.alloc=u.u,e.writeBytesBuffer=u.Buffer&&u.Buffer.prototype instanceof Uint8Array&&"set"===u.Buffer.prototype.set.name?function(t,n,i){n.set(t,i)}:function(t,n,i){if(t.copy)t.copy(n,i,0,t.length);else for(var r=0;r>>0;return this.uint32(n),n&&this.e(e.writeBytesBuffer,n,t),this},e.prototype.string=function(t){var n=u.Buffer.byteLength(t);return this.uint32(n),n&&this.e(s,n,t),this},e.n()},{15:15,16:16}]},{},[8])}();
+//# sourceMappingURL=protobuf.min.js.map
diff --git a/cdrm-frontend/src/components/Pages/API.jsx b/cdrm-frontend/src/components/Pages/API.jsx
new file mode 100644
index 0000000..3860977
--- /dev/null
+++ b/cdrm-frontend/src/components/Pages/API.jsx
@@ -0,0 +1,134 @@
+import React, { useState, useEffect } from 'react';
+import { Helmet } from 'react-helmet'; // Import Helmet
+
+const { protocol, hostname, port } = window.location;
+
+let fullHost = `${protocol}//${hostname}`;
+if (
+ (protocol === 'http:' && port !== '80') ||
+ (protocol === 'https:' && port !== '443' && port !== '')
+) {
+ fullHost += `:${port}`;
+}
+
+function API() {
+ const [deviceInfo, setDeviceInfo] = useState({
+ device_type: '',
+ system_id: '',
+ security_level: '',
+ host: '',
+ secret: '',
+ device_name: ''
+ });
+
+ const [prDeviceInfo, setPrDeviceInfo] = useState({
+ security_level: '',
+ host: '',
+ secret: '',
+ device_name: ''
+ });
+
+ useEffect(() => {
+ // Fetch Widevine info
+ fetch('/remotecdm/widevine/deviceinfo')
+ .then(response => response.json())
+ .then(data => {
+ setDeviceInfo({
+ device_type: data.device_type,
+ system_id: data.system_id,
+ security_level: data.security_level,
+ host: data.host,
+ secret: data.secret,
+ device_name: data.device_name
+ });
+ })
+ .catch(error => console.error('Error fetching Widevine info:', error));
+
+ // Fetch PlayReady info
+ fetch('/remotecdm/playready/deviceinfo')
+ .then(response => response.json())
+ .then(data => {
+ setPrDeviceInfo({
+ security_level: data.security_level,
+ host: data.host,
+ secret: data.secret,
+ device_name: data.device_name
+ });
+ })
+ .catch(error => console.error('Error fetching PlayReady info:', error));
+ }, []);
+
+ return (
+
+
} />
+ } />
+ } />
+ } />
diff --git a/cdrm-frontend/src/components/Functions/ParseChallenge.jsx b/cdrm-frontend/src/components/Functions/ParseChallenge.jsx
new file mode 100644
index 0000000..139c574
--- /dev/null
+++ b/cdrm-frontend/src/components/Functions/ParseChallenge.jsx
@@ -0,0 +1,173 @@
+import "./protobuf.min.js";
+import "./license_protocol.min.js";
+
+const { SignedMessage, LicenseRequest } = protobuf.roots.default.license_protocol;
+
+function uint8ArrayToBase64(uint8Array) {
+ const binaryString = Array.from(uint8Array)
+ .map(b => String.fromCharCode(b))
+ .join('');
+
+ return btoa(binaryString);
+}
+
+function parseFetch(fetchString) {
+ // Remove `await` if it exists in the string
+ fetchString = fetchString.replace(/^await\s+/, "");
+
+ // Use a more lenient regex to capture the fetch pattern (including complex bodies)
+ const fetchRegex = /fetch\(['"](.+?)['"],\s*(\{.+?\})\)/s; // Non-greedy match for JSON
+ const lines = fetchString.split('\n').map(line => line.trim()).filter(Boolean);
+ const result = {
+ method: 'UNDEFINED',
+ url: '',
+ headers: {},
+ body: null,
+ };
+
+ // Try matching the regex
+ const fetchMatch = fetchString.match(fetchRegex);
+ if (!fetchMatch) {
+ console.log(fetchString);
+ throw new Error("Invalid 'Copy as fetch' string.");
+ }
+
+ // Extract URL from the match
+ result.url = fetchMatch[1];
+
+ // Parse the options JSON from the match (this will include headers, body, etc.)
+ const optionsString = fetchMatch[2];
+ const options = JSON.parse(optionsString);
+
+ // Assign method, headers, and body if available
+ if (options.method) result.method = options.method;
+ if (options.headers) result.headers = options.headers;
+ if (options.body) result.body = options.body;
+
+ return result;
+}
+
+
+const WIDEVINE_SYSTEM_ID = new Uint8Array([0xed, 0xef, 0x8b, 0xa9, 0x79, 0xd6, 0x4a, 0xce, 0xa3, 0xc8, 0x27, 0xdc, 0xd5, 0x1d, 0x21, 0xed]);
+const PLAYREADY_SYSTEM_ID = new Uint8Array([0x9a, 0x04, 0xf0, 0x79, 0x98, 0x40, 0x42, 0x86, 0xab, 0x92, 0xe6, 0x5b, 0xe0, 0x88, 0x5f, 0x95]);
+const PSSH_MAGIC = new Uint8Array([0x70, 0x73, 0x73, 0x68]);
+
+function intToUint8Array(num, endian) {
+ const buffer = new ArrayBuffer(4);
+ const view = new DataView(buffer);
+ view.setUint32(0, num, endian);
+ return new Uint8Array(buffer);
+}
+
+function shortToUint8Array(num, endian) {
+ const buffer = new ArrayBuffer(2);
+ const view = new DataView(buffer);
+ view.setUint16(0, num, endian);
+ return new Uint8Array(buffer);
+}
+
+function psshDataToPsshBoxB64(pssh_data, system_id) {
+ const dataLength = pssh_data.length;
+ const totalLength = dataLength + 32;
+ const pssh = new Uint8Array([
+ ...intToUint8Array(totalLength, false),
+ ...PSSH_MAGIC,
+ ...new Uint8Array(4),
+ ...system_id,
+ ...intToUint8Array(dataLength, false),
+ ...pssh_data
+ ]);
+ return uint8ArrayToBase64(pssh);
+}
+
+function wrmHeaderToPlayReadyHeader(wrm_header){
+ const playready_object = new Uint8Array([
+ ...shortToUint8Array(1, true),
+ ...shortToUint8Array(wrm_header.length, true),
+ ...wrm_header
+ ]);
+
+ return new Uint8Array([
+ ...intToUint8Array(playready_object.length + 2 + 4, true),
+ ...shortToUint8Array(1, true),
+ ...playready_object
+ ]);
+}
+
+function encodeUtf16LE(str) {
+ const buffer = new Uint8Array(str.length * 2);
+ for (let i = 0; i < str.length; i++) {
+ const code = str.charCodeAt(i);
+ buffer[i * 2] = code & 0xff;
+ buffer[i * 2 + 1] = code >> 8;
+ }
+ return buffer;
+}
+
+function stringToUint8Array(string) {
+ return Uint8Array.from(string.split("").map(x => x.charCodeAt()));
+}
+
+export async function readTextFromClipboard() {
+ try {
+ // Request text from the clipboard
+ const clipboardText = await navigator.clipboard.readText();
+
+ const result = parseFetch(clipboardText);
+
+ let pssh_data_string;
+ let payload_string;
+
+ if (result.body.startsWith("<")) {
+ // If body starts with "<", process it as PlayReady content
+ payload_string = result.body;
+ const wrmHeaderMatch = payload_string.match(/.*(
+
+ API
+
+
+ );
+}
+
+export default API;
diff --git a/cdrm-frontend/src/components/Pages/Cache.jsx b/cdrm-frontend/src/components/Pages/Cache.jsx
new file mode 100644
index 0000000..c24cd6e
--- /dev/null
+++ b/cdrm-frontend/src/components/Pages/Cache.jsx
@@ -0,0 +1,107 @@
+import { useState, useEffect, useRef } from 'react';
+import { Helmet } from 'react-helmet'; // Import Helmet
+
+function Cache() {
+ const [searchQuery, setSearchQuery] = useState('');
+ const [cacheData, setCacheData] = useState([]);
+ const [keyCount, setKeyCount] = useState(0); // New state to store the key count
+ const debounceTimeout = useRef(null);
+
+ // Fetch the key count when the component mounts
+ useEffect(() => {
+ const fetchKeyCount = async () => {
+ try {
+ const response = await fetch('/api/cache/keycount');
+ const data = await response.json();
+ setKeyCount(data.count); // Update key count
+ } catch (error) {
+ console.error('Error fetching key count:', error);
+ }
+ };
+
+ fetchKeyCount();
+ }, []); // Run only once when the component mounts
+
+ const handleInputChange = (event) => {
+ const query = event.target.value;
+ setSearchQuery(query); // Update the search query
+
+ // Clear the previous timeout
+ if (debounceTimeout.current) {
+ clearTimeout(debounceTimeout.current);
+ }
+
+ // Set a new timeout to send the API call after 1 second of no typing
+ debounceTimeout.current = setTimeout(() => {
+ if (query.trim() !== '') {
+ sendApiCall(query); // Only call the API if the query is not empty
+ } else {
+ setCacheData([]); // Clear results if query is empty
+ }
+ }, 1000); // 1 second delay
+ };
+
+ const sendApiCall = (text) => {
+ fetch('/api/cache/search', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ input: text }),
+ })
+ .then((response) => response.json())
+ .then((data) => setCacheData(data)) // Update cache data with the results
+ .catch((error) => console.error('Error:', error));
+ };
+
+ return (
+
+
+ Sending a decryption request
+
+
+ + {`import requests + +print(requests.post( + url='${fullHost}/api/decrypt', + headers={ + 'Content-Type': 'application/json', + }, + json={ + 'pssh': 'AAAAW3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADsIARIQ62dqu8s0Xpa7z2FmMPGj2hoNd2lkZXZpbmVfdGVzdCIQZmtqM2xqYVNkZmFsa3IzaioCSEQyAA==', + 'licurl': 'https://cwip-shaka-proxy.appspot.com/no_auth', + 'headers': str({ + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0', + 'Accept': '*/*', + 'Accept-Language': 'en-US,en;q=0.5', + }) + } +).json()['message'])`} ++
+
+ Sending a search request
+
+
+ +{`import requests + +print(requests.post( + url='${fullHost}/api/cache/search', + json={ + 'input': 'AAAAW3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADsIARIQ62dqu8s0Xpa7z2FmMPGj2hoNd2lkZXZpbmVfdGVzdCIQZmtqM2xqYVNkZmFsa3IzaioCSEQyAA==' + } +).json())`} ++
+
+ PyWidevine RemoteCDM info
+
+
+
+ Device Type: '{deviceInfo.device_type}'
+ System ID: {deviceInfo.system_id}
+ Security Level: {deviceInfo.security_level}
+ Host: {fullHost}/remotecdm/widevine
+ Secret: {deviceInfo.secret}
+ Device Name: {deviceInfo.device_name}
+
+
+
+ PyPlayready RemoteCDM info
+
+
+
+ Security Level: {prDeviceInfo.security_level}
+ Host: {fullHost}/remotecdm/playready
+ Secret: {prDeviceInfo.secret}
+ Device Name: {prDeviceInfo.device_name}
+
+
+ Cache
+
+
+ );
+}
+
+export default Cache;
diff --git a/cdrm-frontend/src/components/Pages/HomePage.jsx b/cdrm-frontend/src/components/Pages/HomePage.jsx
index 2601ed5..7606e79 100644
--- a/cdrm-frontend/src/components/Pages/HomePage.jsx
+++ b/cdrm-frontend/src/components/Pages/HomePage.jsx
@@ -1,10 +1,192 @@
-function HomePage () {
+import React, { useState, useEffect, useRef } from 'react';
+import { readTextFromClipboard } from '../Functions/ParseChallenge'
+import { Helmet } from 'react-helmet'; // Import Helmet
+function HomePage() {
+ const [pssh, setPssh] = useState('');
+ const [licurl, setLicurl] = useState('');
+ const [proxy, setProxy] = useState('');
+ const [headers, setHeaders] = useState('');
+ const [cookies, setCookies] = useState('');
+ const [data, setData] = useState('');
+ const [message, setMessage] = useState('');
+ const [isVisible, setIsVisible] = useState(false);
- return (
-
+
+
+ Download Cache
+
+
+
+
+
+
+
+ PSSH | +KID | +Key | +
---|---|---|
{item.PSSH} | +{item.KID} | +{item.Key} | +
+ No data found + | +
+ const bottomRef = useRef(null);
+ const messageRef = useRef(null); // Reference to result container
+
+ const handleReset = () => {
+ if (isVisible) {
+ setIsVisible(false);
+ }
+ setPssh('');
+ setLicurl('');
+ setProxy('');
+ setHeaders('');
+ setCookies('');
+ setData('');
+ };
+
+ const handleSubmitButton = (event) => {
+ event.preventDefault();
+
+ fetch('/api/decrypt', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ pssh: pssh,
+ licurl: licurl,
+ proxy: proxy,
+ headers: headers,
+ cookies: cookies,
+ data: data
+ }),
+ })
+ .then(response => response.json())
+ .then(data => {
+ const resultMessage = data['message'].replace(/\n/g, '
'); + setMessage(resultMessage); + setIsVisible(true); + }) + .catch((error) => { + console.error('Error during decryption request:', error); + setMessage('Error: Unable to process request.'); + setIsVisible(true); + }); + }; + + const handleCopy = (event) => { + event.preventDefault(); + if (messageRef.current) { + const textToCopy = messageRef.current.innerText; // Grab the plain text (with visual line breaks) + navigator.clipboard.writeText(textToCopy).catch(err => { + alert('Failed to copy!'); + console.error(err); + }); + } + }; + + + const handleFetchPaste = () => { + event.preventDefault(); + readTextFromClipboard().then(() => { + setPssh(document.getElementById("pssh").value); + setLicurl(document.getElementById("licurl").value); + setHeaders(document.getElementById("headers").value); + setData(document.getElementById("data").value); + }).catch(err => { + alert('Failed to paste from fetch!'); + }); + } + + useEffect(() => { + if (isVisible && bottomRef.current) { + bottomRef.current.scrollIntoView({ behavior: 'smooth' }); + } + }, [message, isVisible]); + + return ( + <> +
'); + setMessage(resultMessage); + setIsVisible(true); + }) + .catch((error) => { + console.error('Error during decryption request:', error); + setMessage('Error: Unable to process request.'); + setIsVisible(true); + }); + }; + + const handleCopy = (event) => { + event.preventDefault(); + if (messageRef.current) { + const textToCopy = messageRef.current.innerText; // Grab the plain text (with visual line breaks) + navigator.clipboard.writeText(textToCopy).catch(err => { + alert('Failed to copy!'); + console.error(err); + }); + } + }; + + + const handleFetchPaste = () => { + event.preventDefault(); + readTextFromClipboard().then(() => { + setPssh(document.getElementById("pssh").value); + setLicurl(document.getElementById("licurl").value); + setHeaders(document.getElementById("headers").value); + setData(document.getElementById("data").value); + }).catch(err => { + alert('Failed to paste from fetch!'); + }); + } + + useEffect(() => { + if (isVisible && bottomRef.current) { + bottomRef.current.scrollIntoView({ behavior: 'smooth' }); + } + }, [message, isVisible]); + + return ( + <> +
+
+ CDRM-Project
+
+
+
+
+ {isVisible && (
+
+
- )
+ )}
+ >
+ );
}
-export default HomePage
\ No newline at end of file
+export default HomePage;
diff --git a/cdrm-frontend/src/components/Pages/TestPlayer.jsx b/cdrm-frontend/src/components/Pages/TestPlayer.jsx
new file mode 100644
index 0000000..e85d827
--- /dev/null
+++ b/cdrm-frontend/src/components/Pages/TestPlayer.jsx
@@ -0,0 +1,158 @@
+import React, { useState, useEffect, useRef } from 'react';
+import shaka from 'shaka-player';
+import { Helmet } from 'react-helmet'; // Import Helmet
+
+function TestPlayer() {
+ const [mpdUrl, setMpdUrl] = useState(''); // State to hold the MPD URL
+ const [kids, setKids] = useState(''); // State to hold KIDs (separated by line breaks)
+ const [keys, setKeys] = useState(''); // State to hold Keys (separated by line breaks)
+ const [headers, setHeaders] = useState(''); // State to hold request headers
+
+ const videoRef = useRef(null); // Ref for the video element
+ const playerRef = useRef(null); // Ref for Shaka Player instance
+
+ // Function to update the MPD URL state
+ const handleInputChange = (event) => {
+ setMpdUrl(event.target.value);
+ };
+
+ // Function to update KIDs and Keys
+ const handleKidsChange = (event) => {
+ setKids(event.target.value);
+ };
+
+ const handleKeysChange = (event) => {
+ setKeys(event.target.value);
+ };
+
+ const handleHeadersChange = (event) => {
+ setHeaders(event.target.value);
+ };
+
+ // Function to initialize Shaka Player
+ const initializePlayer = () => {
+ if (videoRef.current) {
+ // Initialize Shaka Player only if it's not already initialized
+ if (!playerRef.current) {
+ const player = new shaka.Player(videoRef.current);
+ playerRef.current = player;
+
+ // Add error listener
+ player.addEventListener('error', (event) => {
+ console.error('Error code', event.detail.code, 'object', event.detail);
+ });
+ }
+ }
+ };
+
+ // Function to handle submit and configure player with DRM keys and headers
+ const handleSubmit = () => {
+ if (mpdUrl && kids && keys) {
+ // Split the KIDs and Keys by new lines
+ const kidsArray = kids.split("\n").map((k) => k.trim());
+ const keysArray = keys.split("\n").map((k) => k.trim());
+
+ if (kidsArray.length !== keysArray.length) {
+ console.error("The number of KIDs and Keys must be the same.");
+ return;
+ }
+
+ // Initialize Shaka Player only when the submit button is pressed
+ const player = new shaka.Player(videoRef.current);
+
+ // Widevine DRM configuration with the provided KIDs and Keys
+ const config = {
+ drm: {
+ clearKeys: {},
+ },
+ };
+
+ // Map KIDs to Keys
+ kidsArray.forEach((kid, index) => {
+ config.drm.clearKeys[kid] = keysArray[index];
+ });
+
+ console.log("Configuring player with the following DRM config and headers:", config);
+
+ // Configure the player with ClearKey DRM and custom headers
+ player.configure(config);
+
+ // Load the video stream with MPD URL
+ player.load(mpdUrl).then(() => {
+ console.log('Video loaded');
+ }).catch((error) => {
+ console.error('Error loading the video', error);
+ });
+ } else {
+ console.error('MPD URL, KIDs, and Keys are required.');
+ }
+ };
+
+ // Load the video stream whenever the MPD URL changes
+ useEffect(() => {
+ initializePlayer(); // Initialize the player if it's not initialized already
+ }, []); // This effect runs only once on mount
+
+ // Helper function to parse headers from the textarea input
+ const parseHeaders = (headersText) => {
+ const headersArr = headersText.split('\n');
+ const headersObj = {};
+ headersArr.forEach((line) => {
+ const [key, value] = line.split(':');
+ if (key && value) {
+ headersObj[key.trim()] = value.trim();
+ }
+ });
+ return headersObj;
+ };
+
+ return (
+
+
+
+
+ Results:
+ + +
+
+
+
+ Test Player
+
+
+ );
+}
+
+export default TestPlayer;
diff --git a/cdrm-frontend/src/index.css b/cdrm-frontend/src/index.css
index a461c50..42c56bd 100644
--- a/cdrm-frontend/src/index.css
+++ b/cdrm-frontend/src/index.css
@@ -1 +1,10 @@
-@import "tailwindcss";
\ No newline at end of file
+@import "tailwindcss";
+
+details summary::-webkit-details-marker {
+ display: none;
+ }
+
+ details summary {
+ list-style: none;
+ cursor: pointer;
+ }
\ No newline at end of file
+
+
+
+
+
+
+
+