interface sap.ui.vk.DecryptionHandler

Visiblity: public
Available since: N/A
Module: sap/ui/vk/ContentConnector
Application Component: CA-UI5-VTK

Contract for objects that implement decryption.

An interface for an object provided by an application to decrypt content of encrypted models.

Content is encrypted with the AES128 algorithm in the CBC mode.

A key is derived with the PBKDF2 algorithm by applying the HMAC -SHA256 function 10,000 times.

A sample implementation and usage of the sap.ui.vk.DecryptionHandler interface with the asmCrypto library:

...
<script src="https://cdnjs.cloudflare.com/ajax/libs/asmCrypto/0.16.4/asmcrypto.js"></script>
...
var decryptionHandler = {
    deriveKey: function(salt, password) {
        try {
            return asmCrypto.PBKDF2_HMAC_SHA256.bytes(password, salt, 10000, 16);
        } catch (ex) {
            return null;
        }
    },
    decrypt: function(key, iv, input) {
        try {
            return asmCrypto.AES_CBC.decrypt(input, key, true, iv);
        } catch (ex) {
            return null;
        }
    }
};
...
var viewer = new sap.ui.vk.Viewer();
viewer.setDecryptionHandler(decryptionHandler);
var contentResource = new sap.ui.vk.ContentResource({
    source: "http://my-web-server.com/my-encrypted-model.vds",
    sourceType: "vds",
    sourceId: "abc",
    password: "abracadabra"
});
viewer.addContentResource(contentResource);


Events Overview

Event Description