Create policy

Prev Next

This is an API to create policies required for issuing One Click Multi DRM licenses.

Note
  • You can apply playback and security level policies for each DRM type to DRM licenses through detailed policy settings.
  • You can set policies related to playback, such as license validity period and persistence, through detailed policy settings.
  • For content with tracks divided by resolution, the playback policy applies to all tracks equally.
  • The One Click Multi DRM product currently only supports single-key licenses, and support for multi-track licenses will be available in the future.
  • You can find the detailed options for the playback policies provided by the One Click Multi DRM product in the DoveRunner (formerly PallyCon) Playback Policy Detailed Options{target=_blank} guide.
  • You can find the detailed options for security-related policies provided by the One Click Multi DRM product in the DoveRunner (formerly PallyCon) Security Policy Detailed Options{target=_blank} guide.
  • The detailed settings of the policies provided by the One Click Multi DRM product support the options provided by DoveRunner (formerly PallyCon) DRM as they are.
    For details on the security level of devices supported by each DRM type, please check the status of support for individual devices.

Request

POST https://multi-drm.apigw.ntruss.com/api/v1/policy

Request headers

Header name Required Description
x-ncp-apigw-timestamp YES This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
Request is considered invalid if the timestamp differs from the current time by more than 5 minutes.
x-ncp-apigw-timestamp:{Timestamp}
x-ncp-iam-access-key YES Value of access key ID issued in the NAVER Cloud Platform portal
x-ncp-iam-access-key:{Sub Account Access Key}
x-ncp-apigw-signature-v2 YES Signature encrypted with the access key ID value and secret key
x-ncp-apigw-signature-v2:{API Gateway Signature}
Content-Type YES Specify the request body content type as application/JSON.
Content-Type: application/json
x-ncp-region_code YES Region code (KR)

Request body

