MCTKeyStoreManager Class Reference

class MCTKeyStoreManager : public MCTKeyStore

Defines the interface for a key store manager token.

This documentation describes the security policy that must be enforced by implementations of the interface.

Inherits from

Member Functions Documentation

CancelCreateKey()

void CancelCreateKey ( ) [pure virtual]

Cancels an ongoing CreateKey() operation.

CancelDeleteKey()

void CancelDeleteKey ( ) [pure virtual]

Cancels an ongoing DeleteKey() operation.

CancelExportEncryptedKey()

void CancelExportEncryptedKey ( ) [pure virtual]

Cancels an ongoing ExportEncryptedKey() operation.

CancelExportKey()

void CancelExportKey ( ) [pure virtual]

Cancels an ongoing ExportKey() operation.

CancelImportEncryptedKey()

void CancelImportEncryptedKey ( ) [pure virtual]

Cancels an ongoing ImportEncryptedKey() operation.

CancelImportKey()

void CancelImportKey ( ) [pure virtual]

Cancels an ongoing ImportKey() operation.

CancelRelock()

void CancelRelock ( ) [pure virtual]

Cancels an ongoing Relock() operation.

CancelSetManagementPolicy()

void CancelSetManagementPolicy ( ) [pure virtual]

Cancels an ongoing SetManagementPolicy() operation.

CancelSetPassphraseTimeout()

void CancelSetPassphraseTimeout ( ) [pure virtual]

Cancels an ongoing SetPassphraseTimeout() operation.

CancelSetUsePolicy()

void CancelSetUsePolicy ( ) [pure virtual]

Cancels an ongoing SetUsePolicy() operation.

CreateKey(CCTKeyInfo *&, TRequestStatus &)

void CreateKey ( CCTKeyInfo *& aReturnedKey,
TRequestStatus & aStatus
) [pure virtual]

Key creation Generates a new key pair and store it in the keystore.

capability
WriteUserData Requires the caller to have WriteUserData capability
leave
KErrPermissionDenied If the caller does not have WriteUserData capability
leave
KErrAlreadyExists If a key with the specified label already exists in the keystore.
leave
KErrKeySize If the requested key size is not supported.
leave
KErrKeyAccess If an invalid combination of key access flags were specified.
leave
KErrKeyValidity If a validity period was specified, but the end date was in the past.

Parameters

CCTKeyInfo *& aReturnedKey This is filled by the caller with required attributes, leaving the TKeyIdentifier iID and object handle iHandle uninitialised - these values are set if the key is created successfully
TRequestStatus & aStatus This will be completed with the final status code

DeleteKey(TCTTokenObjectHandle, TRequestStatus &)

void DeleteKey ( TCTTokenObjectHandle aHandle,
TRequestStatus & aStatus
) [pure virtual]

Deletes a key.

capability
Dependent Requires the caller to have any capabilities specified in the key management security policy.
leave
KErrPermissionDenied If the caller does not conform to the key management security policy.
leave
KErrNotFound If the key the handle referes to does not exist.
leave
KErrAccessDenied If the calling process is not allowed to delete the key.
leave
KErrInUse If another client is currently using the key.

Parameters

TCTTokenObjectHandle aHandle The handle of the key to delete
TRequestStatus & aStatus

ExportEncryptedKey(TCTTokenObjectHandle, const CPBEncryptParms &, HBufC8 *&, TRequestStatus &)

void ExportEncryptedKey ( TCTTokenObjectHandle aHandle,
const CPBEncryptParms & aEncryptParams,
HBufC8 *& aKey,
TRequestStatus & aStatus
) [pure virtual]

Exports an encrypted key pair.

The key is exported as DER-encoded PKCS#5/PKCS#8 data.

capability
Dependent Requires the caller to have any capabilities specified in the key management security policy.
leave
KErrPermissionDenied If the caller does not conform to the key management security policy.
leave
KErrNotFound If the key the handle referes to does not exist.
leave
KErrKeyAccess If the exportable flag is not set for the key.
leave
KErrKeyAlgorithm If this type of key cannot be exported.

Parameters

TCTTokenObjectHandle aHandle The handle of the key to export
const CPBEncryptParms & aEncryptParams
HBufC8 *& aKey A reference to a HBufC8 pointer. The pointer will be set to a newly allocated buffer containing the key data.
TRequestStatus & aStatus

ExportKey(TCTTokenObjectHandle, HBufC8 *&, TRequestStatus &)

void ExportKey ( TCTTokenObjectHandle aHandle,
HBufC8 *& aKey,
TRequestStatus & aStatus
) [pure virtual]

Export keys Exports a key pair in the clear.

The key is exported as DER-encoded PKCS#8 data.

capability
Dependent Requires the caller to have any capabilities specified in the key management security policy.
leave
KErrPermissionDenied If the caller does not conform to the key management security policy.
leave
KErrNotFound If the key the handle referes to does not exist.
leave
KErrKeyAccess If the sensitive flag is set for the key, or the exportable flag is not set.
leave
KErrKeyAlgorithm If this type of key cannot be exported.

