Table of Contents

SignedCloudEvent<T> Class

Definition

Provides a default implementation of the ISignedCloudEvent<T> interface.

public record SignedCloudEvent<T> : CloudEvent<T>, IEquatable<Acknowledgeable>, IEquatable<CloudEvent>, IEquatable<CloudEvent<T>>, ISignedCloudEvent<T>, ICloudEvent<T>, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable, ISignedMessage<T>, IMessage<T>, IAcknowledgeable, IEquatable<SignedCloudEvent<T>> where T : IIntegrationEvent

Type Parameters

T

The type of the payload constraint to the IIntegrationEvent interface.

Inheritance
SignedCloudEvent<T>
Implements
Inherited Members
Extension Methods

Examples

This example shows how to wrap a CloudEvent together with the signature that protects its serialized envelope.

using System;
using Savvyio;
using Savvyio.EventDriven;
using Savvyio.EventDriven.Messaging.CloudEvents;
using Savvyio.EventDriven.Messaging.CloudEvents.Cryptography;
using Savvyio.Messaging;

namespace ExampleApp;

public sealed class SignedCloudEventExample
{
    public ISignedCloudEvent<MemberCreatedEvent> Create()
    {
        var message = new Message<MemberCreatedEvent>("msg-42", new Uri("https://api.example.com/members"), "members.created", new MemberCreatedEvent("MEM-42"));
        var cloudEvent = message.ToCloudEvent();
        return new SignedCloudEvent<MemberCreatedEvent>(cloudEvent, "signature-value");
    }
}

public sealed record MemberCreatedEvent(string MemberId) : Request, IIntegrationEvent;

Constructors

Name Description
SignedCloudEvent(ICloudEvent<T>, string)

Initializes a new instance of the SignedCloudEvent<T> class.

Properties

Name Description
Signature

Gets the cryptographic signature of the message.

See Also