 
   logger = Logger.get('StorageClient')
 
+  validateId = (id) ->
+    unless id? and _.isString(id) and not _.isEmpty(id)
+      throw new Error 'must specify a string id'
+
+  validateBody = (body) ->
+    unless body? and _.isString(body) and not _.isEmpty(body)
+      throw new Error 'object body cannot be empty!'
+
+  validateDecrypted = (kryptnosticObject) ->
+    if kryptnosticObject.isEncrypted()
+      throw new Error 'expected object to be in decrypted state'
+
   #
   # Client for listing and loading Kryptnostic encrypted objects.
   # Author: rbuckheit

          @objectApi.updateObject(objectId, encryptableBlock)

      deferred.resolve()

      return promise

    deleteObject : (id) ->
      @objectApi.deleteObject(id)

    uploadObject : (storageRequest) ->
      storageRequest.validate()

  class StorageClient

    constructor : ->
      @objectApi           = new ObjectApi()
      @cryptoServiceLoader = new CryptoServiceLoader()

    getObjectIds : ->
      return @objectApi.getObjectIds()