| Field name | Type | Required | Restrictions | Description |
|--- |--- |--- |--- |--- |
| policyName | String | Y | | |
| persistent | Boolean | Y | Default: false | Whether to save offline licenses
true: Keep license. false: Remove license after playback (streaming). |
| rentalDuration | Integer | Y | Default: 0
0-2,147,483,647 | Set when using the offline rental scenario.
(When using this option, you need to set persistent: true.)
The license validity period until the first playback after downloading (unit: second) |
| playbackDuration | Integer | Y | Default: 0
0-2,147,483,647 | License validity period from the first playback start (unit: second) |
| drmPolicyConfig | Object[Array] | Y | | Detailed policy settings by DRM type |
| drmPolicyConfig{}.wideVine | Object | N | | Widevine's policy |
| drmPolicyConfig{}.wideVine{}.useYn | Boolean | N | | Whether Widevine policy settings are applied |
| drmPolicyConfig{}.wideVine{}.securityLevel | Integer | N | 1:SW_SECURE_CRYPTO
2:SW_SECURE_DECODE
3:HW_SECURE_CRYPTO
4:HW_SEURE_DECODE
5:HW_SECURE_ALL | Set the Widevine security level for the track.
1: SW_SECURE_CRYPTO
2: SW_SECURE_DECODE
3: HW_SECURE_CRYPTO
4: HW_SECURE_DECODE
5: HW_SECURE_ALL - If set to 5, it can only be played on Widevine L1 devices. |
| drmPolicyConfig{}.wideVine{}.hdcp | String | N | HDCP_NONE
HDCP_V1
HDCP_V2
HDCP_V2_1
HDCP_V2_2
HDCP_NO_DIGITAL_OUTPUT | Security (HDCP) level setting input value for digital output: one among "HDCP_NONE," "HDCP_V1," "HDCP_V2," "HDCP_V2_1," "HDCP_V2_2," and "HDCP_NO_DIGITAL_OUTPUT" |
| drmPolicyConfig{}.wideVine{}.cgms | String | N | CGMS_NONE
COPY_FREE
COPY_ONCE
COPY_NEVER | Set the security (CGMS-A) level for analog output.- Input value: one among "CGMS_NONE," "COPY_FREE," "COPY_ONCE," and "COPY_NEVER" |
| drmPolicyConfig{}.wideVine{}.disableAnalogOutputYn | Boolean | N | | Whether to allow analog output (false: Allow analog output.) |
| drmPolicyConfig{}.wideVine{}.hdcpSrmRule | String | N | HDCP_SRM_RULE_NONE
CURRENT_SRM | Set whether to play the track if the HDCP device can't process the System Renewability Message (SRM).
CURRENT_SRM: The track will not be played on devices that do not support the latest SRM. Input value: either "HDCP_SRM_RULE_NONE" or "CURRENT_SRM" |
| drmPolicyConfig{}.wideVine{}.deviceRevocation | Boolean | N | | Whether to allow license issuance for revoked (withdrawn from Widevine support) Android devices (default: not allowed) |
| drmConfig{}.playReady | Object | N | | PlayReady's policy |
| drmConfig{}.playReady{}.useYn | Boolean | N | | Whether PlayReady policy settings are applied |
| drmConfig{}.playReady{}.securityLevel | Integer | N | 150
2000
3000 | PlayReady security level for the track (150, 2000, 3000). Set to 3000 when applying hardware DRM. |
| drmConfig{}.playReady{}.digitalVideoProtectionLevel | Integer | N | 100
250
270
300
301 | Set security level for digital video output (100, 250, 270, 300, 301). |
| drmConfig{}.playReady{}.analogVideoProtectionLevel | Integer | N | 100
150
200
201 | Set security level for analog video output (100, 150, 200, 201). |
| drmConfig{}.playReady{}.digitalAudioProtectionLevel | Integer | N | 100
250
300
301 | Set security level for digital audio output (100, 250, 300, 301). |
| drmConfig{}.playReady{}.hdcpUseYn | Boolean | N | | Set whether Type 1 (HDCP V2.2 or later) is required when HDCP is applied according to the OPL settings. (HDCP 2.2 or higher required when set to true) |
| drmConfig{}.fairPlay | Object | N | | FairPlay Streaming's policy |
| drmConfig{}.fairPlay{}.useYn | Boolean | Y | | Whether to apply the policy settings of FairPlay Streaming |
| drmConfig{}.fairPlay{}.hdcpEnforcement | String | N | -1 (HDCP not applied)
0 (HDCP Type 0 (regardless of version))
1 (HDCP Type 1 (requires 2.2 or later)) | Whether HDCP is applied to the track and HDCP version
-1: HDCP not applied
0: HDCP Type 0 (regardless of version)
1: HDCP Type 1 (requires 2.2 or later required) |
| drmConfig{}.fairPlay{}.allowAirPlay | Boolean | N | | Whether to allow AirPlay |
| drmConfig{}.fairPlay{}.allowAvAdaptor | Boolean | N | | Whether to allow output via digital AV adapter |

Response

