Table of Contents

Class MessageExtensions

Namespace
Savvyio.Messaging.Cryptography
Assembly
Savvyio.Messaging.dll

Extension methods for the IMessage<T> interface.

public static class MessageExtensions
Inheritance
Object
MessageExtensions

Methods

Sign<T>(IMessage<T>, IMarshaller, Action<SignedMessageOptions>)

Converts the specified message to an ISignedMessage<T> equivalent using the provided setup configurator.

public static ISignedMessage<T> Sign<T>(this IMessage<T> message, IMarshaller marshaller, Action<SignedMessageOptions> setup)
    where T : IRequest

Parameters

message IMessage<T>

The IRequest message to cryptographically sign.

marshaller IMarshaller

The IMarshaller that is used when converting the message into an ISignedMessage<T>.

setup Action<SignedMessageOptions>

The SignedMessageOptions that must be configured.

Returns

ISignedMessage<T>

An implementation of the ISignedMessage<T> interface having a constraint to the IRequest interface.

Type Parameters

T

The type of the payload constraint to the IRequest interface.

Exceptions

System.ArgumentNullException

message cannot be null -or- marshaller cannot be null.

ArgumentException

setup failed to configure an instance of SignedMessageOptions in a valid state.