17
17
#pragma once
18
18
19
19
#include < PowerAuth/PublicTypes.h>
20
+ #include < cc7/crypto/KeyPair.h>
20
21
21
22
/*
22
23
The ECIES.h header file contains a set of interfaces prepared for ECIES data
@@ -207,11 +208,11 @@ namespace powerAuth
207
208
// / Creates a new instance of ECIESEnvelopeKey from EC |publiKey| and optional |shared_info1|.
208
209
// / For optional |shared_info1| you can provide an empty range, if you have no such information available.
209
210
// / The method also stores a newly created ephemeral public key to the |out_ephemeralKey| reference.
210
- static ECIESEnvelopeKey fromPublicKey (const cc7::ByteRange & public_key, const cc7::ByteRange & shared_info1, cc7::ByteArray & out_ephemeral_key);
211
+ static ECIESEnvelopeKey fromPublicKey (const cc7::crypto::PublicKeyPtr & public_key, const cc7::ByteRange & shared_info1, cc7::ByteArray & out_ephemeral_key);
211
212
212
213
// / Creates a new instance of ECIESEnvelopeKey from EC |privateKey|, |ephemeralKey| key-pair and optional |shared_info1|.
213
214
// / For optional |shared_info1| you can provide an empty range, if you have no such information available.
214
- static ECIESEnvelopeKey fromPrivateKey (const cc7::ByteArray & private_key, const cc7::ByteRange & ephemeral_key, const cc7::ByteRange & shared_info1);
215
+ static ECIESEnvelopeKey fromPrivateKey (const cc7::crypto::PrivateKeyPtr & private_key, const cc7::ByteRange & ephemeral_key, const cc7::ByteRange & shared_info1);
215
216
216
217
public:
217
218
@@ -247,7 +248,7 @@ namespace powerAuth
247
248
// / Constructs an ecnryptor with server's |public_key| and optional |shared_info1| and |shared_info2|.
248
249
// / For both optional parameters you can provide an empty range, if you have no such information available.
249
250
// / The constructed instance can be used for both encryption and decryption tasks.
250
- ECIESEncryptor (const cc7::ByteRange & public_key, const cc7::ByteRange & shared_info1, const cc7::ByteRange & shared_info2);
251
+ ECIESEncryptor (const cc7::crypto::PublicKeyPtr & public_key, const cc7::ByteRange & shared_info1, const cc7::ByteRange & shared_info2);
251
252
252
253
// / Constructs an encryptor with previously calculated |envelope_key| and optional |shared_info2|.
253
254
// / For optional |shared_info2| you can provide an empty range, if you have no such information available.
@@ -256,7 +257,7 @@ namespace powerAuth
256
257
257
258
258
259
// / Returns a reference to public key.
259
- const cc7::ByteArray & publicKey () const ;
260
+ const cc7::crypto::PublicKeyPtr & publicKey () const ;
260
261
261
262
// / Returns a reference to envelope key.
262
263
const ECIESEnvelopeKey & envelopeKey () const ;
@@ -305,7 +306,7 @@ namespace powerAuth
305
306
private:
306
307
307
308
// / A data for public key.
308
- cc7::ByteArray _public_key;
309
+ cc7::crypto::PublicKeyPtr _public_key;
309
310
// / Content of shared info1 optional parameter.
310
311
cc7::ByteArray _shared_info1;
311
312
// / Content of shared info2 optional parameter.
@@ -326,14 +327,14 @@ namespace powerAuth
326
327
327
328
// / Constructs a decryptor with a server's |private_key| and optional |shared_info1| and |shared_info2|.
328
329
// / The constructed instance can be used for both decryption & encryption tasks.
329
- ECIESDecryptor (const cc7::ByteArray & private_key, const cc7::ByteRange & shared_info1, const cc7::ByteRange & shared_info2);
330
+ ECIESDecryptor (const cc7::crypto::PrivateKeyPtr & private_key, const cc7::ByteRange & shared_info1, const cc7::ByteRange & shared_info2);
330
331
331
332
// / Constructs a decryptor with previously calculated |envelope_key| and optional |shared_info2|.
332
333
// / The constructed instance can be used only for encryption taks.
333
334
ECIESDecryptor (const ECIESEnvelopeKey & envelope_key, const cc7::ByteRange & shared_info2);
334
335
335
336
// / Returns a reference to internal public key.
336
- const cc7::ByteArray & privateKey () const ;
337
+ const cc7::crypto::PrivateKeyPtr & privateKey () const ;
337
338
338
339
// / Returns a reference to internal envelope key.
339
340
const ECIESEnvelopeKey & envelopeKey () const ;
@@ -381,7 +382,7 @@ namespace powerAuth
381
382
382
383
private:
383
384
// / A data for private key.
384
- cc7::ByteArray _private_key;
385
+ cc7::crypto::PrivateKeyPtr _private_key;
385
386
// / Content of shared info1 optional parameter.
386
387
cc7::ByteArray _shared_info1;
387
388
// / Content of shared info2 optional parameter.
0 commit comments