CPBEncryptElement Class Reference
class CPBEncryptElement : public CPBEncryptionBase
|
Allows the password based encryption and decryption of elements. Contains the encryption key and its associated encryption data. See the Cryptography api-guide documentation for more information and sample code.
Constructor & Destructor Documentation
CPBEncryptElement(void)
CPBEncryptElement
|
(
|
void
|
|
)
|
[protected]
|
CPBEncryptElement(const CPBEncryptElement &)
~CPBEncryptElement(void)
~CPBEncryptElement
|
(
|
void
|
|
)
|
[virtual]
|
Member Functions Documentation
AuthenticateL(const TPBPassword &)
ConstructL(const TDesC8 &)
void
|
ConstructL
|
(
|
const
TDesC8
&
|
aPassword
|
)
|
[protected]
|
ConstructL(const TDesC8 &, const TPBECipher)
void
|
ConstructL
|
(
|
const
TDesC8
&
|
aPassword,
|
|
const
TPBECipher
|
aCipher
|
|
)
|
[protected]
|
Parameters
const
TDesC8
& aPassword
|
|
const
TPBECipher
aCipher
|
|
ConstructL(const TDesC8 &, const CPBEncryptParms &)
ConstructL(const CPBEncryptionData &, const TPBPassword &)
EncryptionData(void)
Gets the parameters allowing one to re-create the object with the same state at another point in the future.
In order to decrypt any information previously encrypted with this object, you
must
store this encryption data along with it. Failure to do this will result in the permanent loss of the encrypted information.
MakeEncryptKeyL(TUint, const TDesC8 &)
void
|
MakeEncryptKeyL
|
(
|
TUint
|
aKeySize,
|
|
const
TDesC8
&
|
aPassword
|
|
)
|
[protected]
|
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 allowing the decryption of data.
NewDecryptLC(void)
Constructs a
CPBDecryptor
object allowing the decryption of data.
NewEncryptL(void)
Constructs a
CPBEncryptor
object allowing the encryption of data.
NewEncryptLC(void)
Constructs a
CPBEncryptor
object allowing the encryption of data.
NewL(const TPBPassword &)
Creates a new
CPBEncryptElement
object for encryption of new data.
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
|
NewL(const TPBPassword &, TPBECipher)
Parameters
const
TPBPassword
& aPassword
|
The user supplied password
|
TPBECipher
aCipher
|
The cipher to use
|
NewL(const TPBPassword &, const CPBEncryptParms &)
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 TPBPassword &)
Creates a new
CPBEncryptElement
object for decryption of existing data.
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
NewLC(const TPBPassword &)
Creates a new
CPBEncryptElement
object for encryption of new data.
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()
.
A pointer to the returned object is put onto the cleanup stack.
Parameters
const
TPBPassword
& aPassword
|
The user supplied password
|
NewLC(const TPBPassword &, TPBECipher)
Creates a new
CPBEncryptElement
object for encryption of new data.
The symmetric key is derived from the password and a random salt using
TPKCS5KDF::DeriveKeyL()
.
A pointer to the returned object is put onto the cleanup stack.
Parameters
const
TPBPassword
& aPassword
|
The user supplied password
|
TPBECipher
aCipher
|
The cipher to use
|
NewLC(const TPBPassword &, const CPBEncryptParms &)
Creates a new
CPBEncryptElement
object for encryption of new data.
The symmetric key is derived from the password using
TPKCS5KDF::DeriveKeyL()
.
A pointer to the returned object is put onto the cleanup stack.
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 TPBPassword &)
Creates a new
CPBEncryptElement
object for decryption of existing data.
If the specified password is valid, the function regenerates the encryption key; otherwise, it leaves with KErrBadPassphrase.
A pointer to the returned object is put onto the cleanup stack.
-
leave
-
KErrBadPassphrase If the specified password is incorrect
operator=(const CPBEncryptElement &)
Member Data Documentation
CPBEncryptionData * iData
HBufC8 * iEncryptKey
HBufC8
*
|
iEncryptKey
|
[protected]
|
The derived encryption 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.