using System; using System.Security.Cryptography; using System.Security.Cryptography.Pkcs; namespace System.Security.Cryptography.Pkcs { /// Enables the creation of PKCS#12 PFX data values. This class cannot be inherited. public sealed class Pkcs12Builder { /// Gets a value that indicates whether the PFX data has been sealed. /// A value that indicates whether the PFX data has been sealed. public bool IsSealed { get { throw new PlatformNotSupportedException (); } } /// Add contents to the PFX in an bundle encrypted with a byte-based password from a byte array. /// The contents to add to the PFX. /// The byte array to use as a password when encrypting the contents. /// The password-based encryption (PBE) parameters to use when encrypting the contents. /// The or parameter is . /// The parameter value is already encrypted. /// The PFX is already sealed ( is ). /// /// indicates that should be used, which requires -based passwords. public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, byte[] passwordBytes, PbeParameters pbeParameters) { throw new PlatformNotSupportedException (); } /// Add contents to the PFX in an bundle encrypted with a byte-based password from a span. /// The contents to add to the PFX. /// The byte span to use as a password when encrypting the contents. /// The password-based encryption (PBE) parameters to use when encrypting the contents. /// The or parameter is . /// The parameter value is already encrypted. /// The PFX is already sealed ( is ). /// /// indicates that should be used, which requires -based passwords. public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, ReadOnlySpan passwordBytes, PbeParameters pbeParameters) { throw new PlatformNotSupportedException (); } /// Add contents to the PFX in an bundle encrypted with a char-based password from a span. /// The contents to add to the PFX. /// The span to use as a password when encrypting the contents. /// The password-based encryption (PBE) parameters to use when encrypting the contents. /// The or parameter is . /// The parameter value is already encrypted. /// The PFX is already sealed ( is ). public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, ReadOnlySpan password, PbeParameters pbeParameters) { throw new PlatformNotSupportedException (); } /// Add contents to the PFX in an bundle encrypted with a char-based password from a string. /// The contents to add to the PFX. /// The string to use as a password when encrypting the contents. /// The password-based encryption (PBE) parameters to use when encrypting the contents. /// The or parameter is . /// The parameter value is already encrypted. /// The PFX is already sealed ( is ). public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, string password, PbeParameters pbeParameters) { throw new PlatformNotSupportedException (); } /// Add contents to the PFX without encrypting them. /// The contents to add to the PFX. /// The parameter is . /// The PFX is already sealed ( is ). public void AddSafeContentsUnencrypted (Pkcs12SafeContents safeContents) { throw new PlatformNotSupportedException (); } /// Encodes the contents of a sealed PFX and returns it as a byte array. /// A byte array representing the encoded form of the PFX. /// The PFX is not sealed ( is ). public byte[] Encode () { throw new PlatformNotSupportedException (); } /// Seals the PFX against further changes by applying a password-based Message Authentication Code (MAC) over the contents with a password from a span. /// The password to use as a key for computing the MAC. /// The hash algorithm to use when computing the MAC. /// The iteration count for the Key Derivation Function (KDF) used in computing the MAC. /// The parameter is less than or equal to 0. /// The PFX is already sealed ( is ). public void SealWithMac (ReadOnlySpan password, HashAlgorithmName hashAlgorithm, int iterationCount) { throw new PlatformNotSupportedException (); } /// Seals the PFX against further changes by applying a password-based Message Authentication Code (MAC) over the contents with a password from a string. /// The password to use as a key for computing the MAC. /// The hash algorithm to use when computing the MAC. /// The iteration count for the Key Derivation Function (KDF) used in computing the MAC. /// The parameter is less than or equal to 0. /// The PFX is already sealed ( is ). public void SealWithMac (string password, HashAlgorithmName hashAlgorithm, int iterationCount) { throw new PlatformNotSupportedException (); } /// Seals the PFX from further changes without applying tamper-protection. /// The PFX is already sealed ( is ). public void SealWithoutIntegrity () { throw new PlatformNotSupportedException (); } /// Attempts to encode the contents of a sealed PFX into a provided buffer. /// The byte span to receive the PKCS#12 PFX data. /// When this method returns, contains a value that indicates the number of bytes written to . This parameter is treated as uninitialized. /// /// if is big enough to receive the output; otherwise, . /// The PFX is not sealed ( is ). public bool TryEncode (Span destination, out int bytesWritten) { throw new PlatformNotSupportedException (); } } }