# Managed Object - CryptoManager(vim.encryption.CryptoManager)

Property of
  HostConfigManager, ServiceContent
Extended by
  CryptoManagerHost, CryptoManagerKmip
See also
  CryptoKeyId, CryptoKeyPlain, CryptoKeyResult
Since
  vSphere API 6.5

## Managed Object Description

Singleton Managed Object used to manage cryptographic keys.

Properties

Name | Type | Description
--- | --- | ---
enabled | xsd:boolean | Indicate if the encryption feature is enabled.

Methods

Methods defined in this Managed Object
AddKey, AddKeys, ListKeys, RemoveKey, RemoveKeys

# AddKey(addKey)

Add an existing key.

Required Privileges
  Cryptographer.ManageKeys

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CryptoManager used to make the method call.
key P | CryptoKeyPlain | [in] The cryptographic key to add. Since vSphere API 6.5

P Required privilege: key

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
AlreadyExists | in case the key is already in the key cache
InvalidState | in case the host is not Crypto Safe
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="AddKey" type="sms:AddKeyRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="AddKeyResponse"> <complexType/> </element>

# AddKeys(addKeys)

Add multiple existing keys.

Required Privileges
  Cryptographer.ManageKeys

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CryptoManager used to make the method call.
keys* P | CryptoKeyPlain[] | [in] List of cryptographic keys to add. Since vSphere API 6.5

*Need not be set P Required privilege: keys

Return Value

Type | Description
--- | ---
CryptoKeyResult[] | The result for each key operation.

Faults

Type | Description
--- | ---
InvalidState | in case the host is not Crypto Safe
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="AddKeys" type="sms:AddKeysRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="AddKeysResponse"> <complexType> <sequence> <element name="returnval" type="sms:CryptoKeyResult" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>

# ListKeys(listKeys)

List keys. * When executed against the host, lists all the keys added to the host's key cache by AddKey/AddKeys. * When executed against the VC, lists all the keys used by the correctly registered VMs, and the host key.

Required Privileges
  Cryptographer.ManageKeys

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CryptoManager used to make the method call.
limit* P | xsd:int | [in] maximum keys to return. Since vSphere API 6.5

*Need not be set P Required privilege: limit

Return Value

Type | Description
--- | ---
CryptoKeyId[] | List of known keys.

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="ListKeys" type="sms:ListKeysRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="ListKeysResponse"> <complexType> <sequence> <element name="returnval" type="sms:CryptoKeyId" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>

# RemoveKey(removeKey)

Remove a key (only the UUID is needed to remove). If "force" is set, removal will happen even if the key is in use.

Required Privileges
  Cryptographer.ManageKeys

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CryptoManager used to make the method call.
key P | CryptoKeyId | [in] The key to remove. Since vSphere API 6.5
force P | xsd:boolean | [in] Remove the key even if in use or not existent. Since vSphere API 6.5

P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
ResourceInUse | Thrown if the key is used to encrypt any object and "force" is false.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="RemoveKey" type="sms:RemoveKeyRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="RemoveKeyResponse"> <complexType/> </element>

# RemoveKeys(removeKeys)

Remove multiple keys (only the UUID is needed to remove). If "force" is set, removal will happen even if they are in use.

Required Privileges
  Cryptographer.ManageKeys

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CryptoManager used to make the method call.
keys* P | CryptoKeyId[] | [in] List of keys to remove. Since vSphere API 6.5
force P | xsd:boolean | [in] Remove the key even if in use. Always successful. Since vSphere API 6.5

*Need not be set P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
CryptoKeyResult[] |

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="RemoveKeys" type="sms:RemoveKeysRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sms="urn:sms" name="RemoveKeysResponse"> <complexType> <sequence> <element name="returnval" type="sms:CryptoKeyResult" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>