using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
namespace System.Security.Cryptography.Pkcs {
/// Represents a PKCS#12 SafeContents value. This class cannot be inherited.
public sealed class Pkcs12SafeContents {
/// Gets a value that indicates the type of encryption applied to the contents.
/// One of the enumeration values that indicates the type of encryption applied to the contents. The default value is .
public Pkcs12ConfidentialityMode ConfidentialityMode {
get {
throw new PlatformNotSupportedException ();
}
}
/// Gets a value that indicates whether this instance in a read-only state.
///
/// if this value is in a read-only state; otherwise, . The default value is .
public bool IsReadOnly {
get {
throw new PlatformNotSupportedException ();
}
}
/// Adds a certificate to the SafeContents via a new and returns the newly created bag instance.
/// The certificate to add.
/// The bag instance which was added to the SafeContents.
/// The parameter is .
/// This instance is read-only.
/// The parameter is in an invalid state.
public Pkcs12CertBag AddCertificate (X509Certificate2 certificate) {
throw new PlatformNotSupportedException ();
}
/// Adds an asymmetric private key to the SafeContents via a new and returns the newly created bag instance.
/// The asymmetric private key to add.
/// The bag instance which was added to the SafeContents.
/// The parameter is .
/// This instance is read-only.
/// The key export failed.
public Pkcs12KeyBag AddKeyUnencrypted (AsymmetricAlgorithm key) {
throw new PlatformNotSupportedException ();
}
/// Adds a nested SafeContents to the SafeContents via a new and returns the newly created bag instance.
/// The nested contents to add to the SafeContents.
/// The bag instance which was added to the SafeContents.
/// The parameter is .
/// The parameter is encrypted.
/// This instance is read-only.
public Pkcs12SafeContentsBag AddNestedContents (Pkcs12SafeContents safeContents) {
throw new PlatformNotSupportedException ();
}
/// Adds a SafeBag to the SafeContents.
/// The SafeBag value to add.
/// The parameter is .
/// This instance is read-only.
public void AddSafeBag (Pkcs12SafeBag safeBag) {
throw new PlatformNotSupportedException ();
}
/// Adds an ASN.1 BER-encoded value with a specified type identifier to the SafeContents via a new and returns the newly created bag instance.
/// The Object Identifier (OID) which identifies the data type of the secret value.
/// The BER-encoded value representing the secret to add.
/// The bag instance which was added to the SafeContents.
/// The parameter is .
/// This instance is read-only.
/// The parameter does not represent a single ASN.1 BER-encoded value.
public Pkcs12SecretBag AddSecret (Oid secretType, ReadOnlyMemory secretValue) {
throw new PlatformNotSupportedException ();
}
/// Adds an encrypted asymmetric private key to the SafeContents via a new from a byte-based password in an array and returns the newly created bag instance.
/// The asymmetric private key to add.
/// The bytes to use as a password when encrypting the key material.
/// The password-based encryption (PBE) parameters to use when encrypting the key material.
/// The bag instance which was added to the SafeContents.
/// The parameter is .
/// This instance is read-only.
/// The key export failed.
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, byte[] passwordBytes, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// Adds an encrypted asymmetric private key to the SafeContents via a new from a byte-based password in a span and returns the newly created bag instance.
/// The asymmetric private key to add.
/// The bytes to use as a password when encrypting the key material.
/// The password-based encryption (PBE) parameters to use when encrypting the key material.
/// The bag instance which was added to the SafeContents.
/// The parameter is .
/// This instance is read-only.
/// The key export failed.
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, ReadOnlySpan passwordBytes, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// Adds an encrypted asymmetric private key to the SafeContents via a new from a character-based password in a span and returns the newly created bag instance.
/// The asymmetric private key to add.
/// The password to use when encrypting the key material.
/// The password-based encryption (PBE) parameters to use when encrypting the key material.
/// The bag instance which was added to the SafeContents.
/// The parameter is .
/// This instance is read-only.
/// The key export failed.
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, ReadOnlySpan password, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// Adds an encrypted asymmetric private key to the SafeContents via a new from a character-based password in a string and returns the newly created bag instance.
/// The asymmetric private key to add.
/// The password to use when encrypting the key material.
/// The password-based encryption (PBE) parameters to use when encrypting the key material.
/// The bag instance which was added to the SafeContents.
/// The parameter is .
/// This instance is read-only.
/// The key export failed.
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, string password, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// Decrypts the contents of this SafeContents value using a byte-based password from an array.
/// The bytes to use as a password for decrypting the encrypted contents.
/// The property is not .
/// The password is incorrect.
/// -or-
/// The contents were not successfully decrypted.
public void Decrypt (byte[] passwordBytes) {
throw new PlatformNotSupportedException ();
}
/// Decrypts the contents of this SafeContents value using a byte-based password from a span.
/// The bytes to use as a password for decrypting the encrypted contents.
/// The property is not .
/// The password is incorrect.
/// -or-
/// The contents were not successfully decrypted.
public void Decrypt (ReadOnlySpan passwordBytes) {
throw new PlatformNotSupportedException ();
}
/// Decrypts the contents of this SafeContents value using a character-based password from a span.
/// The password to use for decrypting the encrypted contents.
/// The property is not .
/// The password is incorrect.
/// -or-
/// The contents were not successfully decrypted.
public void Decrypt (ReadOnlySpan password) {
throw new PlatformNotSupportedException ();
}
/// Decrypts the contents of this SafeContents value using a character-based password from a string.
/// The password to use for decrypting the encrypted contents.
/// The property is not .
/// The password is incorrect.
/// -or-
/// The contents were not successfully decrypted.
public void Decrypt (string password) {
throw new PlatformNotSupportedException ();
}
/// Gets an enumerable representation of the SafeBag values contained within the SafeContents.
/// An enumerable representation of the SafeBag values contained within the SafeContents.
/// The contents are encrypted.
public IEnumerable GetBags () {
throw new PlatformNotSupportedException ();
}
}
}