feat(client): add CryptoService for login encryption
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
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user