stabilizaiton work - projects rework for maintenanceability and ui livening
This commit is contained in:
32
src/__Libraries/StellaOps.Provcache/VeriKeyBuilder.Sbom.cs
Normal file
32
src/__Libraries/StellaOps.Provcache/VeriKeyBuilder.Sbom.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
|
||||
namespace StellaOps.Provcache;
|
||||
|
||||
public sealed partial class VeriKeyBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the SBOM canonical hash.
|
||||
/// Automatically canonicalizes the SBOM content before hashing if raw bytes are provided.
|
||||
/// </summary>
|
||||
/// <param name="sbomHash">The SBOM canonical hash.</param>
|
||||
/// <returns>This builder for fluent chaining.</returns>
|
||||
public VeriKeyBuilder WithSbomHash(string sbomHash)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(sbomHash))
|
||||
throw new ArgumentException("SBOM hash cannot be null or empty.", nameof(sbomHash));
|
||||
|
||||
_sbomHash = NormalizeHash(sbomHash);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes SBOM hash from raw SBOM bytes using canonical serialization.
|
||||
/// </summary>
|
||||
/// <param name="sbomBytes">Raw SBOM content bytes.</param>
|
||||
/// <returns>This builder for fluent chaining.</returns>
|
||||
public VeriKeyBuilder WithSbomBytes(ReadOnlySpan<byte> sbomBytes)
|
||||
{
|
||||
_sbomHash = ComputeHash(sbomBytes);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user