From ffd9f8fde126859cd9441baef7899e5645047dae Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 2 Aug 2022 15:02:15 +0700 Subject: Add span variant for Collect --- crypto/src/crmf/PKMacBuilder.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crypto/src/crmf') diff --git a/crypto/src/crmf/PKMacBuilder.cs b/crypto/src/crmf/PKMacBuilder.cs index 156936eac..8093eab44 100644 --- a/crypto/src/crmf/PKMacBuilder.cs +++ b/crypto/src/crmf/PKMacBuilder.cs @@ -83,6 +83,15 @@ namespace Org.BouncyCastle.Crmf signature.CopyTo(sig, sigOff); return signature.Length; } + +#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER + public int Collect(Span destination) + { + byte[] result = Collect(); + result.AsSpan().CopyTo(destination); + return result.Length; + } +#endif } public class PKMacBuilder -- cgit 1.4.1