stabilizaiton work - projects rework for maintenanceability and ui livening
This commit is contained in:
31
src/__Libraries/StellaOps.Provcache/VeriKeyBuilder.Policy.cs
Normal file
31
src/__Libraries/StellaOps.Provcache/VeriKeyBuilder.Policy.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace StellaOps.Provcache;
|
||||
|
||||
public sealed partial class VeriKeyBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the merge policy hash (PolicyBundle digest).
|
||||
/// </summary>
|
||||
/// <param name="policyHash">The policy bundle hash.</param>
|
||||
/// <returns>This builder for fluent chaining.</returns>
|
||||
public VeriKeyBuilder WithMergePolicyHash(string policyHash)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(policyHash))
|
||||
throw new ArgumentException("Policy hash cannot be null or empty.", nameof(policyHash));
|
||||
|
||||
_mergePolicyHash = NormalizeHash(policyHash);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes policy hash from raw policy bundle bytes.
|
||||
/// </summary>
|
||||
/// <param name="policyBytes">Raw policy bundle content bytes.</param>
|
||||
/// <returns>This builder for fluent chaining.</returns>
|
||||
public VeriKeyBuilder WithMergePolicyBytes(ReadOnlySpan<byte> policyBytes)
|
||||
{
|
||||
_mergePolicyHash = ComputeHash(policyBytes);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user