#include <QtCrypto>
Collaboration diagram for QCA::KeyBundle:
Public Member Functions | |
KeyBundle () | |
KeyBundle (const QString &fileName, const SecureArray &passphrase=SecureArray()) | |
KeyBundle (const KeyBundle &from) | |
KeyBundle & | operator= (const KeyBundle &from) |
bool | isNull () const |
QString | name () const |
CertificateChain | certificateChain () const |
PrivateKey | privateKey () const |
void | setName (const QString &s) |
void | setCertificateChainAndKey (const CertificateChain &c, const PrivateKey &key) |
QByteArray | toArray (const SecureArray &passphrase, const QString &provider=QString()) const |
bool | toFile (const QString &fileName, const SecureArray &passphrase, const QString &provider=QString()) const |
Static Public Member Functions | |
static KeyBundle | fromArray (const QByteArray &a, const SecureArray &passphrase=SecureArray(), ConvertResult *result=0, const QString &provider=QString()) |
static KeyBundle | fromFile (const QString &fileName, const SecureArray &passphrase=SecureArray(), ConvertResult *result=0, const QString &provider=QString()) |
KeyBundle is essentially a convience class that holds a certificate chain and an associated private key. This class has a number of methods that make it particularly suitable for accessing a PKCS12 (.p12) format file, however it can be used as just a container for a Certificate, its associated PrivateKey and optionally additional X.509 Certificate that form a chain.
For more information on PKCS12 "Personal Information Exchange Syntax Standard", see ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12v1.pdf.
|
Create an empty KeyBundle.
|
|
Create a KeyBundle from a PKCS12 (.p12) encoded file. This constructor requires appropriate plugin (provider) support. You must check for the "pkcs12" feature before using this constructor.
|
|
Standard copy constructor.
|
|
Standard assignment operator.
|
|
Test if this key is empty (null).
|
|
The name associated with this key. This is also known as the "friendly name", and if present, is typically suitable to be displayed to the user.
|
|
The public certificate part of this bundle.
|
|
The private key part of this bundle.
|
|
Specify the name of this bundle.
|
|
Set the public certificate and private key.
|
|
Export the key bundle to an array in PKCS12 format. This method requires appropriate plugin (provider) support - you must check for the "pkcs12" feature, as shown below.
if( QCA::isSupported("pkcs12") ) { // can use I/O byteArray = bundle.toArray( "pass phrase" ); } else { // not possible to use I/O }
|
|
Export the key bundle to a file in PKCS12 (.p12) format. This method requires appropriate plugin (provider) support - you must check for the "pkcs12" feature, as shown below.
if( QCA::isSupported("pkcs12") ) { // can use I/O bool result = bundle.toFile( filename, "pass phrase" ); } else { // not possible to use I/O }
|
|
Import the key bundle from an array in PKCS12 format. This method requires appropriate plugin (provider) support - you must check for the "pkcs12" feature, as shown below.
if( QCA::isSupported("pkcs12") ) { // can use I/O bundle = QCA::KeyBundle::fromArray( array, "pass phrase" ); } else { // not possible to use I/O }
|
|
Import the key bundle from a file in PKCS12 (.p12) format. This method requires appropriate plugin (provider) support - you must check for the "pkcs12" feature, as shown below.
if( QCA::isSupported("pkcs12") ) { // can use I/O bundle = QCA::KeyBundle::fromFile( filename, "pass phrase" ); } else { // not possible to use I/O }
|