Skip to content
Snippets Groups Projects
ISubscriber.cs 1.01 KiB
using System.Threading.Tasks;
using FitConnect.Models;

namespace FitConnect;

public interface ISubscriber : IBaseFunctionality {
    /// <summary>
    /// Decrypt Data (Fachdaten)
    /// </summary>
    /// <param name="data">(Fachdaten)</param>
    /// <param name="privateKey">Your private key for decryption</param>
    /// <returns></returns>
    Task<string> DecryptDataAsync(string data, string privateKey);

    // Decrypt attachments (Anhänge)
    Task<string> DecryptAttachmentAsync(string attachment, string privateKey);

    /// <summary>
    /// Checks the validity of the given metadata against the schema.
    /// </summary>
    /// <param name="jsonMetaData">JSON meta data</param>
    /// <returns></returns>
    Task<bool> CheckMetadataAsync(string jsonMetaData);

    // Check Hash from Metadata
    Task<bool> CheckHashAsync(string metadata);

    // Create SecurityEventToken and signature
    Task<SecurityEventToken> CreateSecurityEventTokenAsync(string data, string attachment,
        string privateKey);
}