[strongSwan-dev] using lib->creds->create for private key creation vs android_private_key_create

Ravi Kanth Vanapalli vvnrk.vanapalli at gmail.com
Wed Oct 19 21:48:45 CEST 2016


Hi,
   I am using EAP-TLS authentication.
   Tried to load the private key using the function below

METHOD(charonservice_t, get_user_key, private_key_t*,
private_charonservice_t *this, public_key_t *pubkey)
{
    private_key_t *key;
char path[512]="/system/etc/user1_private.der";
key = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
BUILD_FROM_FILE, path, BUILD_END);
if (!key) {
DBG1(DBG_DMN, "Parsing private key failed");
}
return key;
}


Is the call to this API equivalent to the call to the
API android_private_key_create() in file android_private_key.c

I understand that the second function gets the certificate via the JNI and
first function reads directly from the file.
The return type seems to the same, i.e private_key_t.

Can we treat these functions functionally equivalent ?
I am currently working in android and would like direct access to the
 private key file instead of reading from the JNI.

-- 
Regards,
RaviKanth VN Vanapalli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/dev/attachments/20161019/1adb8d56/attachment.html>


More information about the Dev mailing list