Create policy
    • PDF

    Create policy

    • PDF

    Article summary

    An API that creates the policy required to issue the One Click Multi DRM license.

    Note
    • Through the policy detail settings, you can apply playback and security level policies to the DRM license according to the DRM type.
    • Through the policy detail settings, you can set policies regarding playback, such as "persistent" status configuration.
    • For content whose tracks are divided according to resolutions, the playback policy is applied the same for all tracks.
    • Currently, the One Click Multi DRM product only supports single key license. We plan to support multi-track licenses in the future.
    • For detailed policy options regarding playbacks provided by the One Click Multi DRM product, see Pallycon playback policy's detailed options.
    • For detailed policy options regarding the security provided by the One Click Multi DRM product, see Pallycon security policy's detailed options.
    • The detailed policy settings provided by the One Click Multi DRM product supports the same options provided by Pallycon DRM.
      For details on the supported security level according to the DRM type, check the support status of the individual terminal device.

    Requests

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

    Request headers

    Header nameRequirement statusDescription
    x-ncp-apigw-timestampYESThis is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 (UTC)
    If the time difference compared to the API Gateway server is 5 minutes or longer, then the request is considered invalid
    x-ncp-apigw-timestamp:{Timestamp}
    x-ncp-iam-access-keyYESValue of access key ID issued in the NAVER Cloud Platform portal
    x-ncp-iam-access-key:{Sub Account Access Key}
    x-ncp-apigw-signature-v2YESSignature encrypted with the access key ID value and secret key
    x-ncp-apigw-signature-v2:{API Gateway Signature}
    Content-TypeYESSpecifies the request body content type as application/json
    Content-Type: application/json
    x-ncp-region_codeYESRegion code (KR)

    Request body

    Field nameTypeRequirement statusRestrictionDescription
    policyNameStringY
    persistentBooleanYDefault: falseOffline license storage status
    true: maintain license, false: remove license after playback (streaming)
    rentalDurationIntegerYDefault: 0
    0-2,147,483,647
    Settings for using offline rental scenario
    ("persistent: true" must be set when using the option)
    Valid period of the license from the download to the first playback time (unit: second(s))
    playbackDurationIntegerYDefault value: 0
    0-2,147,483,647
    Valid period of the license after the first playback (unit: second(s))
    drmPolicyConfigObject[Array]YDetailed policy setting by drm type
    drmPolicyConfig{}.wideVineObjectNWidevine's policy
    drmPolicyConfig{}.wideVine{}.useYnBooleanNWhether to apply Widevine's policy settings
    drmPolicyConfig{}.wideVine{}.securityLevelIntegerN1:SW_SECURE_CRYPTO
    2:SW_SECURE_DECODE
    3:HW_SECURE_CRYPTO
    4:HW_SEURE_DECODE
    5:HW_SECURE_ALL
    Widevine security level setting for the track
    1:SW_SECURE_CRYPTO
    2:SW_SECURE_DECODE
    3:HW_SECURE_CRYPTO
    4:HW_SECURE_DECODE
    If set to 5:HW_SECURE_ALL - 5, playback is only available on Widevine L1 device
    drmPolicyConfig{}.wideVine{}.hdcpStringNHDCP_NONE
    HDCP_V1
    HDCP_V2
    HDCP_V2_1
    HDCP_V2_2
    HDCP_NO_DIGITAL_OUTPUT
    Digital output security (HDCP) level setting input value: 1 of "HDCP_NONE," "HDCP_V1," "HDCP_V2," "HDCP_V2_1," "HDCP_V2_2," and "HDCP_NO_DIGITAL_OUTPUT"
    drmPolicyConfig{}.wideVine{}.cgmsStringNCGMS_NONE
    COPY_FREE
    COPY_ONCE
    COPY_NEVER
    Analog output security (CGMS-A) level setting - input value: 1 of "CGMS_NONE," "COPY_FREE," "COPY_ONCE," and "COPY_NEVER,"
    drmPolicyConfig{}.wideVine{}.disableAnalogOutputYnBooleanNWhether analog output is allowed (false: analog output allowed)
    drmPolicyConfig{}.wideVine{}.hdcpSrmRuleStringNHDCP_SRM_RULE_NONE
    CURRENT_SRM
    If the HDCP device cannot process the system renewability message (SRM), sets the track's playback status.
    CURRENT_SRM: Playback of the track not available on devices where the latest SRM cannot be applied. Input value: 1 of "HDCP_SRM_RULE_NONE" and "CURRENT_SRM"
    drmPolicyConfig{}.wideVine{}.deviceRevocationBooleanNWhether license issuance is allowed for revoked Android devices (withdrawn from Widevine's support targets) (default value: issuance not allowed)
    drmConfig{}.playReadyObjectNPlayReady's policy
    drmConfig{}.playReady{}.useYnBooleanNWhether to apply PlayReady's policy settings
    drmConfig{}.playReady{}.securityLevelIntegerN150
    2000
    3000
    PlayReady security level for the track (150, 2000, 3000). When hardware DRM is applied, set to 3000.
    drmConfig{}.playReady{}.digitalVideoProtectionLevelIntegerN100
    250
    270
    300
    301
    Security level setting for digital video output (100, 250, 270, 300, 301)
    drmConfig{}.playReady{}.analogVideoProtectionLevelIntegerN100
    150
    200
    201
    Security level setting for analog video output (100, 150, 200, 201)
    drmConfig{}.playReady{}.digitalAudioProtectionLevelIntegerN100
    250
    300
    301
    Security level setting for digital audio output (100, 250, 300, 301)
    drmConfig{}.playReady{}.hdcpUseYnBooleanNSets whether type 1 (HDCP V2.2 and above) is required when HDCP is applied according to OPL settings. (when set to "true," HDCP 2.2 or above is required)
    drmConfig{}.fairPlayObjectNFairPlay Streaming's policy
    drmConfig{}.fairPlay{}.useYnBooleanYWhether to apply FairPlay Streaming's policy settings
    drmConfig{}.fairPlay{}.hdcpEnforcementStringN-1 (HDCP not applied)
    0 (HDCP Type 0 (regardless of version))
    1 (HDCP Type 1 (2.2 or above required))
    HDCP application status and HDCP version for the track
    -1: HDCP not applied
    0: HDCP Type 0 (regardless of version)
    1: HDCP Type 1 (2.2 or above required)
    drmConfig{}.fairPlay{}.allowAirPlayBooleanNWhether to allow AirPlay
    drmConfig{}.fairPlay{}.allowAvAdaptorBooleanNWhether to allow output through digital AV adapter

    Response

    Field nameTypeRequirement statusRestrictionDescription
    policyNameStringY  
    policyStatusStringYCREATING
    READY
    DELETED
    UPDATING
     Policy status  
    policyIdIntegerYdefault Policy : 0Created PolicyId
    policyCreatedTimeTimestampN Policy created time 
    policyUpdateTimeTimestampN Policy setting change time
    persistentBooleanYDefault: false Offline license storage status
    true: maintain license, false: remove license after playback (streaming)
    rentalDurationIntegerY Default: 0
    0-2,147,483,647
    Settings for using offline rental scenario
    ("persistent: true" must be set when using the option)
    Valid period of the license from the download to the first playback time (unit: second(s))
    playbackDurationIntegerYDefault value: 0
    0-2,147,483,647 
    Valid period of the license after the first playback (unit: second(s))
    drmPolicyConfigObject[Array]Y Detailed policy setting by drm type
    drmPolicyConfig{}.wideVineObjectNWidevine's policy 
    drmPolicyConfig{}.wideVine{}.useYnBooleanN Whether to apply Widevine's policy settings 
    drmPolicyConfig{}.wideVine{}.securityLevelIntegerN1:SW_SECURE_CRYPTO
    2:SW_SECURE_DECODE
    3:HW_SECURE_CRYPTO
    4:HW_SECURE_DECODE
    5:HW_SECURE_ALL
    Widevine security level setting for the track
    1:SW_SECURE_CRYPTO
    2:SW_SECURE_DECODE
    3:HW_SECURE_CRYPTO
    4:HW_SECURE_DECODE
    If set to 5:HW_SECURE_ALL - 5, playback is only available on Widevine L1 device
    drmPolicyConfig{}.wideVine{}.hdcpStringNHDCP_NONE
    HDCP_V1
    HDCP_V2
    HDCP_V2_1
    HDCP_V2_2
    HDCP_NO_DIGITAL_OUTPUT
    Digital output security (HDCP) level setting input value: 1 of "HDCP_NONE," "HDCP_V1," "HDCP_V2," "HDCP_V2_1," "HDCP_V2_2," and "HDCP_NO_DIGITAL_OUTPUT"
    drmPolicyConfig{}.wideVine{}.cgmsStringNCGMS_NONE
    COPY_FREE
    COPY_ONCE
    COPY_NEVER
    Analog output security (CGMS-A) level setting - input value: 1 of "CGMS_NONE," "COPY_FREE," "COPY_ONCE," and "COPY_NEVER,"
    drmPolicyConfig{}.wideVine{}.disableAnalogOutputYnBooleanN Whether analog output is allowed (false: analog output allowed)
    drmPolicyConfig{}.wideVine{}.hdcpSrmRuleStringNHDCP_SRM_RULE_NONE
    CURRENT_SRM
    If the HDCP device cannot process the system renewability message (SRM), sets the track's playback status.
    CURRENT_SRM: Playback of the track not available on devices where the latest SRM cannot be applied. Input value: 1 of "HDCP_SRM_RULE_NONE" and "CURRENT_SRM"
    drmPolicyConfig{}.wideVine{}.deviceRevocationBooleanN Whether license issuance is allowed for revoked Android devices (withdrawn from Widevine's support targets) (default value: issuance not allowed)
    drmConfig{}.playReadyObjectN PlayReady's policy
    drmConfig{}.playReady{}.useYnBooleanN Whether to apply PlayReady's policy settings
    drmConfig{}.playReady{}.securityLevelIntegerN150
    2000
    3000
    PlayReady security level for the track
    150, 2000, 3000
    When hardware DRM is applied, set to 3000.
    drmConfig{}.playReady{}.digitalVideoProtectionLevelIntegerN100
    250
    270
    300
    301
    Security level setting for digital video output (100, 250, 270, 300, 301)
    drmConfig{}.playReady{}.analogVideoProtectionLevelIntegerN100
    150
    200
    201
    Security level setting for analog video output (100, 150, 200, 201)
    drmConfig{}.playReady{}.digitalAudioProtectionLevelIntegerN100
    250
    300
    301
    Security level setting for digital audio output (100, 250, 300, 301)
    drmConfig{}.playReady{}.hdcpUseYnBooleanN Sets whether type 1 (HDCP V2.2 and above) is required when HDCP is applied according to OPL settings
    (when set to "true," HDCP 2.2 or above is required)
    drmConfig{}.fairPlayObjectN  FairPlay Streaming's policy
    drmConfig{}.fairPlay{}.useYnBooleanY  Whether to apply FairPlay Streaming's policy settings
    drmConfig{}.fairPlay{}.hdcpEnforcementStringN-1 (HDCP not applied)
    0 (HDCP Type 0 (regardless of version))
    1 (HDCP Type 1 (2.2 or above required))
    HDCP application status and HDCP version for the track
    -1: HDCP not applied
    0: HDCP Type 0 (regardless of version)
    1: HDCP Type 1 (2.2 or above required)
    drmConfig{}.fairPlay{}.allowAirPlayBooleanN Whether to allow AirPlay
    drmConfig{}.fairPlay{}.allowAvAdaptorBooleanN Whether to allow output through 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
          }
        }
      }
    }
    

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.