Parameters

TCTTokenObjectHandle aHandle The handle of the key to export
HBufC8 *& aKey A reference to a HBufC8 pointer. The pointer will be set to a newly allocated buffer containing the key data. It is the caller's responsibility to delete this buffer.
TRequestStatus & aStatus

ImportEncryptedKey(const TDesC8 &, CCTKeyInfo *&, TRequestStatus &)

void ImportEncryptedKey ( const TDesC8 & aKey,
CCTKeyInfo *& aReturnedKey,
TRequestStatus & aStatus
) [pure virtual]

Imports an encrypted key pair into the keystore.

The import data is DER-encoded PKCS#5/PKCS#8 format.

capability
WriteUserData Requires the caller to have WriteUserData capability
leave
KErrPermissionDenied If the caller does not have WriteUserData capability
leave
KErrAlreadyExists If a key with the specified label already exists in the keystore.
leave
KErrKeySize If the requested key size is not supported.
leave
KErrKeyAccess If an invalid combination of key access flags were specified.
leave
KErrKeyValidity If a validity period was specified, but the end date was in the past.
leave
KErrArgument If there is an error parsing the key data.

Parameters

const TDesC8 & aKey This is a descriptor representation of the PKCS#8 key data
CCTKeyInfo *& aReturnedKey This is filled by the caller with required attributes, leaving the TKeyIdentifier iID and object handle iHandle uninitialised - these values are set if the key is created successfully
TRequestStatus & aStatus

ImportKey(const TDesC8 &, CCTKeyInfo *&, TRequestStatus &)

void ImportKey ( const TDesC8 & aKey,
CCTKeyInfo *& aReturnedKey,
TRequestStatus & aStatus
) [pure virtual]

Import keys Imports a cleartext key pair into the keystore.

The import data is DER-encoded PKCS#8 format.

capability
WriteUserData Requires the caller to have WriteUserData capability
leave
KErrPermissionDenied If the caller does not have WriteUserData capability
leave
KErrAlreadyExists If a key with the specified label already exists in the keystore.
leave
KErrKeySize If the requested key size is not supported.
leave
KErrKeyAccess If an invalid combination of key access flags were specified.
leave
KErrKeyValidity If a validity period was specified, but the end date was in the past.
leave
KErrArgument If there is an error parsing the key data.

Parameters

const TDesC8 & aKey This is a descriptor representation of the PKCS#8 key data.
CCTKeyInfo *& aReturnedKey This is filled by the caller with required attributes, leaving the TKeyIdentifier iID and object handle iHandle uninitialised - these values are set if the key is created successfully.
TRequestStatus & aStatus

Relock(TRequestStatus &)

void Relock ( TRequestStatus & aStatus ) [pure virtual]

Re-locks the entire store (i.e., forget the pasphrase)

Parameters

TRequestStatus & aStatus This will be completed with the final status code

SetManagementPolicy(TCTTokenObjectHandle, const TSecurityPolicy &, TRequestStatus &)

void SetManagementPolicy ( TCTTokenObjectHandle aHandle,
const TSecurityPolicy & aPolicy,
TRequestStatus & aStatus
) [pure virtual]

Sets the security policy for key management.

Specifies which processes are allowed to perform management operations on the key.

capability
Dependent Requires the caller to have any capabilities specified in the current and new key management security policies.
leave
KErrPermissionDenied If the caller does not conform to the current and new key management security policies.
leave
KErrNotFound If the key the handle referes to does not exist.

Parameters

TCTTokenObjectHandle aHandle The handle of the key
const TSecurityPolicy & aPolicy The new security policy.
TRequestStatus & aStatus

SetPassphraseTimeout(TInt, TRequestStatus &)

void SetPassphraseTimeout ( TInt aTimeout,
TRequestStatus & aStatus
) [pure virtual]

Sets the passphrase timeout for all keys owned by this process.

capability
Dependent Requires the caller to have any capabilities specified in the key management security policy.
leave
KErrPermissionDenied If the caller does not conform to the key management security policy.
leave
KErrArgument If the timeout specified is invalid.

Parameters

TInt aTimeout The timeout in seconds. 0 means that the passphrase is always asked for, and -1 means that it is never expired
TRequestStatus & aStatus This will be completed with the final status code

SetUsePolicy(TCTTokenObjectHandle, const TSecurityPolicy &, TRequestStatus &)

void SetUsePolicy ( TCTTokenObjectHandle aHandle,
const TSecurityPolicy & aPolicy,
TRequestStatus & aStatus
) [pure virtual]

Sets the security policy for key use.

Specifies which processes are allowed to use the key for cryptographic operations.

capability
Dependent Requires the caller to have any capabilities specified in the key management security policy.
leave
KErrPermissionDenied If the caller does not conform to the key management security policy.
leave
KErrNotFound If the key the handle referes to does not exist.

Parameters

TCTTokenObjectHandle aHandle The handle of the key
const TSecurityPolicy & aPolicy The new security policy.
TRequestStatus & aStatus