diff options
Diffstat (limited to 'src/Encryption/NoEncryption.js')
-rw-r--r-- | src/Encryption/NoEncryption.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Encryption/NoEncryption.js b/src/Encryption/NoEncryption.js index 42077d1..37d7780 100644 --- a/src/Encryption/NoEncryption.js +++ b/src/Encryption/NoEncryption.js @@ -1,7 +1,13 @@ export default class NoEncryption { /** - * + * @param {BasicClassLoader} classLoader + */ + constructor(classLoader) { + this._classLoader = classLoader; + } + + /** * @returns {Promise<Boolean>} */ async ready() { @@ -9,10 +15,9 @@ export default class NoEncryption { } /** - * * @returns {Boolean} */ - async enabled() { + enabled() { return true; } @@ -37,7 +42,7 @@ export default class NoEncryption { * @returns {Object} */ async decrypt(object, type) { - if(object.cseType !== 'none') throw new Error('Unsupported encryption type'); + if(object.cseType !== 'none') throw this._classLoader.getClass('exception.encryption.unsupported', object, 'none'); return object; } }
\ No newline at end of file |