# How to write a custom DRM module which integrates with key server

**URL:** <https://community.wowza.com/t/how-to-write-a-custom-drm-module-which-integrates-with-key-server/48892>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [May 31, 2017, 11:05am UTC](https://community.wowza.com/t/how-to-write-a-custom-drm-module-which-integrates-with-key-server/48892 "2017-05-31T11:05:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robinsh\_Kumar](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@Robinsh\_Kumar](https://community.wowza.com/u/Robinsh_Kumar)\
**Post date:** [May 31, 2017, 11:05am UTC](https://community.wowza.com/t/how-to-write-a-custom-drm-module-which-integrates-with-key-server/48892/1 "2017-05-31T11:05:19Z")

</div>

1. Map a stream name to a private encryption key and public key identifier, as well as to additional DRM metadata.
2. Call the Wowza Streaming Engine API to apply the encryption key, key identifier, and DRM metadata to the stream.

[https://www.wowza.com/docs/how-to-write-a-custom-drm-module-that-integrates-with-key-server-technology](https://www.wowza.com/docs/how-to-write-a-custom-drm-module-that-integrates-with-key-server-technology)

can you explain about both points which mentioned before while creation of a custom DRM module. If I put .key file at specified path manually and try to encrypt live stream, unable to do the same. So it will be very helpful for me if you post some example code that explained point 1 and 2 both.

Thanks in advance…
