From 04fdacc22feba4eedf14c76b0a9c408ec1ee1bdf Mon Sep 17 00:00:00 2001 From: Johann-S Date: Sat, 2 Apr 2022 19:31:58 +0200 Subject: [PATCH] feat(http): add set client auth mode method (#4100) Co-authored-by: Johann SERVOIRE --- .../plugins/http/index.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/@awesome-cordova-plugins/plugins/http/index.ts b/src/@awesome-cordova-plugins/plugins/http/index.ts index e0e3cc38e..dc9bc4800 100644 --- a/src/@awesome-cordova-plugins/plugins/http/index.ts +++ b/src/@awesome-cordova-plugins/plugins/http/index.ts @@ -237,6 +237,26 @@ export class HTTP extends AwesomeCordovaNativePlugin { return; } + /** + * Configure X.509 client certificate authentication. Takes mode and options. mode being one of following values: + * none: disable client certificate authentication + * systemstore (only on Android): use client certificate installed in the Android system store; user will be presented with a list of all installed certificates + * buffer: use given client certificate; you will need to provide an options object + * + * @see https://github.com/silkimen/cordova-plugin-advanced-http#setclientauthmode + * @param {string} mode auth mode + * @param {object} options useful for buffer mode + * @param {ArrayBuffer} options.rawPkcs ArrayBuffer containing raw PKCS12 container with client certificate and private key + * @param {string} options.pkcsPassword password of the PKCS container + */ + @Cordova() + setClientAuthMode( + mode: 'none' | 'systemstore ' | 'buffer', + options?: { rawPkcs: ArrayBuffer; pkcsPassword: string } + ): Promise { + return; + } + /** * Make a POST request *