コード例 #1
0
        private EncryptionResult EncryptPayload(WebPushSubscription subscription, string payload)
        {
            if (string.IsNullOrEmpty(payload))
            {
                return(null);
            }

            subscription.Validate();

            var keys = subscription.Keys;

            return(Encryptor.Encrypt(keys.P256dh, keys.Auth, payload));
        }
コード例 #2
0
 public WebPushNotification(WebPushSubscription subscription)
 {
     Subscription = subscription;
 }