Skip to main content

IHashService Interface

Abblix.Oidc.Server

Abblix.Oidc.Server.Features.Hashing

IHashService Interface

Offers hashing functionality for data using various Secure Hash Algorithms (SHA). This service is essential for securely storing and comparing sensitive information like passwords or client secrets without exposing the actual values.

public interface IHashService

Derived
HashService

Methods

IHashService.Sha(HashAlgorithm, string) Method

Generates a hash for the specified data using a chosen SHA algorithm. This method provides a way to securely hash sensitive data, such as secrets or passwords, ensuring that the original data cannot be easily derived from the hash.

byte[] Sha(Abblix.Oidc.Server.Features.Hashing.HashAlgorithm algorithm, string data);

Parameters

algorithm HashAlgorithm

Specifies the SHA algorithm to use for hashing, such as SHA-256 or SHA-512.

data System.String

The data to hash. Typically, this is sensitive information that needs secure handling.

Returns

System.Byte[]
A byte array containing the hash of the input data.

Remarks

It is crucial to select an appropriate SHA algorithm based on security requirements and performance considerations. The hash output is ideal for verifying data integrity and authenticating users or clients without storing or transmitting sensitive plain-text data.