Creates a copy of private and public key, and parameter objects.
#include "hupkc.h"
int hu_KeyPairDuplicate(sb_GlobalCtx srcCtx, sb_Params srcParams, sb_PrivateKey srcPriv, sb_PublicKey srcPub, sb_GlobalCtx dstCtx, sb_RngCtx dstRng, sb_YieldCtx dstYield, sb_Params *dstParams, sb_PrivateKey *dstPriv, sb_PublicKey *dstPub)
BlackBerry 10.0.0
The global context associated with srcParams, srcPriv and srcPub.
The parameters object associated with srcCtx, srcPriv and srcPub.
The private key object associated with srcCtx, srcParams and srcPub.
The public key object associated with srcCtx, srcParams and srcPriv.
The global context associated with dstParams, dstPriv and dstPub.
The RNG context to add to dstParams.
The yield context to add to dstParams.
The parameters object pointer associated with dstCtx, dstPriv and dstPub.
The private key object pointer associated with dstCtx, dstParams and dstPub.
The public key object pointer associated with dstCtx, dstParams and dstPriv.
The new key and parameter objects will be thread-safe handles to the same underlying key, and permit the keys to be used in multiple threads.
The dstCtx must be compatible with srcCtx which means it should have been created by calling hu_GlobalCtxCopyCrypto() or by other means where the result is indistinguishable from having called hu_GlobalCtxCopyCrypto().
The srcParams must be present, however srcPriv is needed only when dstPriv is to be created. Similarly for srcPub and dstPub. The dstParams must be non-null since it always needs to be created.
The dstParams will not have the sb_RngCtx (if any) that srcParams has because the sb_RngCtx is not thread safe and that would make the dstParams not thread safe. If the dstParams is required to have a sb_RngCtx, it must be explicitly provided. Similarly for a sb_YieldCtx.