Field name Type Required Restrictions Description
policyName String Y
policyStatus String Y CREATING
READY
DELETED
UPDATING
Policy status
policyId Integer Y default Policy : 0 Created PolicyId
policyCreatedTime Timestamp N Policy creation time
policyUpdateTime Timestamp N Policy configuration change time
persistent Boolean Y Default: false Whether to save offline licenses
true: Keep license. false: Remove license after playback (streaming).
rentalDuration Integer Y Default: 0
0-2,147,483,647
Set when using the offline rental scenario.
(When using this option, you need to set persistent: true.)
The license validity period until the first playback after downloading (unit: second)
playbackDuration Integer Y Default: 0
0-2,147,483,647
License validity period from the first playback start (unit: second)
drmPolicyConfig Object[Array] Y Detailed policy settings by DRM type
drmPolicyConfig{}.wideVine Object N Widevine's policy
drmPolicyConfig{}.wideVine{}.useYn Boolean N Whether Widevine policy settings are applied
drmPolicyConfig{}.wideVine{}.securityLevel Integer N 1:SW_SECURE_CRYPTO
2:SW_SECURE_DECODE
3:HW_SECURE_CRYPTO
4:HW_SECURE_DECODE
5:HW_SECURE_ALL
Set the Widevine security level for the track.
1: SW_SECURE_CRYPTO
2: SW_SECURE_DECODE
3: HW_SECURE_CRYPTO
4: HW_SECURE_DECODE
5: HW_SECURE_ALL - If set to 5, it can only be played on Widevine L1 devices.
drmPolicyConfig{}.wideVine{}.hdcp String N HDCP_NONE
HDCP_V1
HDCP_V2
HDCP_V2_1
HDCP_V2_2
HDCP_NO_DIGITAL_OUTPUT
Security (HDCP) level setting input value for digital output: one among "HDCP_NONE," "HDCP_V1," "HDCP_V2," "HDCP_V2_1," "HDCP_V2_2," and "HDCP_NO_DIGITAL_OUTPUT"
drmPolicyConfig{}.wideVine{}.cgms String N CGMS_NONE
COPY_FREE
COPY_ONCE
COPY_NEVER
Set the security (CGMS-A) level for analog output.- Input value: one among "CGMS_NONE," "COPY_FREE," "COPY_ONCE," and "COPY_NEVER"
drmPolicyConfig{}.wideVine{}.disableAnalogOutputYn Boolean N Whether to allow analog output (false: Allow analog output.)
drmPolicyConfig{}.wideVine{}.hdcpSrmRule String N HDCP_SRM_RULE_NONE
CURRENT_SRM
Set whether to play the track if the HDCP device can't process the System Renewability Message (SRM).
CURRENT_SRM: The track will not be played on devices that do not support the latest SRM. Input value: either "HDCP_SRM_RULE_NONE" or "CURRENT_SRM"
drmPolicyConfig{}.wideVine{}.deviceRevocation Boolean N Whether to allow license issuance for revoked (withdrawn from Widevine support) Android devices (default: not allowed)
drmConfig{}.playReady Object N PlayReady's policy
drmConfig{}.playReady{}.useYn Boolean N Whether PlayReady policy settings are applied
drmConfig{}.playReady{}.securityLevel Integer N 150
2000
3000
PlayReady security level for the track
150, 2000, 3000
Set to 3000 when applying hardware DRM.
drmConfig{}.playReady{}.digitalVideoProtectionLevel Integer N 100
250
270
300
301
Set security level for digital video output (100, 250, 270, 300, 301).
drmConfig{}.playReady{}.analogVideoProtectionLevel Integer N 100
150
200
201
Set security level for analog video output (100, 150, 200, 201).
drmConfig{}.playReady{}.digitalAudioProtectionLevel Integer N 100
250
300
301
Set security level for digital audio output (100, 250, 300, 301).
drmConfig{}.playReady{}.hdcpUseYn Boolean N Set whether to require Type 1 (HDCP V2.2 or later) when HDCP is applied according to OPL settings
(HDCP 2.2 or later required when set to true)
drmConfig{}.fairPlay Object N FairPlay Streaming's policy
drmConfig{}.fairPlay{}.useYn Boolean Y Whether to apply the policy settings of FairPlay Streaming
drmConfig{}.fairPlay{}.hdcpEnforcement String N -1 (HDCP not applied)
0 (HDCP Type 0 (regardless of version))
1 (HDCP Type 1 (requires 2.2 or later))
Whether HDCP is applied to the track and HDCP version
-1: HDCP not applied
0: HDCP Type 0 (regardless of version)
1: HDCP Type 1 (requires 2.2 or later required)
drmConfig{}.fairPlay{}.allowAirPlay Boolean N Whether to allow AirPlay
drmConfig{}.fairPlay{}.allowAvAdaptor Boolean N Whether to allow output via digital AV adapter

Examples

Request example

POST /api/v1/policy
HOST: multi-drm.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp:1521787414578
x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
x-ncp-region_code:KR

