CryptoSys PKI Pro Manual

Cms.MakeEnvDataFromString Method (String, String, String, CipherAlgorithm, Cms.KeyEncrAlgorithm, HashAlgorithm, Cms.EnvDataOptions, Kdf.KdfAlg, Kdf.KeyWrapAlg, String, Int32, Cms.ContentEncrAlg)

Create a CMS enveloped-data object from an ASCII string (advanced options).

Syntax

[C#]
public static int MakeEnvDataFromString(
	string outputFile,
	string inputData,
	string certList,
	CipherAlgorithm cipherAlg,
	Cms.KeyEncrAlgorithm keyEncrAlg,
	HashAlgorithm hashAlg,
	Cms.EnvDataOptions advOptions,
	Kdf.KdfAlg kdfAlg,
	Kdf.KeyWrapAlg keyWrapAlg,
	string keyString,
	int count,
	Cms.ContentEncrAlg contEncrAlg
)
[VB.NET]
Public Shared Function MakeEnvDataFromString ( _
	outputFile As String, _
	inputData As String, _
	certList As String, _
	cipherAlg As CipherAlgorithm, _
	keyEncrAlg As Cms.KeyEncrAlgorithm, _
	hashAlg As HashAlgorithm, _
	advOptions As Cms.EnvDataOptions, _
	kdfAlg As Kdf.KdfAlg, _
	keyWrapAlg As Kdf.KeyWrapAlg, _
	keyString As String, _
	count As Integer, _
	contEncrAlg As Cms.ContentEncrAlg _
) As Integer

Parameters

outputFile
Output file to be created
inputData
Input data string, expected plain ASCII text.
certList
List of recipient X.509 certificate filename(s), separated by semi-colons (;). Alternatively, specify a single PKCS#7 certificate chain file (.p7c/.p7b).

Special cases: Set as "type=@pwri" to create a single recipientInfo of the PasswordRecipientInfo type (pwri); or set as "type=@kekri,keyid=<string>" to create a single recipientInfo of the KEKRecipientInfo type (kekri). See Remarks.

cipherAlg
Type: CipherAlgorithm
Content encryption algorithm [default=Triple DES]. Deprecated: use contEncrAlg.
keyEncrAlg
Type: Cms.KeyEncrAlgorithm
Key encryption algorithm [default=rsaEncryption)]
hashAlg
Type: HashAlgorithm
Hash function for RSAES-OAEP or ECDH KDF or PBKDF2 for pwri, if required. Must be one of the SHA-* family [default=SHA-1]
advOptions
Type: Cms.EnvDataOptions
Advanced options. See Cms.EnvDataOptions.
kdfAlg
Type: Kdf.KdfAlg
Key derivation function (KDF) for ECDH key agreement scheme (where applicable)
keyWrapAlg
Type: Kdf.KeyWrapAlg
Key wrap algorithm for ECDH key agreement scheme (default=match content encryption algorithm)
keyString
(formerly ukmString) Use to pass optional additional user key material (ukm) for KDF where KeyAgreement (kari) type is used. Or use to pass the password for a pwri type or the key encryption key (KEK) for a kekri type. Either pass a plain ASCII string, e.g. "abc" or use the format "#x<hex-digits>" to pass a string of arbitrary octet values, e.g. "#xdeadbeef01" to pass the 5 bytes 0xde,0xad,0xbe,0xef,0x01. Optional for kari types but required for pwri and kekri types.
count
Optional iteration count for KDF in pwri type (default=4096) or tag length for AuthEnvelopedData (in range 12-16, default=16). Otherwise ignored.
contEncrAlg
Type: Cms.ContentEncrAlg
Alternative way to specify content encryption algorithm with more options. Takes precedence over cipherAlg.

Return Value

Number of successful recipients or negative error code

Remarks

See remarks for MakeEnvData(String, String, String, CipherAlgorithm, Cms.KeyEncrAlgorithm, HashAlgorithm, Cms.EnvDataOptions, Kdf.KdfAlg, Kdf.KeyWrapAlg, String, Int32, Cms.ContentEncrAlg)

See Also

VB6/C equivalent: CMS_MakeEnvDataFromString

[Contents] [Index]

[PREV: Cms.MakeEnvDataFromString Method (String, String, String, CipherAlgorithm, Cms.EnvDataOptions)...]   [Contents]   [Index]   
   [NEXT: Cms.MakeSigData Method (String, String, String, String, Cms.SigAlg, Cms.SigDataOptions)...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.