using System;
using static StellaOps.Localization.T;
namespace StellaOps.Provcache;
public sealed partial class VeriKeyBuilder
{
///
/// Sets the merge policy hash (PolicyBundle digest).
///
/// The policy bundle hash.
/// This builder for fluent chaining.
public VeriKeyBuilder WithMergePolicyHash(string policyHash)
{
if (string.IsNullOrWhiteSpace(policyHash))
throw new ArgumentException(_t("common.provcache.policy_hash_required"), nameof(policyHash));
_mergePolicyHash = NormalizeHash(policyHash);
return this;
}
///
/// Computes policy hash from raw policy bundle bytes.
///
/// Raw policy bundle content bytes.
/// This builder for fluent chaining.
public VeriKeyBuilder WithMergePolicyBytes(ReadOnlySpan policyBytes)
{
_mergePolicyHash = ComputeHash(policyBytes);
return this;
}
}