   aesCryptoServiceUrl = (objectId, objectVersion) ->
     aesUrl() + '/cryptoservice/id/' + objectId + '/' + objectVersion
 
-  aesCryptoServiceCdnUrl = (objectId, objectVersion) ->
-    aesCdnUrl() + '/cryptoservice/id/' + objectId + '/' + objectVersion
+  aesCryptoServiceCdnUrl = (objectId, objectVersion, userId) ->
+    aesCdnUrl() + '/cryptoservice/id/' + objectId + '/' + objectVersion + '/' + userId
 
   #
   # helper functions


  # Kryptnostic
  BlockCiphertext = require 'kryptnostic.block-ciphertext'

  # utils
  BinaryUtils = require 'kryptnostic.binary-utils'


  toCacheId = (versionedObjectKey) ->
    return versionedObjectKey.objectId + '/' + versionedObjectKey.objectVersion

  getOwnUserId = ->
    credentialLoader = new CredentialLoader()
    credentials = credentialLoader.getCredentials()
    return credentials.principal

  class KeyStorageApi

