Pkcs12SafeContents.AddSecret(Oid, ReadOnlyMemory<Byte>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds an ASN.1 BER-encoded value with a specified type identifier to the SafeContents via a new Pkcs12SecretBag and returns the newly created bag instance.
public:
System::Security::Cryptography::Pkcs::Pkcs12SecretBag ^ AddSecret(System::Security::Cryptography::Oid ^ secretType, ReadOnlyMemory<System::Byte> secretValue);
public System.Security.Cryptography.Pkcs.Pkcs12SecretBag AddSecret (System.Security.Cryptography.Oid secretType, ReadOnlyMemory<byte> secretValue);
member this.AddSecret : System.Security.Cryptography.Oid * ReadOnlyMemory<byte> -> System.Security.Cryptography.Pkcs.Pkcs12SecretBag
Public Function AddSecret (secretType As Oid, secretValue As ReadOnlyMemory(Of Byte)) As Pkcs12SecretBag
Parameters
- secretType
- Oid
The Object Identifier (OID) which identifies the data type of the secret value.
- secretValue
- ReadOnlyMemory<Byte>
The BER-encoded value representing the secret to add.
Returns
The bag instance which was added to the SafeContents.
Exceptions
The secretType
parameter is null
.
This instance is read-only.
The secretValue
parameter does not represent a single ASN.1 BER-encoded value.