Partager via


ClusCryptoKeys.AddItem method

[The AddItem method is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

Adds a crypto key to a ClusCryptoKeys collection.

Syntax

ClusCryptoKeys.AddItem( _
  ByVal strName _
)

Parameters

strName

String identifying the cryptographic service provider (CSP) key container to be checkpointed. The CSP key container must first be created with the Cryptography API, and the keys in the container must be exportable. The string must specify the CSP provider type, provider name, and key container name using the following syntax.

Type\Name\Key

Note that the values must be separated by a '\'. The provider type should specify the decimal value of the type, not the constant that represents the value. For example, instead of "PROV_RSA_FULL" use "1". The provider name is optional, and if it is omitted, the default CSP provider name associated with the specified provider type will be used.

Return value

A string that receives the added key.

Remarks

For more information on the following points, see the Cryptography Reference.

  • A key container is given a name when it is created using CryptAcquireContext with dwFlags set to CRYPT_NEWKEYSET.
  • Once a key container has been created, the key pairs for that key container must be created using CryptGenKey with the dwFlags parameter set to CRYPT_EXPORTABLE. Note that some CSPs do not allow key exports from their key containers. If a key is not exportable then the ClusterResourceControl call will fail with an NTE_BAD_KEY error.

For more information on checkpoints, see Checkpointing.

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Header
MsClus.h
IDL
MsClus.idl
Type library
MsClus.tlb
DLL
MsClus.dll
IID
IID_ISClusCryptoKeys is defined as F2E6072C-2631-11D1-89F1-00A0C90D061E

See also

ClusCryptoKeys

ClusProperty