using System; using System.Security.Cryptography; namespace System.Security.Cryptography.Pkcs { /// Defines the core behavior of a SafeBag value from the PKCS#12 specification and provides a base for derived classes. public abstract class Pkcs12SafeBag { /// Gets the modifiable collection of attributes to encode with the SafeBag value. /// The modifiable collection of attributes to encode with the SafeBag value. public CryptographicAttributeObjectCollection Attributes { get { throw new PlatformNotSupportedException (); } } /// Gets the ASN.1 BER encoding of the contents of this SafeBag. /// The ASN.1 BER encoding of the contents of this SafeBag. public ReadOnlyMemory EncodedBagValue { get { throw new PlatformNotSupportedException (); } } /// Called from constructors in derived classes to initialize the class. /// The Object Identifier (OID), in dotted decimal form, indicating the data type of this SafeBag. /// The ASN.1 BER encoded value of the SafeBag contents. /// /// to store without making a defensive copy; otherwise, . The default is . /// The parameter is or the empty string. /// The parameter does not represent a single ASN.1 BER-encoded value. protected Pkcs12SafeBag (string bagIdValue, ReadOnlyMemory encodedBagValue, bool skipCopy = false) { throw new PlatformNotSupportedException (); } /// Encodes the SafeBag value and returns it as a byte array. /// A byte array representing the encoded form of the SafeBag. /// The object identifier value passed to the constructor was invalid. public byte[] Encode () { throw new PlatformNotSupportedException (); } /// Gets the Object Identifier (OID) identifying the content type of this SafeBag. /// The Object Identifier (OID) identifying the content type of this SafeBag. public Oid GetBagId () { throw new PlatformNotSupportedException (); } /// Attempts to encode the SafeBag value into a provided buffer. /// The byte span to receive the encoded SafeBag value. /// 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 object identifier value passed to the constructor was invalid. public bool TryEncode (Span destination, out int bytesWritten) { throw new PlatformNotSupportedException (); } } }