# case 1. set all drmType 
{
  "drmPolicyConfig": {
    "fairplay": {
      "allowAirPlay": true,
      "allowAvAdaptor": true,
      "hdcpEnforcement": "-1",
      "useYn": true
    },
    "playready": {
      "analogVideoProtectionLevel": "100",
      "digitalAudioProtectionLevel": "100",
      "digitalVideoProtectionLevel": "100",
      "hdcpUseYn": true,
      "securityLevel": "150",
      "useYn": true
    },
    "widevine": {
      "cgms": "CGMS_NONE",
      "deviceRevocation": true,
      "disableAnalogOutputYn": true,
      "hdcp": "HDCP_NONE",
      "hdcpSrmRule": "HDCP_SRM_RULE_NONE",
      "securityLevel": "1",
      "useYn": true
    }
  },
  "persistent": true,
  "playbackDuration": 0,
  "policyName": "mySamplePolicy",
  "rentalDuration": 0
}
POST /api/v1/policy
HOST: multi-drm.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp:1521787414578
x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
x-ncp-region_code:KR

# case 2. set drm policy without fairPlay
{
  "drmPolicyConfig": {
    "fairplay": {
      "useYn": false
    },
    "playready": {
      "analogVideoProtectionLevel": "100",
      "digitalAudioProtectionLevel": "100",
      "digitalVideoProtectionLevel": "100",
      "hdcpUseYn": true,
      "securityLevel": "150",
      "useYn": true
    },
    "widevine": {
      "cgms": "CGMS_NONE",
      "deviceRevocation": true,
      "disableAnalogOutputYn": true,
      "hdcp": "HDCP_NONE",
      "hdcpSrmRule": "HDCP_SRM_RULE_NONE",
      "securityLevel": "1",
      "useYn": true
    }
  },
  "persistent": true,
  "playbackDuration": 0,
  "policyName": "mySamplePolicy",
  "rentalDuration": 0
}

Response example

HTTP/1.1 200 OK
Server: nginx
Date: Fri, 20 Nov 2023 19:53:32 GMT
Content-Type: application/json;charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4

### case 1. 
{
  "success": true,
  "content": {
    "policyId": 122,
    "policyName": "mySamplePolicy",
    "policyStatus": "CREATED",
    "policyCreatedTime": 1700479924517,
    "policyUpdateTime": 1700479924526,
    "persistent": true,
    "rentalDuration": 0,
    "playbackDuration": 0,
    "drmPolicyConfig": {
      "wideVine": {
        "useYn": true,
        "securityLevel": 1,
        "hdcp": "HDCP_NONE",
        "cgms": "CGMS_NONE",
        "disableAnalogOutputYn": true,
        "hdcpSrmRule": "HDCP_SRM_RULE_NONE",
        "deviceRevocation": true
      },
      "playReady": {
        "useYn": true,
        "securityLevel": 150,
        "digitalVideoProtectionLevel": 100,
        "analogVideoProtectionLevel": 100,
        "digitalAudioProtectionLevel": 100,
        "hdcpUseYn": true
      },
      "fairPlay": {
        "useYn": true,
        "hdcpEnforcement": -1,
        "allowAirPlay": true,
        "allowAvAdaptor": true
      }
    }
  }
}
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 20 Nov 2023 19:53:32 GMT
Content-Type: application/json;charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4

### case 2. 
{
  "success": true,
  "content": {
    "policyId": 123,
    "policyName": "mySamplePolicy",
    "policyStatus": "CREATED",
    "policyCreatedTime": 1700480181622,
    "policyUpdateTime": 1700480181634,
    "persistent": true,
    "rentalDuration": 0,
    "playbackDuration": 0,
    "drmPolicyConfig": {
      "wideVine": {
        "useYn": true,
        "securityLevel": 1,
        "hdcp": "HDCP_NONE",
        "cgms": "CGMS_NONE",
        "disableAnalogOutputYn": true,
        "hdcpSrmRule": "HDCP_SRM_RULE_NONE",
        "deviceRevocation": true
      },
      "playReady": {
        "useYn": true,
        "securityLevel": 150,
        "digitalVideoProtectionLevel": 100,
        "analogVideoProtectionLevel": 100,
        "digitalAudioProtectionLevel": 100,
        "hdcpUseYn": true
      },
      "fairPlay": {
        "useYn": false
      }
    }
  }
}