30153dcbf8
Implements ICryptoService for encrypting login credentials using RSA-OAEP. Uses JavaScript interop with browser's native SubtleCrypto API instead of Blazor.SubtleCrypto package (which only supports AES-GCM, not RSA-OAEP). - ICryptoService interface in JdeScoping.Client.Services namespace - CryptoService fetches server's public key once, caches it - interop.js rsaEncrypt function for RSA-OAEP encryption via Web Crypto API
17 lines
495 B
C#
17 lines
495 B
C#
using JdeScoping.Core.Models.Auth;
|
|
|
|
namespace JdeScoping.Client.Services;
|
|
|
|
/// <summary>
|
|
/// Service for encrypting data using server's RSA public key.
|
|
/// </summary>
|
|
public interface ICryptoService
|
|
{
|
|
/// <summary>
|
|
/// Encrypts login credentials for transmission to server.
|
|
/// </summary>
|
|
/// <param name="model">Login credentials to encrypt</param>
|
|
/// <returns>Base64-encoded encrypted data</returns>
|
|
Task<string> EncryptLoginAsync(LoginModel model);
|
|
}
|