Add SignedCms to the TypeForwards in the System.Security.Cryptography.Pkcs facade...
[mono-project.git] / mcs / class / System.Security / System.Security.Cryptography.Pkcs / Pkcs12SafeContents.NotSupported.cs
blob3a02a792cbbff2239871393a21bb478478d7df3a
1 using System;
2 using System.Collections.Generic;
3 using System.Security.Cryptography;
4 using System.Security.Cryptography.Pkcs;
5 using System.Security.Cryptography.X509Certificates;
7 namespace System.Security.Cryptography.Pkcs {
8 /// <summary>Represents a PKCS#12 SafeContents value. This class cannot be inherited.</summary>
9 public sealed class Pkcs12SafeContents {
10 /// <summary>Gets a value that indicates the type of encryption applied to the contents.</summary>
11 /// <returns>One of the enumeration values that indicates the type of encryption applied to the contents. The default value is <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.None" />.</returns>
12 public Pkcs12ConfidentialityMode ConfidentialityMode {
13 get {
14 throw new PlatformNotSupportedException ();
18 /// <summary>Gets a value that indicates whether this instance in a read-only state.</summary>
19 /// <returns>
20 /// <see langword="true" /> if this value is in a read-only state; otherwise, <see langword="false" />. The default value is <see langword="false" />.</returns>
21 public bool IsReadOnly {
22 get {
23 throw new PlatformNotSupportedException ();
27 /// <summary>Adds a certificate to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12CertBag" /> and returns the newly created bag instance.</summary>
28 /// <param name="certificate">The certificate to add.</param>
29 /// <returns>The bag instance which was added to the SafeContents.</returns>
30 /// <exception cref="T:System.ArgumentNullException">The <paramref name="certificate" /> parameter is <see langword="null" />.</exception>
31 /// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
32 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="certificate" /> parameter is in an invalid state.</exception>
33 public Pkcs12CertBag AddCertificate (X509Certificate2 certificate) {
34 throw new PlatformNotSupportedException ();
37 /// <summary>Adds an asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12KeyBag" /> and returns the newly created bag instance.</summary>
38 /// <param name="key">The asymmetric private key to add.</param>
39 /// <returns>The bag instance which was added to the SafeContents.</returns>
40 /// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
41 /// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
42 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
43 public Pkcs12KeyBag AddKeyUnencrypted (AsymmetricAlgorithm key) {
44 throw new PlatformNotSupportedException ();
47 /// <summary>Adds a nested SafeContents to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12SafeContentsBag" /> and returns the newly created bag instance.</summary>
48 /// <param name="safeContents">The nested contents to add to the SafeContents.</param>
49 /// <returns>The bag instance which was added to the SafeContents.</returns>
50 /// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> parameter is <see langword="null" />.</exception>
51 /// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter is encrypted.</exception>
52 /// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
53 public Pkcs12SafeContentsBag AddNestedContents (Pkcs12SafeContents safeContents) {
54 throw new PlatformNotSupportedException ();
57 /// <summary>Adds a SafeBag to the SafeContents.</summary>
58 /// <param name="safeBag">The SafeBag value to add.</param>
59 /// <exception cref="T:System.ArgumentNullException">The <paramref name="safeBag" /> parameter is <see langword="null" />.</exception>
60 /// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
61 public void AddSafeBag (Pkcs12SafeBag safeBag) {
62 throw new PlatformNotSupportedException ();
65 /// <summary>Adds an ASN.1 BER-encoded value with a specified type identifier to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12SecretBag" /> and returns the newly created bag instance.</summary>
66 /// <param name="secretType">The Object Identifier (OID) which identifies the data type of the secret value.</param>
67 /// <param name="secretValue">The BER-encoded value representing the secret to add.</param>
68 /// <returns>The bag instance which was added to the SafeContents.</returns>
69 /// <exception cref="T:System.ArgumentNullException">The <paramref name="secretType" /> parameter is <see langword="null" />.</exception>
70 /// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
71 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="secretValue" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
72 public Pkcs12SecretBag AddSecret (Oid secretType, ReadOnlyMemory<byte> secretValue) {
73 throw new PlatformNotSupportedException ();
76 /// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a byte-based password in an array and returns the newly created bag instance.</summary>
77 /// <param name="key">The asymmetric private key to add.</param>
78 /// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
79 /// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
80 /// <returns>The bag instance which was added to the SafeContents.</returns>
81 /// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
82 /// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
83 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
84 public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, byte[] passwordBytes, PbeParameters pbeParameters) {
85 throw new PlatformNotSupportedException ();
88 /// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a byte-based password in a span and returns the newly created bag instance.</summary>
89 /// <param name="key">The asymmetric private key to add.</param>
90 /// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
91 /// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
92 /// <returns>The bag instance which was added to the SafeContents.</returns>
93 /// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
94 /// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
95 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
96 public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) {
97 throw new PlatformNotSupportedException ();
100 /// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a character-based password in a span and returns the newly created bag instance.</summary>
101 /// <param name="key">The asymmetric private key to add.</param>
102 /// <param name="password">The password to use when encrypting the key material.</param>
103 /// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
104 /// <returns>The bag instance which was added to the SafeContents.</returns>
105 /// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
106 /// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
107 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
108 public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, ReadOnlySpan<char> password, PbeParameters pbeParameters) {
109 throw new PlatformNotSupportedException ();
112 /// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a character-based password in a string and returns the newly created bag instance.</summary>
113 /// <param name="key">The asymmetric private key to add.</param>
114 /// <param name="password">The password to use when encrypting the key material.</param>
115 /// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
116 /// <returns>The bag instance which was added to the SafeContents.</returns>
117 /// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
118 /// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
119 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
120 public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, string password, PbeParameters pbeParameters) {
121 throw new PlatformNotSupportedException ();
124 /// <summary>Decrypts the contents of this SafeContents value using a byte-based password from an array.</summary>
125 /// <param name="passwordBytes">The bytes to use as a password for decrypting the encrypted contents.</param>
126 /// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
127 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
128 /// -or-
129 /// The contents were not successfully decrypted.</exception>
130 public void Decrypt (byte[] passwordBytes) {
131 throw new PlatformNotSupportedException ();
134 /// <summary>Decrypts the contents of this SafeContents value using a byte-based password from a span.</summary>
135 /// <param name="passwordBytes">The bytes to use as a password for decrypting the encrypted contents.</param>
136 /// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
137 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
138 /// -or-
139 /// The contents were not successfully decrypted.</exception>
140 public void Decrypt (ReadOnlySpan<byte> passwordBytes) {
141 throw new PlatformNotSupportedException ();
144 /// <summary>Decrypts the contents of this SafeContents value using a character-based password from a span.</summary>
145 /// <param name="password">The password to use for decrypting the encrypted contents.</param>
146 /// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
147 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
148 /// -or-
149 /// The contents were not successfully decrypted.</exception>
150 public void Decrypt (ReadOnlySpan<char> password) {
151 throw new PlatformNotSupportedException ();
154 /// <summary>Decrypts the contents of this SafeContents value using a character-based password from a string.</summary>
155 /// <param name="password">The password to use for decrypting the encrypted contents.</param>
156 /// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
157 /// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
158 /// -or-
159 /// The contents were not successfully decrypted.</exception>
160 public void Decrypt (string password) {
161 throw new PlatformNotSupportedException ();
164 /// <summary>Gets an enumerable representation of the SafeBag values contained within the SafeContents.</summary>
165 /// <returns>An enumerable representation of the SafeBag values contained within the SafeContents.</returns>
166 /// <exception cref="T:System.InvalidOperationException">The contents are encrypted.</exception>
167 public IEnumerable<Pkcs12SafeBag> GetBags () {
168 throw new PlatformNotSupportedException ();