Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32base.h
Link against: euser.lib

Class CSecurityBase

CSecurityBase

Support

Supported from 5.0

Description

A base class defining the interface to the security model.

This class, together with the derived class, CBoundedSecurityBase, defines a set of pure virtual functions which must be implemented by a class derived from CBoundedSecurityBase.

The interface defines:

Derivation

CBaseBase class for all classes to be instantiated on the heap
CSecurityBaseA base class defining the interface to the security model

Defined in CSecurityBase:
IsEnabled(), NewDecryptL(), NewEncryptL(), PrepareL(), SecurityData(), SetEnabledL(), SetL()

Inherited from CBase:
operator new()


Factory functions creating encryption and decryption objects


NewEncryptL()

virtual CSecurityEncryptBase* NewEncryptL(const TDesC8& aInit) const = 0;

Description

A factory function for constructing an encryption handling object. An encryption handling object is one which implements the interface defined by the CSecurityEncryptBase abstract class.

As a minimum, this function should construct and return a pointer to an object suitably derived from CSecurityEncryptBase.

Parameters

const TDesC8& aInit

Initialisation vector data. The meaning applied to this data depends on the encryption process.

Return value

CSecurityEncryptBase*

A pointer to a new encryption object


NewDecryptL()

virtual CSecurityDecryptBase* NewDecryptL(const TDesC8& aInit) const = 0;

Description

A factory function for constructing a decryption handling object. A decryption handling object is one which implements the interface defined by the CSecurityDecryptBase abstract class.

As a minimum, this function should construct and return a pointer to an object suitably derived from CSecurityDecryptBase.

Parameters

const TDesC8& aInit

Initialisation vector data. The meaning applied to this data depends on the decryption process.

Return value

CSecurityDecryptBase*

A pointer to a new decryption object

[Top]


Password handling implementation


IsEnabled()

virtual TInt IsEnabled() const = 0;

Description

Determines whether password checking is enabled. The function implements the behaviour required of a call to Password::IsEnabled().

A derived class must provide a concrete implementation for this function. It should return a true or false value based on whether password checking has been enabled or not.

Return value

TInt

True, if password checking has been enabled, false otherwise


SetEnabledL()

virtual void SetEnabledL(const TDesC& aPassword,TBool aIsEnabled) = 0;

Description

Sets the password enabled state. The function implements the behaviour required of a call to Password::SetEnabled().

A derived class must provide a concrete implementation for this function. It should set the password checking enabled state, i.e. password checking is enabled or disabled according to the value of aIsEnabled. The password aPassword should be the currently valid password.

Parameters

const TDesC& aPassword

The currently valid password

TBool aIsEnabled

ETrue, if password checking is to be enabled EFalse, if password checking is to be disabled.


PrepareL()

virtual void PrepareL(const TDesC& aPassword) = 0;

Description

Validates the specified password. The function implements the behaviour required of a call to Password::IsValid().

A derived class must provide a concrete implementation for this function. As a minimum, the password should be checked to ensure that it is the currently valid password. If the password is invalid, then the function must leave.

The function can also be used to prepare for decryption by making a decryption key from the password. The meaning of this is entirely dependent on the encryption scheme.

Parameters

const TDesC& aPassword

The password to be validated.


SetL()

virtual void SetL(const TDesC& aOldPassword,const TDesC& aNewPassword);

Description

Changes the password. The function implements the behaviour required of a call to Password::Set().

A derived class must provide a concrete implementation for this function. As a minimum, the function should replace the existing password aOldPassword with the a new password aNewPassword. If the existing password is invalid, then the function must leave.

Parameters

const TDesC& aOldPassword

The existing password

const TDesC& aNewPassword

The new password

[Top]


Access security data


SecurityData()

virtual TPtrC8 SecurityData() const = 0;

Description

Gives access to security data.

A derived class must provide a concrete implementation for this function. It should provide access to security data through a descriptor pointer. The meaning applied to security data depends on the security model.

Return value

TPtrC8

A pointer descriptor to the security data held by the security model