CPBEncryptSet Class Reference
class CPBEncryptSet : public CPBEncryptElement |
Derived class to allow the efficient password based encryption and decryption of multiple elements.
This is useful if one wants random access to an encrypted source consisting of multiple independent elements, for example, a database or a store.
Since it is unreasonable to force the decryption of an entire set to allow access to just a tiny portion of it, and since it is too costly to derive separate keys for each element within the set, a single randomly generated master key is used. This master key is encrypted with the password provided by the user of the class. Known plaintext attacks against the ciphertext are prevented by using a randomly chosen Initialisation Vector (IV) for each element.
Contains the master encryption key.
See the Cryptography api-guide documentation for more information and sample code.
Inherited Functions |
---|
| CBase::CBase() |
| CBase::Delete(CBase *) |
| CBase::Extension_(TUint,TAny *&,TAny *) |
| CBase::operator new(TUint) |
| CBase::operator new(TUint,TAny *) |
| CBase::operator new(TUint,TLeave) |
| CBase::operator new(TUint,TLeave,TUint) |
| CBase::operator new(TUint,TUint) |
| CBase::~CBase() |
| CPBEncryptElement::AuthenticateL(const TPBPassword &) |
| CPBEncryptElement::CPBEncryptElement(void) |
| CPBEncryptElement::ConstructL(const CPBEncryptionData &,const TPBPassword &) |
| CPBEncryptElement::EncryptionData(void)const |
| CPBEncryptElement::MakeEncryptKeyL(TUint,const TDesC8 &) |
| CPBEncryptElement::NewL(const CPBEncryptionData &,const TPBPassword &) |
| CPBEncryptElement::NewLC(const CPBEncryptionData &,const TPBPassword &) |
| CPBEncryptElement::~CPBEncryptElement(void) |
Constructor & Destructor Documentation
CPBEncryptSet(void)
CPBEncryptSet | ( | void | | ) | [protected] |
CPBEncryptSet(const CPBEncryptSet &)
~CPBEncryptSet(void)
~CPBEncryptSet | ( | void | | ) | [virtual] |
Member Functions Documentation
ChangePasswordL(const TPBPassword &)
IMPORT_C void | ChangePasswordL | ( | const TPBPassword & | aNewPassword | ) | |
Re-encrypts the master key with the specified new password.
ConstructL(const TDesC8 &)
void | ConstructL | ( | const TDesC8 & | aPassword | ) | [protected] |
ConstructL(const TDesC8 &, TPBECipher)
ConstructL(const TDesC8 &, const CPBEncryptParms &)
ConstructL(const CPBEncryptionData &, const TDesC8 &, const TPBPassword &)
ConstructMasterKeyL(void)
void | ConstructMasterKeyL | ( | void | | ) | [protected] |
DecryptMasterKeyL(TDes8 &)
void | DecryptMasterKeyL | ( | TDes8 & | aMasterKey | ) | const [protected] |
EncryptMasterKeyL(const TDesC8 &)
void | EncryptMasterKeyL | ( | const TDesC8 & | aMasterKey | ) | [protected] |
EncryptedMasterKey(void)
IMPORT_C const TDesC8 & | EncryptedMasterKey | ( | void | | ) | const |
Gets the encrypted form of the master key.
This must be stored along with the object returned by CPBEncryptElement::EncryptionData() in order for the object to be reconstructed with the same state at some time in the future. Failure to do so will result in the permanent loss of any information encrypted with this object.
MaxCiphertextLength(TInt)
TInt
| MaxCiphertextLength | ( | TInt | aPlaintextLength | ) | const [virtual] |
Gets the maximum output ciphertext length given a specified input plaintext length.
Parameters
TInt aPlaintextLength | The plaintext length |
MaxPlaintextLength(TInt)
TInt
| MaxPlaintextLength | ( | TInt | aCiphertextLength | ) | const [virtual] |
Gets the maximum output plaintext length given a specified input ciphertext length.
Parameters
TInt aCiphertextLength | The ciphertext length |
NewDecryptL(void)
Constructs a CPBDecryptor object based on the state of this object (i.e., the cipher and master key) allowing the decryption of data.
NewDecryptLC(void)
Constructs a CPBDecryptor object based on the state of this object (i.e., the cipher and master key) allowing the decryption of data.
NewEncryptL(void)
Constructs a CPBEncryptor object based on the state of this object (i.e., the cipher and master key) allowing the encryption of data.
NewEncryptLC(void)
Constructs a CPBEncryptor object based on the state of this object (i.e., the cipher and master key) allowing the encryption of data.
NewL(const TPBPassword &)
Creates a new CPBEncryptSet object for encryption of new data (and generates an encrypted master key).
If strong cryptography is present, a 128 bit AES cipher is used; otherwise, for weak cryptography, a 56 bit DES cipher is used.
The symmetric key is derived from the password and a random salt using TPKCS5KDF::DeriveKeyL().
NewL(const TPBPassword &, TPBECipher)
Creates a new CPBEncryptSet object for encryption of new data (and generates an encrypted master key).
The symmetric key is derived from the password and a random salt using TPKCS5KDF::DeriveKeyL().
NewL(const TPBPassword &, const CPBEncryptParms &)
Creates a new CPBEncryptSet object for encryption of new data (and generates an encrypted master key).
The symmetric key is derived from the password using TPKCS5KDF::DeriveKeyL().
Parameters
const TPBPassword & aPassword | The user supplied password |
const CPBEncryptParms & aParms | An encryption parameter object comprising the cipher, salt, IV, and iteration count value. |
NewL(const CPBEncryptionData &, const TDesC8 &, const TPBPassword &)
Creates a new CPBEncryptSet object for encryption of new data (and generates an encrypted master key).
If the specified password is valid, the function regenerates the encryption key; otherwise, it leaves with KErrBadPassphrase.
-
leave
- KErrBadPassphrase If the specified password is incorrect
Parameters
const CPBEncryptionData & aData | The encryption data object to copy |
const TDesC8 & aEncryptedMasterKey | On return, the encrypted master key |
const TPBPassword & aPassword | The user supplied password |
NewLC(const TPBPassword &)
Creates a new CPBEncryptSet object for encryption of new data (and generates an encrypted master key).
The returned pointer is put onto the cleanup stack.
If strong cryptography is present, a 128 bit AES cipher is used; otherwise, for weak cryptography, a 56 bit DES cipher is used.
The symmetric key is derived from the password and a random salt using TPKCS5KDF::DeriveKeyL().
Parameters
const TPBPassword & aPassword | The user supplied password |
NewLC(const TPBPassword &, TPBECipher)
Creates a new CPBEncryptSet object for encryption of new data (and generates an encrypted master key).
The returned pointer is put onto the cleanup stack.
The symmetric key is derived from the password and a random salt using TPKCS5KDF::DeriveKeyL().
NewLC(const TPBPassword &, const CPBEncryptParms &)
Creates a new CPBEncryptSet object for encryption of new data (and generates an encrypted master key).
The returned pointer is put onto the cleanup stack.
The symmetric key is derived from the password using TPKCS5KDF::DeriveKeyL().
Parameters
const TPBPassword & aPassword | The user supplied password |
const CPBEncryptParms & aParms | An encryption parameter object comprising the cipher, salt, IV, and iteration count value. |
NewLC(const CPBEncryptionData &, const TDesC8 &, const TPBPassword &)
Creates a new CPBEncryptSet object for encryption of new data (and generates an encrypted master key).
The returned pointer is put onto the cleanup stack.
If the specified password is valid, the function regenerates the encryption key; otherwise, it leaves with KErrBadPassphrase.
-
leave
- KErrBadPassphrase If the specified password is incorrect
Parameters
const CPBEncryptionData & aData | The encryption data object to copy |
const TDesC8 & aEncryptedMasterKey | On return, the encrypted master key |
const TPBPassword & aPassword | The user supplied password |
operator=(const CPBEncryptSet &)
Member Data Documentation
HBufC8 * iEncryptedMasterKey
HBufC8 * | iEncryptedMasterKey | [protected] |
The derived encrypted master key
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.