<PackageReference Include="System.Security.Cryptography.Pkcs" Version="11.0.0-preview.7.26381.103" />

System.Security.Cryptography.Pkcs.Pkcs12Builder

public sealed class Pkcs12Builder
Enables the creation of PKCS#12 PFX data values. This class cannot be inherited.
namespace System.Security.Cryptography.Pkcs { public sealed class Pkcs12Builder { public bool IsSealed { get; } public void AddSafeContentsEncrypted(Pkcs12SafeContents safeContents, byte[] passwordBytes, PbeParameters pbeParameters); public void AddSafeContentsEncrypted(Pkcs12SafeContents safeContents, ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters); public void AddSafeContentsEncrypted(Pkcs12SafeContents safeContents, string password, PbeParameters pbeParameters); public void AddSafeContentsEncrypted(Pkcs12SafeContents safeContents, ReadOnlySpan<char> password, PbeParameters pbeParameters); public void AddSafeContentsUnencrypted(Pkcs12SafeContents safeContents); public byte[] Encode(); public void SealWithMac(string password, HashAlgorithmName hashAlgorithm, int iterationCount); public void SealWithMac(ReadOnlySpan<char> password, HashAlgorithmName hashAlgorithm, int iterationCount); public void SealWithoutIntegrity(); public bool TryEncode(Span<byte> destination, out int bytesWritten); public Pkcs12Builder(); } }