Class SignedCloudEventExtensions
- Namespace
- Savvyio.EventDriven.Messaging.CloudEvents.Cryptography
- Assembly
- Savvyio.EventDriven.Messaging.dll
Extension methods for the ICloudEvent<T> interface.
public static class SignedCloudEventExtensions
- Inheritance
-
objectSignedCloudEventExtensions
Methods
CheckCloudEventSignature<T>(ISignedCloudEvent<T>, IMarshaller, Action<SignedMessageOptions>)
Verifies the digital signature of the ISignedCloudEvent<T> message.
public static void CheckCloudEventSignature<T>(this ISignedCloudEvent<T> cloudEvent, IMarshaller marshaller, Action<SignedMessageOptions> setup) where T : IIntegrationEvent
Parameters
cloudEventISignedCloudEvent<T>The IRequest message to cryptographically verify.
marshallerIMarshallerThe IMarshaller that is used when converting the
cloudEventinto an ISignedCloudEvent<T>.setupAction<SignedMessageOptions>The SignedMessageOptions that must be configured.
Type Parameters
TThe type of the payload constraint to the IRequest interface.
Remarks
This method throws an ArgumentOutOfRangeException if the verification of the digital signature fails.
Exceptions
- ArgumentNullException
cloudEventcannot be null -or-marshallercannot be null.- ArgumentException
setupfailed to configure an instance of SignedMessageOptions in a valid state.- ArgumentOutOfRangeException
cloudEventsignature did not match the cryptographically calculated value.