MediaDrm.GetKeyRequest Method

Definition

A key request/response exchange occurs between the app and a license server to obtain or release keys used to decrypt encrypted content.

[Android.Runtime.Register("getKeyRequest", "([B[BLjava/lang/String;ILjava/util/HashMap;)Landroid/media/MediaDrm$KeyRequest;", "")]
public Android.Media.MediaDrm.KeyRequest GetKeyRequest (byte[] scope, byte[]? init, string? mimeType, int keyType, System.Collections.Generic.IDictionary<string,string>? optionalParameters);
[<Android.Runtime.Register("getKeyRequest", "([B[BLjava/lang/String;ILjava/util/HashMap;)Landroid/media/MediaDrm$KeyRequest;", "")>]
member this.GetKeyRequest : byte[] * byte[] * string * int * System.Collections.Generic.IDictionary<string, string> -> Android.Media.MediaDrm.KeyRequest

Parameters

scope
Byte[]

may be a sessionId or a keySetId, depending on the specified keyType. When the keyType is KEY_TYPE_STREAMING or KEY_TYPE_OFFLINE, scope should be set to the sessionId the keys will be provided to. When the keyType is KEY_TYPE_RELEASE, scope should be set to the keySetId of the keys being released. Releasing keys from a device invalidates them for all sessions.

init
Byte[]

container-specific data, its meaning is interpreted based on the mime type provided in the mimeType parameter. It could contain, for example, the content ID, key ID or other data obtained from the content metadata that is required in generating the key request. May be null when keyType is KEY_TYPE_RELEASE or if the request is a renewal, i.e. not the first key request for the session.

mimeType
String

identifies the mime type of the content. May be null if the keyType is KEY_TYPE_RELEASE or if the request is a renewal, i.e. not the first key request for the session.

keyType
Int32

specifes the type of the request. The request may be to acquire keys for streaming or offline content, or to release previously acquired keys, which are identified by a keySetId.

optionalParameters
IDictionary<String,String>

are included in the key request message to allow a client application to provide additional message parameters to the server. This may be null if no additional parameters are to be sent.

Returns

Attributes

Remarks

Java documentation for android.media.MediaDrm.getKeyRequest(byte[], byte[], java.lang.String, int, java.util.HashMap).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to