File: Pkcs12Builder.NotSupported.cs

package info (click to toggle)
mono 6.8.0.105%2Bdfsg-3.3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,284,512 kB
  • sloc: cs: 11,172,132; xml: 2,850,069; ansic: 671,653; cpp: 122,091; perl: 59,366; javascript: 30,841; asm: 22,168; makefile: 20,093; sh: 15,020; python: 4,827; pascal: 925; sql: 859; sed: 16; php: 1
file content (115 lines) | stat: -rw-r--r-- 10,592 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;

namespace System.Security.Cryptography.Pkcs {
    /// <summary>Enables the creation of PKCS#12 PFX data values. This class cannot be inherited.</summary>
    public sealed class Pkcs12Builder {
        /// <summary>Gets a value that indicates whether the PFX data has been sealed.</summary>
        /// <returns>A value that indicates whether the PFX data has been sealed.</returns>
        public bool IsSealed {
            get {
                throw new PlatformNotSupportedException ();
            }
        }

        /// <summary>Add contents to the PFX in an bundle encrypted with a byte-based password from a byte array.</summary>
        /// <param name="safeContents">The contents to add to the PFX.</param>
        /// <param name="passwordBytes">The byte array to use as a password when encrypting the contents.</param>
        /// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
        /// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
        /// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
        /// <exception cref="T:System.Security.Cryptography.CryptographicException">
        ///   <paramref name="pbeParameters" /> indicates that <see cref="F:System.Security.Cryptography.PbeEncryptionAlgorithm.TripleDes3KeyPkcs12" /> should be used, which requires <see cref="T:System.Char" />-based passwords.</exception>
        public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, byte[] passwordBytes, PbeParameters pbeParameters) {
            throw new PlatformNotSupportedException ();
        }

        /// <summary>Add contents to the PFX in an bundle encrypted with a byte-based password from a span.</summary>
        /// <param name="safeContents">The contents to add to the PFX.</param>
        /// <param name="passwordBytes">The byte span to use as a password when encrypting the contents.</param>
        /// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
        /// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
        /// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
        /// <exception cref="T:System.Security.Cryptography.CryptographicException">
        ///   <paramref name="pbeParameters" /> indicates that <see cref="F:System.Security.Cryptography.PbeEncryptionAlgorithm.TripleDes3KeyPkcs12" /> should be used, which requires <see cref="T:System.Char" />-based passwords.</exception>
        public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) {
            throw new PlatformNotSupportedException ();
        }

        /// <summary>Add contents to the PFX in an bundle encrypted with a char-based password from a span.</summary>
        /// <param name="safeContents">The contents to add to the PFX.</param>
        /// <param name="password">The span to use as a password when encrypting the contents.</param>
        /// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
        /// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
        /// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
        public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, ReadOnlySpan<char> password, PbeParameters pbeParameters) {
            throw new PlatformNotSupportedException ();
        }

        /// <summary>Add contents to the PFX in an bundle encrypted with a char-based password from a string.</summary>
        /// <param name="safeContents">The contents to add to the PFX.</param>
        /// <param name="password">The string to use as a password when encrypting the contents.</param>
        /// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
        /// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
        /// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
        public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, string password, PbeParameters pbeParameters) {
            throw new PlatformNotSupportedException ();
        }

        /// <summary>Add contents to the PFX without encrypting them.</summary>
        /// <param name="safeContents">The contents to add to the PFX.</param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> parameter is <see langword="null" />.</exception>
        /// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
        public void AddSafeContentsUnencrypted (Pkcs12SafeContents safeContents) {
            throw new PlatformNotSupportedException ();
        }

        /// <summary>Encodes the contents of a sealed PFX and returns it as a byte array.</summary>
        /// <returns>A byte array representing the encoded form of the PFX.</returns>
        /// <exception cref="T:System.InvalidOperationException">The PFX is not sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="false" />).</exception>
        public byte[] Encode () {
            throw new PlatformNotSupportedException ();
        }

        /// <summary>Seals the PFX against further changes by applying a password-based Message Authentication Code (MAC) over the contents with a password from a span.</summary>
        /// <param name="password">The password to use as a key for computing the MAC.</param>
        /// <param name="hashAlgorithm">The hash algorithm to use when computing the MAC.</param>
        /// <param name="iterationCount">The iteration count for the Key Derivation Function (KDF) used in computing the MAC.</param>
        /// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="iterationCount" /> parameter is less than or equal to 0.</exception>
        /// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
        public void SealWithMac (ReadOnlySpan<char> password, HashAlgorithmName hashAlgorithm, int iterationCount) {
            throw new PlatformNotSupportedException ();
        }

        /// <summary>Seals the PFX against further changes by applying a password-based Message Authentication Code (MAC) over the contents with a password from a string.</summary>
        /// <param name="password">The password to use as a key for computing the MAC.</param>
        /// <param name="hashAlgorithm">The hash algorithm to use when computing the MAC.</param>
        /// <param name="iterationCount">The iteration count for the Key Derivation Function (KDF) used in computing the MAC.</param>
        /// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="iterationCount" /> parameter is less than or equal to 0.</exception>
        /// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
        public void SealWithMac (string password, HashAlgorithmName hashAlgorithm, int iterationCount) {
            throw new PlatformNotSupportedException ();
        }

        /// <summary>Seals the PFX from further changes without applying tamper-protection.</summary>
        /// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
        public void SealWithoutIntegrity () {
            throw new PlatformNotSupportedException ();
        }

        /// <summary>Attempts to encode the contents of a sealed PFX into a provided buffer.</summary>
        /// <param name="destination">The byte span to receive the PKCS#12 PFX data.</param>
        /// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
        /// <returns>
        ///   <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
        /// <exception cref="T:System.InvalidOperationException">The PFX is not sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="false" />).</exception>
        public bool TryEncode (Span<byte> destination, out int bytesWritten) {
            throw new PlatformNotSupportedException ();
        }
    }
}