Class: CertificateFromStore

sap.AuthProxy# CertificateFromStore

new CertificateFromStore(CertificateKeyopt)

Create a certificate source description object for certificates from the system keystore. You might want to use a certificate from the system keystore if you know the user's device will have the desired certificate installed on it.
On Android, sending a request with a certificate from the system store results in UI being shown for the user to pick the certificate to use (the certificate with the alias matching the given CertificateKey is pre-selected). If the user selects a certificate with an alias that does not match the given CertificateKey, then (as long as that request succeededs) that certificate will be used for all subsequent requests with the same CertificateFromStore object until the app restarts. When the app restarts, if the same CertificateFromStore object is used, the Android UI will be displayed again (since it is attempting to get a certificate with a matching alias). If the CertificateKey parameter is not specified, whatever certificate the user selects will be reused without showing the Android UI, even across app restarts.
Parameters:
Name Type Attributes Description
CertificateKey string <optional>
A unique key (aka: alias) that is used to locate the certificate.
Example
// Create the certificate source description object.
var systemCert = new sap.AuthProxy.CertificateFromStore("certificatekey");
// callbacks
var successCB = function(serverResponse){
    alert("Status: " + JSON.stringify(serverResponse.status));
    alert("Headers: " + JSON.stringify(serverResponse.headers));
    alert("Response: " + JSON.stringify(serverResponse.response));
}
var errorCB = function(errorObject){
    alert("Error making request: " + JSON.stringify(errorObject));
}
// Make the request with the certificate source description object.
sap.AuthProxy.sendRequest("POST", "https://hostname", headers, "THIS IS THE BODY", successCB, errorCB, null, null, 0, systemCert);