Restrict Service required encrypted request

How do I set Restrict attribute for services ONLY accept Encrypted request using Encrypted Messaging?

Encrypted Messaging is a plugin that uses app-level Request Converters, it’s not a distinct endpoint that can be targeted using restriction attributes.

You can detect whether a request is sent using Encrypted Messaging in your Services with something like:

if (base.Request.Items[EncryptedMessagesFeature.RequestItemsCryptKey] == null)
    throw HttpError.Forbidden("Must use Encrypted Messaging");