com.github.isaichkindanila.crypt.lib.stream.UnsupportedCipherException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of crypt-lib Show documentation
Show all versions of crypt-lib Show documentation
Simple Java library for stream ciphers based encryption
package com.github.isaichkindanila.crypt.lib.stream;
import com.github.isaichkindanila.crypt.lib.cipher.StandardStreamCipher;
/**
* Thrown when ID of stream cipher stored in stream header does not match
* any of the supported stream ciphers.
* This can happen if encrypted stream is corrupted or if it was encrypted
* with stream cipher not supported by this version of Crypt Lib.
*/
@SuppressWarnings("WeakerAccess")
public class UnsupportedCipherException extends RuntimeException {
UnsupportedCipherException(int index) {
super(String.format(
"expected cipher id: [0..%d], actual: %d",
StandardStreamCipher.values().length - 1, index
));
}
}