Framework EDI Reference. Methods and Properties
ediSecurities. DefaultKeyContainer

Set or gets the default Cryptographic Service Provider (CSP) key container.

Syntax:

<sKeyContainer> = object.DefaultKeyContainer
object.DefaultKeyContainer = <sKeyContainer>

Remarks

The key container name assigned here must already exist in the default service provider name already determined.  If the key container does not exist then an error is generated.  To assign all parameters of the default CSP, use the SetDefaultCSP method.

Some methods or objects may require an optional key container for operation, but if none is specified then the methods or objects will use the key container name set here as default.

Example:

Dim oEdiDoc As Fredi.ediDocument
Dim oSecurities As Fredi.ediSecurities
Dim sSessKeyFile As String

' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument

' Get the securities object
Set oSecurities = oEdiDoc.GetSecurities

' Set Cryptographic Service Provider default.
oSecurities.DefaultProviderName = "Microsoft Enhanced Cryptographic Provider v1.0"

' Set the default key container.
' Key container must exist in the specified default provider database.
oSecurities.DefaultKeyContainer = "FrameworkEDI_Secure_Context_00"

MsgBox "Default key container is '" & oSecurities.DefaultKeyContainer & "'."

Sample

P_DefaultKeyContainer.zip