npm install --save @webex/plugin-encryption
In addition to the module consumption via NPMJS, this module can also be consumed via our CDN. See the below examples of how to consume this via CDN:
<html>
<head>
<!-- via unpkg -->
<script crossorigin src="https://unpkg.com/webex@latest/umd/encryption.min.js"></script>
<!-- via jsdelivr -->
<script crossorigin src="https://cdn.jsdelivr.net/npm/webex/umd/encryption.min.js"></script>
</head>
<!-- ...application html... -->
</html>
This is a plugin for the Cisco Webex JS SDK. Please see our developer portal and the API reference for full details.
import Webex from '@webex/plugin-encryption';
const webex = Webex.init({
credentials: {
access_token
}
});
webex.once('ready', () => {
webex.cypher.register().then(async () => {
try {
const attachmentURL = 'https:/myfileurl.xyz/zzz/fileid?keyUri=somekeyuri&JWE=somejwe';
const options = {
useFileService: false,
jwe: somejwe, // Provide the JWE here if not already present in the attachmentURL
keyUri: someKeyUri, // Provide the keyURI here if not already present in the attachmentURL
};
const decryptedFileBuf = await webex.cypher.downloadAndDecryptFile(attachmentURL, options);
// Do something with the decrypted file buffer
} catch (error) {
// Handle error
}
}).catch((err) => {
// Handle error
});
});
webex.cypher.deregister().then(() => {
// Do deregistration at your App's teardown
});
To use webpack-dev-server
to load this package, run yarn run samples:serve
.
Files placed in the docs/samples/plugin-encryption
folder will be served statically.
Files in the src/@webex/plugin-encryption
folder will be compiled, bundled, and served as a static asset at encryption.js
inside that directory.
This package is maintained by Cisco Webex for Developers.
Pull requests welcome. Please see CONTRIBUTING.md for more details.
This project is licensed under the Cisco General Terms - see the LICENSE for details.
© 2016-2025 Cisco and/or its affiliates. All Rights Reserved.