#include <uapkirsakeypair.h>

List of all members.

Public Member Functions

 UaPkiRsaKeyPair ()
 UaPkiRsaKeyPair (int bits)
 ~UaPkiRsaKeyPair ()
 UaPkiRsaKeyPair (const UaPkiRsaKeyPair &copy)
UaPkiPrivateKey privateKey () const
UaPkiPublicKey publicKey () const
int toPEMFile (const char *szFileName, const char *szPassword) const
UaByteArray toDER () const

Static Public Member Functions

static UaPkiRsaKeyPair fromPEMFile (const char *szFileName, const char *szPassword, fcnPassword_callback *pCallback=0, void *pCBData=0)

Detailed Description

UaPkiRsaKeyPair


Constructor & Destructor Documentation

UaPkiRsaKeyPair::UaPkiRsaKeyPair (  )

Constructs an empty keypair.

UaPkiRsaKeyPair::UaPkiRsaKeyPair ( int  bits )

Constructs a keypair with given key size.

Parameters:
bitsRSA modulus (key size) which should be 1024, 2048 or 4096.
UaPkiRsaKeyPair::~UaPkiRsaKeyPair (  )

destruction

UaPkiRsaKeyPair::UaPkiRsaKeyPair ( const UaPkiRsaKeyPair copy )

construction

Parameters:
copyan existing UaPkiRsaKeyPair structure.

Member Function Documentation

UaPkiRsaKeyPair UaPkiRsaKeyPair::fromPEMFile ( const char *  szFileName,
const char *  szPassword,
fcnPassword_callback *  pCallback = 0,
void *  pCBData = 0 
) [static]

Loads a keypair from a PEM encoded file.

Returns:
The new key pair. If the file could not be loaded the returnd keypair will be empty. Use isValid() to check this.
Parameters:
[in]szFileNameThe filename locale 8bit encoded.
[in]szPasswordSpecify the password of the PEM file, or 0 if the file is not protected.
[in]pCallbackA callback handle
[out]pCBDataThe data from the PEM file
UaPkiPrivateKey UaPkiRsaKeyPair::privateKey (  ) const

Returns the private key part of this key pair.

UaPkiPublicKey UaPkiRsaKeyPair::publicKey (  ) const

Returns the public key part of this key pair.

UaByteArray UaPkiRsaKeyPair::toDER (  ) const

Converts the key pair to DER format.

Returns:
DER encoded byte array.
int UaPkiRsaKeyPair::toPEMFile ( const char *  szFileName,
const char *  szPassword 
) const

Stores the keypair into a PEM encoded file.

Returns:
This functions returns zero on success.
Parameters:
[in]szFileNameThe filename locale 8bit encoded.
[in]szPasswordSpecify a password to protect the PEM file, or 0 if the file should be unprotected.

The documentation for this class was generated from the following files:
  • /home/buildbot/work/uasdkcpp/src/uabase/uapkicpp/uapkirsakeypair.h
  • /home/buildbot/work/uasdkcpp/src/uabase/uapkicpp/uapkirsakeypair.cpp