UnlockWithExternalKey method of the Win32_EncryptableVolume class

The UnlockWithExternalKey method of the Win32_EncryptableVolume class uses a provided external key to access the contents of a data volume.

The volume's encryption key must have been secured with one or more key protectors of the type "External Key" using the ProtectKeyWithExternalKey method to be able to unlock the volume with this method.

Note

If the disc supports hardware encryption this function sets the band status to "unlocked""

 

Syntax

uint32 UnlockWithExternalKey(
  [in] uint8 ExternalKey[]
);

Parameters

ExternalKey [in]

Type: uint8[]

An array of bytes that specifies the 256-bit external key used to unlock the volume. This key can be obtained by calling the GetExternalKeyFromFile method.

Return value

Type: uint32

This method returns one of the following codes or another error code if it fails.

If the volume is already unlocked, this method returns 0.

Return code/value Description
S_OK
0 (0x0)
The method was successful.
ERROR_NOT_FOUND
No value given (0x)
The volume does not have a key protector of the type "External Key".
ERROR_INVALID_PASSWORD
No value given (0x)
One or more key protectors of the type "External Key" exist, but the specified ExternalKey parameter cannot unlock the volume.
E_INVALIDARG
2147942487 (0x80070057)
The ExternalKey parameter is not an array of size 4.
FVE_E_NOT_ACTIVATED
2150694920 (0x80310008)
BitLocker is not enabled on the volume. Add a key protector to enable BitLocker.

 

Remarks

Managed Object Format (MOF) files contain the definitions for Windows Management Instrumentation (WMI) classes. MOF files are not installed as part of the Windows SDK. They are installed on the server when you add the associated role by using the Server Manager. For more information about MOF files, see Managed Object Format (MOF).

Requirements

Requirement Value
Minimum supported client
Windows Vista Enterprise, Windows Vista Ultimate [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Namespace
Root\CIMV2\Security\MicrosoftVolumeEncryption
MOF
Win32_encryptablevolume.mof

See also

Win32_EncryptableVolume