okova
Version:
Advanced DRM inspection toolkit
2,870 lines • 96.3 kB
text/typescript
import * as $protobuf from 'protobufjs';
import Long from 'long';
import { AffinePoint } from '@noble/curves/abstract/curve';
import * as barsic from 'barsic';
import { b } from 'barsic';
import { DOMParser } from '@xmldom/xmldom';
interface Key$2 {
keyId: string;
key: string;
}
/**
* https://w3c.github.io/encrypted-media/index.html#dfn-cdm
*/
interface Cdm {
keySystem: string;
createSession: (sessionType?: MediaKeySessionType) => Promise<string> | string;
generateRequest: (sessionId: string, initData: Uint8Array, initDataType?: string) => Promise<Uint8Array>;
updateSession(sessionId: string, response: Uint8Array): Promise<void>;
closeSession(sessionId: string): Promise<void>;
removeSession?(sessionId: string): Promise<void>;
getKeys?(sessionId: string): Promise<Key$2[]>;
}
/**
* https://www.w3.org/TR/encrypted-media-2/#mediakeymessageevent
*/
declare class MessageEvent extends Event implements MediaKeyMessageEvent {
readonly messageType: MediaKeyMessageType;
readonly message: ArrayBuffer;
constructor(messageType: MediaKeyMessageType, message: ArrayBuffer);
}
declare class Session$2 extends EventTarget implements MediaKeySession {
#private;
sessionId: string;
readonly keyStatuses: Map<BufferSource, MediaKeyStatus>;
readonly expiration: number;
readonly closed: Promise<MediaKeySessionClosedReason>;
onmessage: ((this: MediaKeySession, ev: MediaKeyMessageEvent) => any) | null;
onkeyschange: ((this: MediaKeySession, ev: Event) => any) | null;
onkeystatuseschange: ((this: MediaKeySession, ev: Event) => any) | null;
sessionType?: MediaKeySessionType;
keySystem: Cdm;
keys: Key$2[];
constructor(sessionType: MediaKeySessionType | undefined, keySystem: Cdm);
load(sessionId: string): Promise<boolean>;
generateRequest(initDataType: string, initData: BufferSource): Promise<void>;
update(response: BufferSource): Promise<void>;
close(): Promise<void>;
remove(): Promise<void>;
waitForLicenseRequest(): Promise<Uint8Array<ArrayBufferLike>>;
waitForKeyStatusesChange(): Promise<Key$2[]>;
}
/**
* https://www.w3.org/TR/encrypted-media-2/#navigator-extension-requestmediakeysystemaccess
*/
declare const requestMediaKeySystemAccess: (keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]) => {
keySystem: string;
createMediaKeys: ({ cdm }: {
cdm: Cdm;
}) => Promise<{
createSession: (sessionType?: MediaKeySessionType) => MediaKeySession & Session$2;
setServerCertificate: (serverCertificate: BufferSource) => Promise<boolean>;
getStatusForPolicy: () => Promise<MediaKeyStatus>;
}>;
getConfiguration: () => MediaKeySystemConfiguration;
};
declare const fromText: (data: string) => {
toBase64: () => string;
toHex: () => string;
toBuffer: () => Uint8Array<ArrayBufferLike>;
};
declare const fromBinary: (data: string) => {
toBuffer: () => Uint8Array<ArrayBuffer>;
};
declare const fromBase64: (data: string) => {
toBuffer: () => Uint8Array<ArrayBuffer>;
toText: () => string;
toHex: () => string;
};
declare const fromBuffer: (data: Uint8Array) => {
toBase64: () => string;
toHex: () => string;
toText: () => string;
toBinary: () => string;
};
declare const fromHex: (data: string) => {
toBase64: () => string;
toBuffer: () => Uint8Array;
toText: () => string;
};
declare const parseBufferSource: (data: BufferSource) => Uint8Array<ArrayBufferLike>;
type Logger = Pick<typeof console, 'debug' | 'error' | 'info' | 'warn'>;
declare class BinaryReader {
offset: number;
length: number;
rawBytes: Uint8Array;
dataView: DataView;
constructor(data: Uint8Array);
readUint8(): number;
readUint16(little?: boolean): number;
readUint32(little?: boolean): number;
readBytes(size: number): Uint8Array<ArrayBufferLike>;
reset(): void;
}
declare const compareArrays: (arr1: Uint8Array, arr2: Uint8Array) => boolean;
declare const bytesToString: (bytes: Uint8Array) => string;
declare const bytesToBase64: (uint8array: Uint8Array) => string;
declare const stringToBytes: (string: string) => Uint8Array<ArrayBuffer>;
declare const base64ToBytes: (base64_string: string) => Uint8Array<ArrayBuffer>;
declare const xorArrays: (arr1: Uint8Array, arr2: Uint8Array) => Uint8Array<ArrayBuffer>;
declare const getRandomBytes: (size: number) => Uint8Array<ArrayBuffer>;
/** PlatformVerificationStatus enum. */
declare enum PlatformVerificationStatus {
PLATFORM_UNVERIFIED = 0,
PLATFORM_TAMPERED = 1,
PLATFORM_SOFTWARE_VERIFIED = 2,
PLATFORM_HARDWARE_VERIFIED = 3,
PLATFORM_NO_VERIFICATION = 4,
PLATFORM_SECURE_STORAGE_SOFTWARE_VERIFIED = 5,
}
/** Represents a License. */
declare class License implements ILicense {
/**
* Constructs a new License.
* @param [p] Properties to set
*/
constructor(p?: ILicense);
/** License id. */
public id?: ILicenseIdentification | null;
/** License policy. */
public policy?: License.IPolicy | null;
/** License key. */
public key: License.IKeyContainer[];
/** License licenseStartTime. */
public licenseStartTime: number | Long;
/** License remoteAttestationVerified. */
public remoteAttestationVerified: boolean;
/** License providerClientToken. */
public providerClientToken: Uint8Array;
/** License protectionScheme. */
public protectionScheme: number;
/** License srmRequirement. */
public srmRequirement: Uint8Array;
/** License srmUpdate. */
public srmUpdate: Uint8Array;
/** License platformVerificationStatus. */
public platformVerificationStatus: PlatformVerificationStatus;
/** License groupIds. */
public groupIds: Uint8Array[];
/**
* Creates a new License instance using the specified properties.
* @param [properties] Properties to set
* @returns License instance
*/
public static create(properties?: ILicense): License;
/**
* Encodes the specified License message. Does not implicitly {@link License.verify|verify} messages.
* @param m License message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(m: ILicense, w?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified License message, length delimited. Does not implicitly {@link License.verify|verify} messages.
* @param message License message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: ILicense,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a License message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns License
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(r: $protobuf.Reader | Uint8Array, l?: number): License;
/**
* Decodes a License message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns License
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): License;
/**
* Creates a License message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns License
*/
public static fromObject(d: { [k: string]: any }): License;
/**
* Creates a plain object from a License message. Also converts values to other types if specified.
* @param m License
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: License,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this License to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for License
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
declare namespace License {
/** Properties of a Policy. */
interface IPolicy {
/** Policy canPlay */
canPlay?: boolean | null;
/** Policy canPersist */
canPersist?: boolean | null;
/** Policy canRenew */
canRenew?: boolean | null;
/** Policy rentalDurationSeconds */
rentalDurationSeconds?: number | Long | null;
/** Policy playbackDurationSeconds */
playbackDurationSeconds?: number | Long | null;
/** Policy licenseDurationSeconds */
licenseDurationSeconds?: number | Long | null;
/** Policy renewalRecoveryDurationSeconds */
renewalRecoveryDurationSeconds?: number | Long | null;
/** Policy renewalServerUrl */
renewalServerUrl?: string | null;
/** Policy renewalDelaySeconds */
renewalDelaySeconds?: number | Long | null;
/** Policy renewalRetryIntervalSeconds */
renewalRetryIntervalSeconds?: number | Long | null;
/** Policy renewWithUsage */
renewWithUsage?: boolean | null;
/** Policy alwaysIncludeClientId */
alwaysIncludeClientId?: boolean | null;
/** Policy playStartGracePeriodSeconds */
playStartGracePeriodSeconds?: number | Long | null;
/** Policy softEnforcePlaybackDuration */
softEnforcePlaybackDuration?: boolean | null;
/** Policy softEnforceRentalDuration */
softEnforceRentalDuration?: boolean | null;
}
/** Represents a Policy. */
class Policy implements IPolicy {
/**
* Constructs a new Policy.
* @param [p] Properties to set
*/
constructor(p?: License.IPolicy);
/** Policy canPlay. */
public canPlay: boolean;
/** Policy canPersist. */
public canPersist: boolean;
/** Policy canRenew. */
public canRenew: boolean;
/** Policy rentalDurationSeconds. */
public rentalDurationSeconds: number | Long;
/** Policy playbackDurationSeconds. */
public playbackDurationSeconds: number | Long;
/** Policy licenseDurationSeconds. */
public licenseDurationSeconds: number | Long;
/** Policy renewalRecoveryDurationSeconds. */
public renewalRecoveryDurationSeconds: number | Long;
/** Policy renewalServerUrl. */
public renewalServerUrl: string;
/** Policy renewalDelaySeconds. */
public renewalDelaySeconds: number | Long;
/** Policy renewalRetryIntervalSeconds. */
public renewalRetryIntervalSeconds: number | Long;
/** Policy renewWithUsage. */
public renewWithUsage: boolean;
/** Policy alwaysIncludeClientId. */
public alwaysIncludeClientId: boolean;
/** Policy playStartGracePeriodSeconds. */
public playStartGracePeriodSeconds: number | Long;
/** Policy softEnforcePlaybackDuration. */
public softEnforcePlaybackDuration: boolean;
/** Policy softEnforceRentalDuration. */
public softEnforceRentalDuration: boolean;
/**
* Creates a new Policy instance using the specified properties.
* @param [properties] Properties to set
* @returns Policy instance
*/
public static create(properties?: License.IPolicy): License.Policy;
/**
* Encodes the specified Policy message. Does not implicitly {@link License.Policy.verify|verify} messages.
* @param m Policy message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: License.IPolicy,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified Policy message, length delimited. Does not implicitly {@link License.Policy.verify|verify} messages.
* @param message Policy message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: License.IPolicy,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a Policy message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns Policy
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): License.Policy;
/**
* Decodes a Policy message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Policy
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): License.Policy;
/**
* Creates a Policy message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns Policy
*/
public static fromObject(d: { [k: string]: any }): License.Policy;
/**
* Creates a plain object from a Policy message. Also converts values to other types if specified.
* @param m Policy
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: License.Policy,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this Policy to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for Policy
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a KeyContainer. */
interface IKeyContainer {
/** KeyContainer id */
id?: Uint8Array | null;
/** KeyContainer iv */
iv?: Uint8Array | null;
/** KeyContainer key */
key?: Uint8Array | null;
/** KeyContainer type */
type?: License.KeyContainer.KeyType | null;
/** KeyContainer level */
level?: License.KeyContainer.SecurityLevel | null;
/** KeyContainer requiredProtection */
requiredProtection?: License.KeyContainer.IOutputProtection | null;
/** KeyContainer requestedProtection */
requestedProtection?: License.KeyContainer.IOutputProtection | null;
/** KeyContainer keyControl */
keyControl?: License.KeyContainer.IKeyControl | null;
/** KeyContainer operatorSessionKeyPermissions */
operatorSessionKeyPermissions?: License.KeyContainer.IOperatorSessionKeyPermissions | null;
/** KeyContainer videoResolutionConstraints */
videoResolutionConstraints?:
| License.KeyContainer.IVideoResolutionConstraint[]
| null;
/** KeyContainer antiRollbackUsageTable */
antiRollbackUsageTable?: boolean | null;
/** KeyContainer trackLabel */
trackLabel?: string | null;
}
/** Represents a KeyContainer. */
class KeyContainer implements IKeyContainer {
/**
* Constructs a new KeyContainer.
* @param [p] Properties to set
*/
constructor(p?: License.IKeyContainer);
/** KeyContainer id. */
public id: Uint8Array;
/** KeyContainer iv. */
public iv: Uint8Array;
/** KeyContainer key. */
public key: Uint8Array;
/** KeyContainer type. */
public type: License.KeyContainer.KeyType;
/** KeyContainer level. */
public level: License.KeyContainer.SecurityLevel;
/** KeyContainer requiredProtection. */
public requiredProtection?: License.KeyContainer.IOutputProtection | null;
/** KeyContainer requestedProtection. */
public requestedProtection?: License.KeyContainer.IOutputProtection | null;
/** KeyContainer keyControl. */
public keyControl?: License.KeyContainer.IKeyControl | null;
/** KeyContainer operatorSessionKeyPermissions. */
public operatorSessionKeyPermissions?: License.KeyContainer.IOperatorSessionKeyPermissions | null;
/** KeyContainer videoResolutionConstraints. */
public videoResolutionConstraints: License.KeyContainer.IVideoResolutionConstraint[];
/** KeyContainer antiRollbackUsageTable. */
public antiRollbackUsageTable: boolean;
/** KeyContainer trackLabel. */
public trackLabel: string;
/**
* Creates a new KeyContainer instance using the specified properties.
* @param [properties] Properties to set
* @returns KeyContainer instance
*/
public static create(
properties?: License.IKeyContainer,
): License.KeyContainer;
/**
* Encodes the specified KeyContainer message. Does not implicitly {@link License.KeyContainer.verify|verify} messages.
* @param m KeyContainer message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: License.IKeyContainer,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified KeyContainer message, length delimited. Does not implicitly {@link License.KeyContainer.verify|verify} messages.
* @param message KeyContainer message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: License.IKeyContainer,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a KeyContainer message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns KeyContainer
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): License.KeyContainer;
/**
* Decodes a KeyContainer message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns KeyContainer
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): License.KeyContainer;
/**
* Creates a KeyContainer message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns KeyContainer
*/
public static fromObject(d: { [k: string]: any }): License.KeyContainer;
/**
* Creates a plain object from a KeyContainer message. Also converts values to other types if specified.
* @param m KeyContainer
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: License.KeyContainer,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this KeyContainer to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for KeyContainer
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
namespace KeyContainer {
/** KeyType enum. */
enum KeyType {
SIGNING = 1,
CONTENT = 2,
KEY_CONTROL = 3,
OPERATOR_SESSION = 4,
ENTITLEMENT = 5,
OEM_CONTENT = 6,
}
/** SecurityLevel enum. */
enum SecurityLevel {
SW_SECURE_CRYPTO = 1,
SW_SECURE_DECODE = 2,
HW_SECURE_CRYPTO = 3,
HW_SECURE_DECODE = 4,
HW_SECURE_ALL = 5,
}
/** Properties of a KeyControl. */
interface IKeyControl {
/** KeyControl keyControlBlock */
keyControlBlock?: Uint8Array | null;
/** KeyControl iv */
iv?: Uint8Array | null;
}
/** Represents a KeyControl. */
class KeyControl implements IKeyControl {
/**
* Constructs a new KeyControl.
* @param [p] Properties to set
*/
constructor(p?: License.KeyContainer.IKeyControl);
/** KeyControl keyControlBlock. */
public keyControlBlock: Uint8Array;
/** KeyControl iv. */
public iv: Uint8Array;
/**
* Creates a new KeyControl instance using the specified properties.
* @param [properties] Properties to set
* @returns KeyControl instance
*/
public static create(
properties?: License.KeyContainer.IKeyControl,
): License.KeyContainer.KeyControl;
/**
* Encodes the specified KeyControl message. Does not implicitly {@link License.KeyContainer.KeyControl.verify|verify} messages.
* @param m KeyControl message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: License.KeyContainer.IKeyControl,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified KeyControl message, length delimited. Does not implicitly {@link License.KeyContainer.KeyControl.verify|verify} messages.
* @param message KeyControl message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: License.KeyContainer.IKeyControl,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a KeyControl message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns KeyControl
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): License.KeyContainer.KeyControl;
/**
* Decodes a KeyControl message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns KeyControl
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): License.KeyContainer.KeyControl;
/**
* Creates a KeyControl message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns KeyControl
*/
public static fromObject(d: {
[k: string]: any;
}): License.KeyContainer.KeyControl;
/**
* Creates a plain object from a KeyControl message. Also converts values to other types if specified.
* @param m KeyControl
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: License.KeyContainer.KeyControl,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this KeyControl to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for KeyControl
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of an OutputProtection. */
interface IOutputProtection {
/** OutputProtection hdcp */
hdcp?: License.KeyContainer.OutputProtection.HDCP | null;
/** OutputProtection cgmsFlags */
cgmsFlags?: License.KeyContainer.OutputProtection.CGMS | null;
/** OutputProtection hdcpSrmRule */
hdcpSrmRule?: License.KeyContainer.OutputProtection.HdcpSrmRule | null;
/** OutputProtection disableAnalogOutput */
disableAnalogOutput?: boolean | null;
/** OutputProtection disableDigitalOutput */
disableDigitalOutput?: boolean | null;
}
/** Represents an OutputProtection. */
class OutputProtection implements IOutputProtection {
/**
* Constructs a new OutputProtection.
* @param [p] Properties to set
*/
constructor(p?: License.KeyContainer.IOutputProtection);
/** OutputProtection hdcp. */
public hdcp: License.KeyContainer.OutputProtection.HDCP;
/** OutputProtection cgmsFlags. */
public cgmsFlags: License.KeyContainer.OutputProtection.CGMS;
/** OutputProtection hdcpSrmRule. */
public hdcpSrmRule: License.KeyContainer.OutputProtection.HdcpSrmRule;
/** OutputProtection disableAnalogOutput. */
public disableAnalogOutput: boolean;
/** OutputProtection disableDigitalOutput. */
public disableDigitalOutput: boolean;
/**
* Creates a new OutputProtection instance using the specified properties.
* @param [properties] Properties to set
* @returns OutputProtection instance
*/
public static create(
properties?: License.KeyContainer.IOutputProtection,
): License.KeyContainer.OutputProtection;
/**
* Encodes the specified OutputProtection message. Does not implicitly {@link License.KeyContainer.OutputProtection.verify|verify} messages.
* @param m OutputProtection message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: License.KeyContainer.IOutputProtection,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified OutputProtection message, length delimited. Does not implicitly {@link License.KeyContainer.OutputProtection.verify|verify} messages.
* @param message OutputProtection message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: License.KeyContainer.IOutputProtection,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes an OutputProtection message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns OutputProtection
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): License.KeyContainer.OutputProtection;
/**
* Decodes an OutputProtection message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns OutputProtection
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): License.KeyContainer.OutputProtection;
/**
* Creates an OutputProtection message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns OutputProtection
*/
public static fromObject(d: {
[k: string]: any;
}): License.KeyContainer.OutputProtection;
/**
* Creates a plain object from an OutputProtection message. Also converts values to other types if specified.
* @param m OutputProtection
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: License.KeyContainer.OutputProtection,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this OutputProtection to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for OutputProtection
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
namespace OutputProtection {
/** HDCP enum. */
enum HDCP {
HDCP_NONE = 0,
HDCP_V1 = 1,
HDCP_V2 = 2,
HDCP_V2_1 = 3,
HDCP_V2_2 = 4,
HDCP_V2_3 = 5,
HDCP_NO_DIGITAL_OUTPUT = 255,
}
/** CGMS enum. */
enum CGMS {
CGMS_NONE = 42,
COPY_FREE = 0,
COPY_ONCE = 2,
COPY_NEVER = 3,
}
/** HdcpSrmRule enum. */
enum HdcpSrmRule {
HDCP_SRM_RULE_NONE = 0,
CURRENT_SRM = 1,
}
}
/** Properties of a VideoResolutionConstraint. */
interface IVideoResolutionConstraint {
/** VideoResolutionConstraint minResolutionPixels */
minResolutionPixels?: number | null;
/** VideoResolutionConstraint maxResolutionPixels */
maxResolutionPixels?: number | null;
/** VideoResolutionConstraint requiredProtection */
requiredProtection?: License.KeyContainer.IOutputProtection | null;
}
/** Represents a VideoResolutionConstraint. */
class VideoResolutionConstraint implements IVideoResolutionConstraint {
/**
* Constructs a new VideoResolutionConstraint.
* @param [p] Properties to set
*/
constructor(p?: License.KeyContainer.IVideoResolutionConstraint);
/** VideoResolutionConstraint minResolutionPixels. */
public minResolutionPixels: number;
/** VideoResolutionConstraint maxResolutionPixels. */
public maxResolutionPixels: number;
/** VideoResolutionConstraint requiredProtection. */
public requiredProtection?: License.KeyContainer.IOutputProtection | null;
/**
* Creates a new VideoResolutionConstraint instance using the specified properties.
* @param [properties] Properties to set
* @returns VideoResolutionConstraint instance
*/
public static create(
properties?: License.KeyContainer.IVideoResolutionConstraint,
): License.KeyContainer.VideoResolutionConstraint;
/**
* Encodes the specified VideoResolutionConstraint message. Does not implicitly {@link License.KeyContainer.VideoResolutionConstraint.verify|verify} messages.
* @param m VideoResolutionConstraint message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: License.KeyContainer.IVideoResolutionConstraint,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified VideoResolutionConstraint message, length delimited. Does not implicitly {@link License.KeyContainer.VideoResolutionConstraint.verify|verify} messages.
* @param message VideoResolutionConstraint message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: License.KeyContainer.IVideoResolutionConstraint,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a VideoResolutionConstraint message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns VideoResolutionConstraint
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): License.KeyContainer.VideoResolutionConstraint;
/**
* Decodes a VideoResolutionConstraint message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns VideoResolutionConstraint
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): License.KeyContainer.VideoResolutionConstraint;
/**
* Creates a VideoResolutionConstraint message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns VideoResolutionConstraint
*/
public static fromObject(d: {
[k: string]: any;
}): License.KeyContainer.VideoResolutionConstraint;
/**
* Creates a plain object from a VideoResolutionConstraint message. Also converts values to other types if specified.
* @param m VideoResolutionConstraint
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: License.KeyContainer.VideoResolutionConstraint,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this VideoResolutionConstraint to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for VideoResolutionConstraint
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of an OperatorSessionKeyPermissions. */
interface IOperatorSessionKeyPermissions {
/** OperatorSessionKeyPermissions allowEncrypt */
allowEncrypt?: boolean | null;
/** OperatorSessionKeyPermissions allowDecrypt */
allowDecrypt?: boolean | null;
/** OperatorSessionKeyPermissions allowSign */
allowSign?: boolean | null;
/** OperatorSessionKeyPermissions allowSignatureVerify */
allowSignatureVerify?: boolean | null;
}
/** Represents an OperatorSessionKeyPermissions. */
class OperatorSessionKeyPermissions
implements IOperatorSessionKeyPermissions
{
/**
* Constructs a new OperatorSessionKeyPermissions.
* @param [p] Properties to set
*/
constructor(p?: License.KeyContainer.IOperatorSessionKeyPermissions);
/** OperatorSessionKeyPermissions allowEncrypt. */
public allowEncrypt: boolean;
/** OperatorSessionKeyPermissions allowDecrypt. */
public allowDecrypt: boolean;
/** OperatorSessionKeyPermissions allowSign. */
public allowSign: boolean;
/** OperatorSessionKeyPermissions allowSignatureVerify. */
public allowSignatureVerify: boolean;
/**
* Creates a new OperatorSessionKeyPermissions instance using the specified properties.
* @param [properties] Properties to set
* @returns OperatorSessionKeyPermissions instance
*/
public static create(
properties?: License.KeyContainer.IOperatorSessionKeyPermissions,
): License.KeyContainer.OperatorSessionKeyPermissions;
/**
* Encodes the specified OperatorSessionKeyPermissions message. Does not implicitly {@link License.KeyContainer.OperatorSessionKeyPermissions.verify|verify} messages.
* @param m OperatorSessionKeyPermissions message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: License.KeyContainer.IOperatorSessionKeyPermissions,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified OperatorSessionKeyPermissions message, length delimited. Does not implicitly {@link License.KeyContainer.OperatorSessionKeyPermissions.verify|verify} messages.
* @param message OperatorSessionKeyPermissions message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: License.KeyContainer.IOperatorSessionKeyPermissions,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes an OperatorSessionKeyPermissions message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns OperatorSessionKeyPermissions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): License.KeyContainer.OperatorSessionKeyPermissions;
/**
* Decodes an OperatorSessionKeyPermissions message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns OperatorSessionKeyPermissions
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): License.KeyContainer.OperatorSessionKeyPermissions;
/**
* Creates an OperatorSessionKeyPermissions message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns OperatorSessionKeyPermissions
*/
public static fromObject(d: {
[k: string]: any;
}): License.KeyContainer.OperatorSessionKeyPermissions;
/**
* Creates a plain object from an OperatorSessionKeyPermissions message. Also converts values to other types if specified.
* @param m OperatorSessionKeyPermissions
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: License.KeyContainer.OperatorSessionKeyPermissions,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this OperatorSessionKeyPermissions to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for OperatorSessionKeyPermissions
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
}
}
/** HashAlgorithmProto enum. */
declare enum HashAlgorithmProto {
HASH_ALGORITHM_UNSPECIFIED = 0,
HASH_ALGORITHM_SHA_1 = 1,
HASH_ALGORITHM_SHA_256 = 2,
HASH_ALGORITHM_SHA_384 = 3,
}
/** Represents a ClientIdentification. */
declare class ClientIdentification implements IClientIdentification {
/**
* Constructs a new ClientIdentification.
* @param [p] Properties to set
*/
constructor(p?: IClientIdentification);
/** ClientIdentification type. */
public type: ClientIdentification.TokenType;
/** ClientIdentification token. */
public token: Uint8Array;
/** ClientIdentification clientInfo. */
public clientInfo: ClientIdentification.INameValue[];
/** ClientIdentification providerClientToken. */
public providerClientToken: Uint8Array;
/** ClientIdentification licenseCounter. */
public licenseCounter: number;
/** ClientIdentification clientCapabilities. */
public clientCapabilities?: ClientIdentification.IClientCapabilities | null;
/** ClientIdentification vmpData. */
public vmpData: Uint8Array;
/** ClientIdentification deviceCredentials. */
public deviceCredentials: ClientIdentification.IClientCredentials[];
/**
* Creates a new ClientIdentification instance using the specified properties.
* @param [properties] Properties to set
* @returns ClientIdentification instance
*/
public static create(
properties?: IClientIdentification,
): ClientIdentification;
/**
* Encodes the specified ClientIdentification message. Does not implicitly {@link ClientIdentification.verify|verify} messages.
* @param m ClientIdentification message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: IClientIdentification,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified ClientIdentification message, length delimited. Does not implicitly {@link ClientIdentification.verify|verify} messages.
* @param message ClientIdentification message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: IClientIdentification,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a ClientIdentification message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns ClientIdentification
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): ClientIdentification;
/**
* Decodes a ClientIdentification message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns ClientIdentification
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): ClientIdentification;
/**
* Creates a ClientIdentification message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns ClientIdentification
*/
public static fromObject(d: { [k: string]: any }): ClientIdentification;
/**
* Creates a plain object from a ClientIdentification message. Also converts values to other types if specified.
* @param m ClientIdentification
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: ClientIdentification,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this ClientIdentification to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for ClientIdentification
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
declare namespace ClientIdentification {
/** TokenType enum. */
enum TokenType {
KEYBOX = 0,
DRM_DEVICE_CERTIFICATE = 1,
REMOTE_ATTESTATION_CERTIFICATE = 2,
OEM_DEVICE_CERTIFICATE = 3,
}
/** Properties of a NameValue. */
interface INameValue {
/** NameValue name */
name?: string | null;
/** NameValue value */
value?: string | null;
}
/** Represents a NameValue. */
class NameValue implements INameValue {
/**
* Constructs a new NameValue.
* @param [p] Properties to set
*/
constructor(p?: ClientIdentification.INameValue);
/** NameValue name. */
public name: string;
/** NameValue value. */
public value: string;
/**
* Creates a new NameValue instance using the specified properties.
* @param [properties] Properties to set
* @returns NameValue instance
*/
public static create(
properties?: ClientIdentification.INameValue,
): ClientIdentification.NameValue;
/**
* Encodes the specified NameValue message. Does not implicitly {@link ClientIdentification.NameValue.verify|verify} messages.
* @param m NameValue message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: ClientIdentification.INameValue,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified NameValue message, length delimited. Does not implicitly {@link ClientIdentification.NameValue.verify|verify} messages.
* @param message NameValue message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: ClientIdentification.INameValue,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a NameValue message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns NameValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): ClientIdentification.NameValue;
/**
* Decodes a NameValue message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns NameValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): ClientIdentification.NameValue;
/**
* Creates a NameValue message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns NameValue
*/
public static fromObject(d: {
[k: string]: any;
}): ClientIdentification.NameValue;
/**
* Creates a plain object from a NameValue message. Also converts values to other types if specified.
* @param m NameValue
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: ClientIdentification.NameValue,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this NameValue to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for NameValue
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a ClientCapabilities. */
interface IClientCapabilities {
/** ClientCapabilities clientToken */
clientToken?: boolean | null;
/** ClientCapabilities sessionToken */
sessionToken?: boolean | null;
/** ClientCapabilities videoResolutionConstraints */
videoResolutionConstraints?: boolean | null;
/** ClientCapabilities maxHdcpVersion */
maxHdcpVersion?: ClientIdentification.ClientCapabilities.HdcpVersion | null;
/** ClientCapabilities oemCryptoApiVersion */
oemCryptoApiVersion?: number | null;
/** ClientCapabilities antiRollbackUsageTable */
antiRollbackUsageTable?: boolean | null;
/** ClientCapabilities srmVersion */
srmVersion?: number | null;
/** ClientCapabilities canUpdateSrm */
canUpdateSrm?: boolean | null;
/** ClientCapabilities supportedCertificateKeyType */
supportedCertificateKeyType?:
| ClientIdentification.ClientCapabilities.CertificateKeyType[]
| null;
/** ClientCapabilities analogOutputCapabilities */
analogOutputCapabilities?: ClientIdentification.ClientCapabilities.AnalogOutputCapabilities | null;
/** ClientCapabilities canDisableAnalogOutput */
canDisableAnalogOutput?: boolean | null;
/** ClientCapabilities resourceRatingTier */
resourceRatingTier?: number | null;
}
/** Represents a ClientCapabilities. */
class ClientCapabilities implements IClientCapabilities {
/**
* Constructs a new ClientCapabilities.
* @param [p] Properties to set
*/
constructor(p?: ClientIdentification.IClientCapabilities);
/** ClientCapabilities clientToken. */
public clientToken: boolean;
/** ClientCapabilities sessionToken. */
public sessionToken: boolean;
/** ClientCapabilities videoResolutionConstraints. */
public videoResolutionConstraints: boolean;
/** ClientCapabilities maxHdcpVersion. */
public maxHdcpVersion: ClientIdentification.ClientCapabilities.HdcpVersion;
/** ClientCapabilities oemCryptoApiVersion. */
public oemCryptoApiVersion: number;
/** ClientCapabilities antiRollbackUsageTable. */
public antiRollbackUsageTable: boolean;
/** ClientCapabilities srmVersion. */
public srmVersion: number;
/** ClientCapabilities canUpdateSrm. */
public canUpdateSrm: boolean;
/** ClientCapabilities supportedCertificateKeyType. */
public supportedCertificateKeyType: ClientIdentification.ClientCapabilities.CertificateKeyType[];
/** ClientCapabilities analogOutputCapabilities. */
public analogOutputCapabilities: ClientIdentification.ClientCapabilities.AnalogOutputCapabilities;
/** ClientCapabilities canDisableAnalogOutput. */
public canDisableAnalogOutput: boolean;
/** ClientCapabilities resourceRatingTier. */
public resourceRatingTier: number;
/**
* Creates a new ClientCapabilities instance using the specified properties.
* @param [properties] Properties to set
* @returns ClientCapabilities instance
*/
public static create(
properties?: ClientIdentification.IClientCapabilities,
): ClientIdentification.ClientCapabilities;
/**
* Encodes the specified ClientCapabilities message. Does not implicitly {@link ClientIdentification.ClientCapabilities.verify|verify} messages.
* @param m ClientCapabilities message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: ClientIdentification.IClientCapabilities,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified ClientCapabilities message, length delimited. Does not implicitly {@link ClientIdentification.ClientCapabilities.verify|verify} messages.
* @param message ClientCapabilities message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: ClientIdentification.IClientCapabilities,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a ClientCapabilities message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns ClientCapabilities
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): ClientIdentification.ClientCapabilities;
/**
* Decodes a ClientCapabilities message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns ClientCapabilities
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): ClientIdentification.ClientCapabilities;
/**
* Creates a ClientCapabilities message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns ClientCapabilities
*/
public static fromObject(d: {
[k: string]: any;
}): ClientIdentification.ClientCapabilities;
/**
* Creates a plain object from a ClientCapabilities message. Also converts values to other types if specified.
* @param m ClientCapabilities
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: ClientIdentification.ClientCapabilities,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this ClientCapabilities to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for ClientCapabilities
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
namespace ClientCapabilities {
/** HdcpVersion enum. */
enum HdcpVersion {
HDCP_NONE = 0,
HDCP_V1 = 1,
HDCP_V2 = 2,
HDCP_V2_1 = 3,
HDCP_V2_2 = 4,
HDCP_V2_3 = 5,
HDCP_NO_DIGITAL_OUTPUT = 255,
}
/** CertificateKeyType enum. */
enum CertificateKeyType {
RSA_2048 = 0,
RSA_3072 = 1,
ECC_SECP256R1 = 2,
ECC_SECP384R1 = 3,
ECC_SECP521R1 = 4,
}
/** AnalogOutputCapabilities enum. */
enum AnalogOutputCapabilities {
ANALOG_OUTPUT_UNKNOWN = 0,
ANALOG_OUTPUT_NONE = 1,
ANALOG_OUTPUT_SUPPORTED = 2,
ANALOG_OUTPUT_SUPPORTS_CGMS_A = 3,
}
}
/** Properties of a ClientCredentials. */
interface IClientCredentials {
/** ClientCredentials type */
type?: ClientIdentification.TokenType | null;
/** ClientCredentials token */
token?: Uint8Array | null;
}
/** Represents a ClientCredentials. */
class ClientCredentials implements IClientCredentials {
/**
* Constructs a new ClientCredentials.
* @param [p] Properties to set
*/
constructor(p?: ClientIdentification.IClientCredentials);
/** ClientCredentials type. */
public type: ClientIdentification.TokenType;
/** ClientCredentials token. */
public token: Uint8Array;
/**
* Creates a new ClientCredentials instance using the specified properties.
* @param [properties] Properties to set
* @returns ClientCredentials instance
*/
public static create(
properties?: ClientIdentification.IClientCredentials,
): ClientIdentification.ClientCredentials;
/**
* Encodes the specified ClientCredentials message. Does not implicitly {@link ClientIdentification.ClientCredentials.verify|verify} messages.
* @param m ClientCredentials message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: ClientIdentification.IClientCredentials,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified ClientCredentials message, length delimited. Does not implicitly {@link ClientIdentification.ClientCredentials.verify|verify} messages.
* @param message ClientCredentials message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: ClientIdentification.IClientCredentials,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a ClientCredentials message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns ClientCredentials
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): ClientIdentification.ClientCredentials;
/**
* Decodes a ClientCredentials message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns ClientCredentials
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): ClientIdentification.ClientCredentials;
/**
* Creates a ClientCredentials message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns ClientCredentials
*/
public static fromObject(d: {
[k: string]: any;
}): ClientIdentification.ClientCredentials;
/**
* Creates a plain object from a ClientCredentials message. Also converts values to other types if specified.
* @param m ClientCredentials
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: ClientIdentification.ClientCredentials,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this ClientCredentials to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for ClientCredentials
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
}
/** Represents an EncryptedClientIdentification. */
declare class EncryptedClientIdentification
implements IEncryptedClientIdentification
{
/**
* Constructs a new EncryptedClientIdentification.
* @param [p] Properties to set
*/
constructor(p?: IEncryptedClientIdentification);
/** EncryptedClientIdentification providerId. */
public providerId: string;
/** EncryptedClientIdentification serviceCertificateSerialNumber. */
public serviceCertificateSerialNumber: Uint8Array;
/** EncryptedClientIdentification encryptedClientId. */
public encryptedClientId: Uint8Array;
/** EncryptedClientIdentification encryptedClientIdIv. */
public encryptedClientIdIv: Uint8Array;
/** EncryptedClientIdentification encryptedPrivacyKey. */
public encryptedPrivacyKey: Uint8Array;
/**
* Creates a new EncryptedClientIdentification instance using the specified properties.
* @param [properties] Properties to set
* @returns EncryptedClientIdentification instance
*/
public static create(
properties?: IEncryptedClientIdentification,
): EncryptedClientIdentification;
/**
* Encodes the specified EncryptedClientIdentification message. Does not implicitly {@link EncryptedClientIdentification.verify|verify} messages.
* @param m EncryptedClientIdentification message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: IEncryptedClientIdentification,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified EncryptedClientIdentification message, length delimited. Does not implicitly {@link EncryptedClientIdentification.verify|verify} messages.
* @param message EncryptedClientIdentification message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: IEncryptedClientIdentification,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes an EncryptedClientIdentification message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns EncryptedClientIdentification
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): EncryptedClientIdentification;
/**
* Decodes an EncryptedClientIdentification message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns EncryptedClientIdentification
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): EncryptedClientIdentification;
/**
* Creates an EncryptedClientIdentification message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns EncryptedClientIdentification
*/
public static fromObject(d: {
[k: string]: any;
}): EncryptedClientIdentification;
/**
* Creates a plain object from an EncryptedClientIdentification message. Also converts values to other types if specified.
* @param m EncryptedClientIdentification
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: EncryptedClientIdentification,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this EncryptedClientIdentification to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for EncryptedClientIdentification
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Represents a DrmCertificate. */
declare class DrmCertificate implements IDrmCertificate {
/**
* Constructs a new DrmCertificate.
* @param [p] Properties to set
*/
constructor(p?: IDrmCertificate);
/** DrmCertificate type. */
public type: DrmCertificate.Type;
/** DrmCertificate serialNumber. */
public serialNumber: Uint8Array;
/** DrmCertificate creationTimeSeconds. */
public creationTimeSeconds: number;
/** DrmCertificate expirationTimeSeconds. */
public expirationTimeSeconds: number;
/** DrmCertificate publicKey. */
public publicKey: Uint8Array;
/** DrmCertificate systemId. */
public systemId: number;
/** DrmCertificate testDeviceDeprecated. */
public testDeviceDeprecated: boolean;
/** DrmCertificate providerId. */
public providerId: string;
/** DrmCertificate serviceTypes. */
public serviceTypes: DrmCertificate.ServiceType[];
/** DrmCertificate algorithm. */
public algorithm: DrmCertificate.Algorithm;
/** DrmCertificate rotId. */
public rotId: Uint8Array;
/** DrmCertificate encryptionKey. */
public encryptionKey?: DrmCertificate.IEncryptionKey | null;
/**
* Creates a new DrmCertificate instance using the specified properties.
* @param [properties] Properties to set
* @returns DrmCertificate instance
*/
public static create(properties?: IDrmCertificate): DrmCertificate;
/**
* Encodes the specified DrmCertificate message. Does not implicitly {@link DrmCertificate.verify|verify} messages.
* @param m DrmCertificate message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: IDrmCertificate,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified DrmCertificate message, length delimited. Does not implicitly {@link DrmCertificate.verify|verify} messages.
* @param message DrmCertificate message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: IDrmCertificate,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a DrmCertificate message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns DrmCertificate
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): DrmCertificate;
/**
* Decodes a DrmCertificate message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns DrmCertificate
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): DrmCertificate;
/**
* Creates a DrmCertificate message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns DrmCertificate
*/
public static fromObject(d: { [k: string]: any }): DrmCertificate;
/**
* Creates a plain object from a DrmCertificate message. Also converts values to other types if specified.
* @param m DrmCertificate
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: DrmCertificate,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this DrmCertificate to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for DrmCertificate
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
declare namespace DrmCertificate {
/** Type enum. */
enum Type {
ROOT = 0,
DEVICE_MODEL = 1,
DEVICE = 2,
SERVICE = 3,
PROVISIONER = 4,
}
/** ServiceType enum. */
enum ServiceType {
UNKNOWN_SERVICE_TYPE = 0,
LICENSE_SERVER_SDK = 1,
LICENSE_SERVER_PROXY_SDK = 2,
PROVISIONING_SDK = 3,
CAS_PROXY_SDK = 4,
}
/** Algorithm enum. */
enum Algorithm {
UNKNOWN_ALGORITHM = 0,
RSA = 1,
ECC_SECP256R1 = 2,
ECC_SECP384R1 = 3,
ECC_SECP521R1 = 4,
}
/** Properties of an EncryptionKey. */
interface IEncryptionKey {
/** EncryptionKey publicKey */
publicKey?: Uint8Array | null;
/** EncryptionKey algorithm */
algorithm?: DrmCertificate.Algorithm | null;
}
/** Represents an EncryptionKey. */
class EncryptionKey implements IEncryptionKey {
/**
* Constructs a new EncryptionKey.
* @param [p] Properties to set
*/
constructor(p?: DrmCertificate.IEncryptionKey);
/** EncryptionKey publicKey. */
public publicKey: Uint8Array;
/** EncryptionKey algorithm. */
public algorithm: DrmCertificate.Algorithm;
/**
* Creates a new EncryptionKey instance using the specified properties.
* @param [properties] Properties to set
* @returns EncryptionKey instance
*/
public static create(
properties?: DrmCertificate.IEncryptionKey,
): DrmCertificate.EncryptionKey;
/**
* Encodes the specified EncryptionKey message. Does not implicitly {@link DrmCertificate.EncryptionKey.verify|verify} messages.
* @param m EncryptionKey message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: DrmCertificate.IEncryptionKey,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified EncryptionKey message, length delimited. Does not implicitly {@link DrmCertificate.EncryptionKey.verify|verify} messages.
* @param message EncryptionKey message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: DrmCertificate.IEncryptionKey,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes an EncryptionKey message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns EncryptionKey
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): DrmCertificate.EncryptionKey;
/**
* Decodes an EncryptionKey message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns EncryptionKey
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): DrmCertificate.EncryptionKey;
/**
* Creates an EncryptionKey message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns EncryptionKey
*/
public static fromObject(d: {
[k: string]: any;
}): DrmCertificate.EncryptionKey;
/**
* Creates a plain object from an EncryptionKey message. Also converts values to other types if specified.
* @param m EncryptionKey
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: DrmCertificate.EncryptionKey,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this EncryptionKey to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for EncryptionKey
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
}
/** Represents a SignedDrmCertificate. */
declare class SignedDrmCertificate implements ISignedDrmCertificate {
/**
* Constructs a new SignedDrmCertificate.
* @param [p] Properties to set
*/
constructor(p?: ISignedDrmCertificate);
/** SignedDrmCertificate drmCertificate. */
public drmCertificate: Uint8Array;
/** SignedDrmCertificate signature. */
public signature: Uint8Array;
/** SignedDrmCertificate signer. */
public signer?: ISignedDrmCertificate | null;
/** SignedDrmCertificate hashAlgorithm. */
public hashAlgorithm: HashAlgorithmProto;
/**
* Creates a new SignedDrmCertificate instance using the specified properties.
* @param [properties] Properties to set
* @returns SignedDrmCertificate instance
*/
public static create(
properties?: ISignedDrmCertificate,
): SignedDrmCertificate;
/**
* Encodes the specified SignedDrmCertificate message. Does not implicitly {@link SignedDrmCertificate.verify|verify} messages.
* @param m SignedDrmCertificate message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: ISignedDrmCertificate,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified SignedDrmCertificate message, length delimited. Does not implicitly {@link SignedDrmCertificate.verify|verify} messages.
* @param message SignedDrmCertificate message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: ISignedDrmCertificate,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a SignedDrmCertificate message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns SignedDrmCertificate
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): SignedDrmCertificate;
/**
* Decodes a SignedDrmCertificate message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns SignedDrmCertificate
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): SignedDrmCertificate;
/**
* Creates a SignedDrmCertificate message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns SignedDrmCertificate
*/
public static fromObject(d: { [k: string]: any }): SignedDrmCertificate;
/**
* Creates a plain object from a SignedDrmCertificate message. Also converts values to other types if specified.
* @param m SignedDrmCertificate
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: SignedDrmCertificate,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this SignedDrmCertificate to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for SignedDrmCertificate
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Represents a FileHashes. */
declare class FileHashes implements IFileHashes {
/**
* Constructs a new FileHashes.
* @param [p] Properties to set
*/
constructor(p?: IFileHashes);
/** FileHashes signer. */
public signer: Uint8Array;
/** FileHashes signatures. */
public signatures: FileHashes.ISignature[];
/**
* Creates a new FileHashes instance using the specified properties.
* @param [properties] Properties to set
* @returns FileHashes instance
*/
public static create(properties?: IFileHashes): FileHashes;
/**
* Encodes the specified FileHashes message. Does not implicitly {@link FileHashes.verify|verify} messages.
* @param m FileHashes message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(m: IFileHashes, w?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified FileHashes message, length delimited. Does not implicitly {@link FileHashes.verify|verify} messages.
* @param message FileHashes message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: IFileHashes,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a FileHashes message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns FileHashes
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): FileHashes;
/**
* Decodes a FileHashes message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns FileHashes
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): FileHashes;
/**
* Creates a FileHashes message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns FileHashes
*/
public static fromObject(d: { [k: string]: any }): FileHashes;
/**
* Creates a plain object from a FileHashes message. Also converts values to other types if specified.
* @param m FileHashes
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: FileHashes,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this FileHashes to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for FileHashes
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
declare namespace FileHashes {
/** Properties of a Signature. */
interface ISignature {
/** Signature filename */
filename?: string | null;
/** Signature testSigning */
testSigning?: boolean | null;
/** Signature SHA512Hash */
SHA512Hash?: Uint8Array | null;
/** Signature mainExe */
mainExe?: boolean | null;
/** Signature signature */
signature?: Uint8Array | null;
}
/** Represents a Signature. */
class Signature implements ISignature {
/**
* Constructs a new Signature.
* @param [p] Properties to set
*/
constructor(p?: FileHashes.ISignature);
/** Signature filename. */
public filename: string;
/** Signature testSigning. */
public testSigning: boolean;
/** Signature SHA512Hash. */
public SHA512Hash: Uint8Array;
/** Signature mainExe. */
public mainExe: boolean;
/** Signature signature. */
public signature: Uint8Array;
/**
* Creates a new Signature instance using the specified properties.
* @param [properties] Properties to set
* @returns Signature instance
*/
public static create(
properties?: FileHashes.ISignature,
): FileHashes.Signature;
/**
* Encodes the specified Signature message. Does not implicitly {@link FileHashes.Signature.verify|verify} messages.
* @param m Signature message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: FileHashes.ISignature,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Encodes the specified Signature message, length delimited. Does not implicitly {@link FileHashes.Signature.verify|verify} messages.
* @param message Signature message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(
message: FileHashes.ISignature,
writer?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a Signature message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns Signature
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): FileHashes.Signature;
/**
* Decodes a Signature message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Signature
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(
reader: $protobuf.Reader | Uint8Array,
): FileHashes.Signature;
/**
* Creates a Signature message from a plain object. Also converts values to their respective internal types.
* @param d Plain object
* @returns Signature
*/
public static fromObject(d: { [k: string]: any }): FileHashes.Signature;
/**
* Creates a plain object from a Signature message. Also converts values to other types if specified.
* @param m Signature
* @param [o] Conversion options
* @returns Plain object
*/
public static toObject(
m: FileHashes.Signature,
o?: $protobuf.IConversionOptions,
): { [k: string]: any };
/**
* Converts this Signature to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for Signature
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
}
declare class Key$1 {
id: string;
value: string;
type: string;
level?: string;
trackLabel?: string;
permissions: string[];
constructor(id: string, value: string, type?: string, level?: string, trackLabel?: string, permissions?: string[]);
toString(): string;
static fromContainer(container: License.IKeyContainer, encKey: Uint8Array): Promise<Key$1>;
}
declare const SESSION_TYPES: {
readonly temporary: 0;
readonly 'persistent-license': 1;
};
type SessionType = keyof typeof SESSION_TYPES;
/**
* https://www.w3.org/TR/encrypted-media-2/#mediakeysession-interface
*/
declare class Session$1 extends EventTarget {
#private;
readonly sessionId: string;
readonly keyStatuses: MediaKeyStatusMap;
readonly keys: Map<string, Key$1>;
readonly expiration: number;
readonly closed: Promise<MediaKeySessionClosedReason>;
onmessage: ((this: MediaKeySession, ev: MediaKeyMessageEvent) => any) | null;
onkeyschange: ((this: MediaKeySession, ev: Event) => any) | null;
onkeystatuseschange: ((this: MediaKeySession, ev: Event) => any) | null;
sessionType: SessionType;
privacyMode?: boolean;
constructor(sessionType: SessionType | undefined, client: WidevineClient);
setLogger(logger: Logger): void;
generateRequest(initDataType: string, initData: BufferSource): Promise<Uint8Array<ArrayBufferLike> | undefined>;
waitForLicenseRequest(): Promise<Uint8Array<ArrayBufferLike>>;
load(): Promise<boolean>;
update(response: Uint8Array): Promise<void>;
getKeys(): Promise<Key$1[]>;
close(): Promise<void>;
remove(): Promise<void>;
}
declare const CLIENT_TYPE: {
readonly android: "android";
readonly chrome: "chrome";
};
type ClientType = (typeof CLIENT_TYPE)[keyof typeof CLIENT_TYPE];
type SecurityLevel = 1 | 2 | 3;
declare class WidevineClient {
#private;
id: ClientIdentification;
type: ClientType;
securityLevel: SecurityLevel;
signedDrmCertificate: SignedDrmCertificate;
drmCertificate: DrmCertificate;
systemId: number;
vmp: FileHashes | null;
info: Map<string, string>;
static from(payload: {
wvd: Uint8Array;
} | {
id: Uint8Array;
key: Uint8Array;
}): Promise<WidevineClient>;
static fromPacked(data: Uint8Array, format?: 'wvd'): Promise<WidevineClient>;
static fromUnpacked(id: Uint8Array, key: Uint8Array, vmp?: Uint8Array): Promise<WidevineClient>;
get key(): {
forDecrypt: CryptoKey;
forSign: CryptoKey;
};
constructor(id: Uint8Array | ClientIdentification, type?: ClientType, securityLevel?: SecurityLevel);
getName(): string;
get filename(): string;
get label(): string;
unpack(): Promise<{
device_client_id_blob: Uint8Array<ArrayBufferLike>;
device_private_key: Uint8Array<ArrayBufferLike>;
}>;
pack(format?: 'wvd'): Promise<Uint8Array<ArrayBuffer>>;
importKey(pkcs1: Uint8Array | string): Promise<{
forDecrypt: CryptoKey;
forSign: CryptoKey;
}>;
exportKey(): Promise<Uint8Array<ArrayBufferLike>>;
decryptWithKey(data: Uint8Array): Promise<Uint8Array<ArrayBuffer>>;
signWithKey(data: Uint8Array): Promise<Uint8Array<ArrayBuffer>>;
encryptId(certificate: SignedDrmCertificate): Promise<EncryptedClientIdentification>;
toString(): string;
/**
* https://www.w3.org/TR/encrypted-media-2/#navigator-extension-requestmediakeysystemaccess
*/
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): {
keySystem: string;
createMediaKeys: () => Promise<{
createSession: (sessionType?: SessionType) => MediaKeySession;
setServerCertificate: (serverCertificate: BufferSource) => Promise<boolean>;
getStatusForPolicy: () => Promise<MediaKeyStatus>;
}>;
getConfiguration: () => MediaKeySystemConfiguration;
};
}
declare class WidevineCdm implements Cdm {
keySystem: string;
sessions: Map<string, Session$1>;
client: WidevineClient;
static Client: typeof WidevineClient;
constructor({ client }: {
client: WidevineClient;
});
createSession(sessionType?: MediaKeySessionType): string;
generateRequest(sessionId: string, initData: Uint8Array, initDataType?: string): Promise<Uint8Array<ArrayBufferLike>>;
updateSession(sessionId: string, response: Uint8Array): Promise<void>;
closeSession(sessionId: string): Promise<void>;
removeSession(sessionId: string): Promise<void>;
getKeys(sessionId: string): Promise<{
key: string;
keyId: string;
}[]>;
}
declare class EccKey {
privateKey: bigint;
publicKey: AffinePoint<bigint>;
constructor(privateKey: bigint, publicKey: AffinePoint<bigint>);
static randomScalar(): bigint;
static generate(): EccKey;
static construct(privateKey: bigint): EccKey;
static from(data: Uint8Array): EccKey;
dumps(privateOnly?: boolean): Uint8Array<ArrayBuffer>;
privateBytes(): Uint8Array<ArrayBufferLike>;
publicBytes(): Uint8Array<ArrayBuffer>;
privateSha256Digest(): Promise<Uint8Array<ArrayBuffer>>;
publicSha256Digest(): Promise<Uint8Array<ArrayBuffer>>;
}
declare const BCertObjType: {
readonly BASIC: 1;
readonly DOMAIN: 2;
readonly PC: 3;
readonly DEVICE: 4;
readonly FEATURE: 5;
readonly KEY: 6;
readonly MANUFACTURER: 7;
readonly SIGNATURE: 8;
readonly SILVERLIGHT: 9;
readonly METERING: 10;
readonly EXTDATASIGNKEY: 11;
readonly EXTDATACONTAINER: 12;
readonly EXTDATASIGNATURE: 13;
readonly EXTDATA_HWID: 14;
readonly SERVER: 15;
readonly SECURITY_VERSION: 16;
readonly SECURITY_VERSION_2: 17;
readonly UNKNOWN_OBJECT_ID: 65533;
};
type TBCertObjType = (typeof BCertObjType)[keyof typeof BCertObjType];
declare const BCert: {
parse(data: Uint8Array, debug?: boolean): {
signature: Uint8Array<ArrayBufferLike>;
version: number;
total_length: number;
certificate_length: number;
attributes: {
flags: /*elided*/ any;
tag: /*elided*/ any;
length: /*elided*/ any;
attribute: /*elided*/ any;
}[];
};
build(obj: {
signature: Uint8Array<ArrayBufferLike>;
version: number;
total_length: number;
certificate_length: number;
attributes: {
flags: /*elided*/ any;
tag: /*elided*/ any;
length: /*elided*/ any;
attribute: /*elided*/ any;
}[];
}, debug?: boolean): Uint8Array;
} & barsic.PrivateSchema<{
signature: Uint8Array<ArrayBufferLike>;
version: number;
total_length: number;
certificate_length: number;
attributes: {
flags: /*elided*/ any;
tag: /*elided*/ any;
length: /*elided*/ any;
attribute: /*elided*/ any;
}[];
}>;
type BCertType = b.infer<typeof BCert>;
declare const BCertChain: {
parse(data: Uint8Array, debug?: boolean): {
signature: Uint8Array<ArrayBufferLike>;
version: number;
total_length: number;
flags: number;
certificate_count: number;
certificates: {
signature: /*elided*/ any;
version: /*elided*/ any;
total_length: /*elided*/ any;
certificate_length: /*elided*/ any;
attributes: /*elided*/ any;
}[];
};
build(obj: {
signature: Uint8Array<ArrayBufferLike>;
version: number;
total_length: number;
flags: number;
certificate_count: number;
certificates: {
signature: /*elided*/ any;
version: /*elided*/ any;
total_length: /*elided*/ any;
certificate_length: /*elided*/ any;
attributes: /*elided*/ any;
}[];
}, debug?: boolean): Uint8Array;
} & barsic.PrivateSchema<{
signature: Uint8Array<ArrayBufferLike>;
version: number;
total_length: number;
flags: number;
certificate_count: number;
certificates: {
signature: /*elided*/ any;
version: /*elided*/ any;
total_length: /*elided*/ any;
certificate_length: /*elided*/ any;
attributes: /*elided*/ any;
}[];
}>;
type BCertChainType = b.infer<typeof BCertChain>;
declare class Certificate {
parsed: BCertType;
_BCERT: typeof BCert;
constructor(parsedBCert: BCertType, bcertObj?: typeof BCert);
static newLeafCert(params: {
certId: Uint8Array;
securityLevel: number;
clientId: Uint8Array;
signingKey: EccKey;
encryptionKey: EccKey;
groupKey: EccKey;
parent: CertificateChain;
expiry?: number;
}): Promise<Certificate>;
static loads(data: Uint8Array): Certificate;
getAttribute(type: TBCertObjType): {
flags: number;
tag: number;
length: number;
attribute: Uint8Array<ArrayBufferLike> | {
cert_id: /*elided*/ any;
security_level: /*elided*/ any;
flags: /*elided*/ any;
cert_type: /*elided*/ any;
public_key_digest: /*elided*/ any;
expiration_date: /*elided*/ any;
client_id: /*elided*/ any;
} | {
service_id: /*elided*/ any;
account_id: /*elided*/ any;
revision_timestamp: /*elided*/ any;
domain_url_length: /*elided*/ any;
domain_url: /*elided*/ any;
} | {
security_version: /*elided*/ any;
} | {
max_license: /*elided*/ any;
max_header: /*elided*/ any;
max_chain_depth: /*elided*/ any;
} | {
feature_count: /*elided*/ any;
features: /*elided*/ any;
} | {
key_count: /*elided*/ any;
cert_keys: /*elided*/ any;
} | {
flags: /*elided*/ any;
manufacturer_name_length: /*elided*/ any;
manufacturer_name: /*elided*/ any;
model_name_length: /*elided*/ any;
model_name: /*elided*/ any;
model_number_length: /*elided*/ any;
model_number: /*elided*/ any;
} | {
metering_id: /*elided*/ any;
metering_url_length: /*elided*/ any;
metering_url: /*elided*/ any;
} | {
key_type: /*elided*/ any;
key_length: /*elided*/ any;
flags: /*elided*/ any;
key: /*elided*/ any;
} | {
signature_type: /*elided*/ any;
signature_size: /*elided*/ any;
signature: /*elided*/ any;
} | {
record_count: /*elided*/ any;
records: /*elided*/ any;
signature: /*elided*/ any;
} | {
warning_days: /*elided*/ any;
};
} | undefined;
getSecurityLevel(): number | undefined;
private static _unpad;
getName(): string | undefined;
getIssuerKey(): Uint8Array | undefined;
dumps: () => Uint8Array;
verify(publicKey: Uint8Array, index: number): Promise<Uint8Array | undefined>;
}
declare class CertificateChain {
ECC256MSBCertRootIssuerPubKey: Uint8Array<ArrayBufferLike>;
parsed: BCertChainType;
_BCERT_CHAIN: typeof BCertChain;
constructor(parsedBCertChain: BCertChainType, bcertChainObj?: typeof BCertChain);
static from(data: Uint8Array): CertificateChain;
dumps(): Uint8Array<ArrayBufferLike>;
getSecurityLevel(): number;
getName(): string;
verify(): Promise<boolean>;
append(bcert: Certificate): void;
prepend(bcert: Certificate): void;
remove(index: number): void;
get(index: number): Certificate;
count(): number;
}
declare class PlayReadyClient {
groupKey?: EccKey;
encryptionKey: EccKey;
signingKey: EccKey;
groupCertificate: CertificateChain;
securityLevel: number;
constructor(data: {
groupKey?: Uint8Array;
encryptionKey: Uint8Array;
signingKey: Uint8Array;
groupCertificate: Uint8Array;
});
static from(payload: {
prd: Uint8Array;
} | {
groupKey: Uint8Array;
encryptionKey?: Uint8Array;
signingKey?: Uint8Array;
groupCertificate: Uint8Array;
}): Promise<PlayReadyClient>;
getName(): string;
get filename(): string;
get label(): string;
pack(): Uint8Array<ArrayBufferLike>;
unpack(): {
'zgpriv.dat': Uint8Array<ArrayBuffer>;
'bgroupcert.dat': Uint8Array<ArrayBufferLike>;
};
}
declare class Key {
keyId: Uint8Array;
keyType: number;
cipherType: number;
key: Uint8Array;
constructor(keyId: Uint8Array, keyType: number, cipherType: number, key: Uint8Array);
_swapEndianess(uuidBytes: Uint8Array): Uint8Array<ArrayBuffer>;
}
declare class Session {
#private;
sessionId: string;
type: MediaKeySessionType;
certificateChain: Uint8Array;
encryptionKey: EccKey;
signingKey: EccKey;
clientVersion: string;
rgbMagicConstantZero: Uint8Array;
parser: DOMParser;
keys: Key[];
static Client: typeof PlayReadyClient;
constructor(sessionType: MediaKeySessionType | undefined, client: PlayReadyClient | {
certificateChain: Uint8Array;
encryptionKey: Uint8Array;
signingKey: Uint8Array;
clientVersion?: string;
});
generateRequest(sessionId: string, initData: Uint8Array, initDataType?: string): Promise<Uint8Array<ArrayBufferLike>>;
update(response: Uint8Array): Promise<void>;
getLicenseChallenge(wrm_header: string, rev_lists?: string): Promise<string>;
parseLicense(rawLicense: string): Promise<Key[] | undefined>;
}
declare class PlayReadyCdm implements Cdm {
keySystem: string;
sessions: Map<string, Session>;
client: PlayReadyClient;
static Client: typeof PlayReadyClient;
constructor(options: {
client: PlayReadyClient;
});
createSession(sessionType?: MediaKeySessionType): string;
generateRequest(sessionId: string, initData: Uint8Array, initDataType?: string): Promise<Uint8Array<ArrayBufferLike>>;
updateSession(sessionId: string, response: Uint8Array): Promise<void>;
closeSession(sessionId: string): Promise<void>;
getKeys(sessionId: string): Promise<{
key: string;
keyId: string;
}[]>;
}
type RemoteParams = {
keySystem: string;
baseUrl: string;
secret?: string;
client?: string;
headers?: Record<string, string>;
};
declare class RemoteCdm implements Cdm {
#private;
keySystem: string;
constructor(params: RemoteParams);
createSession(sessionType?: MediaKeySessionType): Promise<any>;
generateRequest(sessionId: string, initData: Uint8Array, initDataType?: string): Promise<Uint8Array<ArrayBuffer>>;
updateSession(sessionId: string, response: Uint8Array): Promise<void>;
closeSession(sessionId: string): Promise<void>;
removeSession(sessionId: string): Promise<void>;
getKeys(sessionId: string): Promise<any>;
}
interface FetchDecryptionKeysParams {
cdm: Cdm;
pssh: string;
server: string;
individualizationServer?: string;
headers?: Record<string, string>;
fetch?: typeof fetch;
transformRequest?: (request: Request) => Promise<Request>;
transformResponse?: (response: Response) => Promise<Response>;
logger?: Logger;
}
declare const fetchDecryptionKeys: (params: FetchDecryptionKeysParams) => Promise<Key$2[]>;
export { BinaryReader, CLIENT_TYPE, type Cdm, type ClientType, type Key$2 as Key, type Logger, MessageEvent, PlayReadyCdm, PlayReadyClient, RemoteCdm, SecurityLevel, Session$2 as Session, WidevineCdm, WidevineClient, base64ToBytes, bytesToBase64, bytesToString, compareArrays, fetchDecryptionKeys, fromBase64, fromBinary, fromBuffer, fromHex, fromText, getRandomBytes, parseBufferSource, requestMediaKeySystemAccess, stringToBytes, xorArrays };