# ContentKeyPolicySchema

## Properties  
- **id**: string (Optional)  
   Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}  
- **name**: string (Optional, 1-260 characters)  
   The name of the resource  
- **properties**: object (Required)
  
### ContentKeyPolicyProperties  
The key policy

#### Properties  
- **created**: string (Optional, format: date-time)  
   The creation date of the Policy  
- **description**: string (Optional, 0-1024 characters)  
   A description for the Policy.  
- **fairPlayAmsCompatibility**: boolean (Optional)  
   FairPlay AMS compatibility enabled.  
- **lastModified**: string (Optional, format: date-time)  
   The last modified date of the Policy  
- **options**: list of objects (Required)  
   The Key Policy options.

## Configuration  
- **configuration**: object (Required)  
   The key delivery configuration.

### Discriminated by `@odata.type`. Select one variant:
- **Microsoft.Media.ContentKeyPolicyClearKeyConfiguration**: object  
   Represents a configuration for non-DRM keys.  
   - **@odata.type**: string (Required)  
   
- **Microsoft.Media.ContentKeyPolicyFairPlayConfiguration**: object  
   Specifies a configuration for FairPlay licenses.  
   - **ask**: string or null (Required, format: byte)  
   - **fairPlayPfx**: string or null (Required)  
   - **fairPlayPfxPassword**: string or null (Required)

#### Offline Rental Configuration  
- **playbackDurationSeconds**: integer (Required)  
- **storageDurationSeconds**: integer (Required)  
- **rentalAndLeaseKeyType**: enum (Required)  
  Allowed values: Unknown, Undefined, DualExpiry, Persistent, UnlimitedPersistent, Limited.
- **rentalDuration**: integer (Required)

## Widevine Configuration  
- **widevineTemplate**: string (Required)

## Restrictions  
- **restriction**: object (Required)  
   The requirements that must be met to deliver keys with this configuration.

### Discriminated by `@odata.type`. Select one variant:
- **Microsoft.Media.ContentKeyPolicyOpenRestriction**: object  
  Represents an open restriction. License or key will be delivered on every request.  
  - **@odata.type**: string (Required)

- **Microsoft.Media.ContentKeyPolicyTokenRestriction**: object  
   Represents a token restriction. Provided token must match these requirements for successful license or key delivery.  
   - **@odata.type**: string (Required)

## Alternate Verification Keys  
- **alternateVerificationKeys**: list of objects (Optional)  
   A list of alternative verification keys.

### Discriminated by `@odata.type`. Select one variant:
- **Microsoft.Media.ContentKeyPolicyRsaTokenKey**: object  
   Specifies a RSA key for token validation.  
   - **exponent**: string or null (Required, format: byte)  
   - **modulus**: string or null (Required, format: byte)

- **Microsoft.Media.ContentKeyPolicySymmetricTokenKey**: object  
   Specifies a symmetric key for token validation.  
   - **keyValue**: string or null (Required, format: byte)

- **Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey**: object  
   Specifies a certificate for token validation.  
   - **rawBody**: string or null (Required, format: byte)

## Required Claims  
- **requiredClaims**: list of objects (Optional)  
   A list of required token claims.  
   - **claimType**: string (Optional)  
   - **claimValue**: string (Optional)

## Token Type  
- **restrictionTokenType**: enum (Required)  
  Allowed values: Unknown, SWT, JWT.

## System Data  
- **systemData**: object (Optional)  
   Metadata pertaining to creation and last modification of the resource.  
   - **createdAt**: string (Required, format: date-time)  
   - **createdBy**: string (Required)  
   - **createdByType**: enum (Required)  
   Allowed values: User, Application, Managed Identity, Key  
   - **internalId**: string (Required, format: uuid)  
   - **lastModifiedAt**: string (Required, format: date-time)  
   - **lastModifiedBy**: string (Required)  
   - **lastModifiedByType**: enum (Required)  
   Allowed values: User, Application, Managed Identity, Key  
   - **type**: string (Optional)  
   Example: "Microsoft.Media/mediaservices/assets"
