#include <QtCrypto>
Inheritance diagram for QCA::SecureArray:
Public Member Functions | |
SecureArray () | |
SecureArray (int size, char ch=0) | |
SecureArray (const char *str) | |
SecureArray (const QByteArray &a) | |
SecureArray (const MemoryRegion &a) | |
SecureArray (const SecureArray &from) | |
SecureArray & | operator= (const SecureArray &from) |
SecureArray & | operator= (const QByteArray &a) |
void | clear () |
char & | operator[] (int index) |
const char & | operator[] (int index) const |
char * | data () |
const char * | data () const |
const char * | constData () const |
char & | at (int index) |
const char & | at (int index) const |
int | size () const |
bool | isEmpty () const |
bool | resize (int size) |
void | fill (char fillChar, int fillToPosition=-1) |
QByteArray | toByteArray () const |
SecureArray & | append (const SecureArray &a) |
bool | operator== (const MemoryRegion &other) const |
bool | operator!= (const MemoryRegion &other) const |
SecureArray & | operator+= (const SecureArray &a) |
Protected Member Functions | |
void | set (const SecureArray &from) |
void | set (const QByteArray &from) |
The SecureArray provides an array of memory from a pool that is, at least partly, secure. In this sense, secure means that the contents of the memory should not be made available to other applications. By comparison, a QMemArray (or subclass such as QCString or QByteArray) may be held in pages that might be swapped to disk or free'd without being cleared first.
Note that this class is implicitly shared (that is, copy on write).
|
Construct a secure byte array, zero length.
|
|
Construct a secure byte array of the specified length.
|
|
Construct a secure byte array from a string. Note that this copies, rather than references the source array |
|
Construct a secure byte array from a QByteArray. Note that this copies, rather than references the source array
|
|
Construct a secure byte array from a MemoryRegion. Note that this copies, rather than references the source array
|
|
Construct a (shallow) copy of another secure byte array.
|
|
Creates a reference, rather than a deep copy.
|
|
Creates a copy, rather than references.
Reimplemented from QCA::MemoryRegion. |
|
Clears the contents of the array and makes it empty.
|
|
Returns a reference to the byte at the index position.
|
|
Returns a reference to the byte at the index position.
|
|
Pointer to the data in the secure array. You can use this for memcpy and similar functions. If you are trying to obtain data at a particular offset, you might be better off using at() or operator[] Reimplemented from QCA::MemoryRegion.
|
|
Pointer to the data in the secure array. You can use this for memcpy and similar functions. If you are trying to obtain data at a particular offset, you might be better off using at() or operator[] Reimplemented from QCA::MemoryRegion. |
|
Pointer to the data in the secure array. You can use this for memcpy and similar functions. If you are trying to obtain data at a particular offset, you might be better off using at() or operator[] Reimplemented from QCA::MemoryRegion. |
|
Returns a reference to the byte at the index position.
Reimplemented from QCA::MemoryRegion. |
|
Returns a reference to the byte at the index position.
Reimplemented from QCA::MemoryRegion. |
|
Returns the number of bytes in the array.
Reimplemented from QCA::MemoryRegion.
|
|
Test if the array contains any bytes. This is equivalent to testing (size() != 0). Note that if the array is allocated, isEmpty() is false (even if no data has been added)
Reimplemented from QCA::MemoryRegion.
|
|
Change the length of this array If the new length is less than the old length, the extra information is (safely) discarded. If the new length is equal to or greater than the old length, the existing data is copied into the array.
Reimplemented from QCA::MemoryRegion. |
|
Fill the data array with a specified character.
|
|
Copy the contents of the secure array out to a standard QByteArray. Note that this performs a deep copy of the data. Reimplemented from QCA::MemoryRegion.
|
|
Append a secure byte array to the end of this array.
|
|
Equality operator. Returns true if both arrays have the same data (and the same length, of course). |
|
Inequality operator. Returns true if both arrays have different length, or the same length but different data. |
|
Append a secure byte array to the end of this array.
|
|
Assign the contents of a provided byte array to this object.
|
|
Assign the contents of a provided byte array to this object.
|