
net.sf.mmm.crypto.crypt.AbstractDecryptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mmm-crypto-jce Show documentation
Show all versions of mmm-crypto-jce Show documentation
Library for simple and more secure usage of cryptography (JCA and JCE).
The newest version!
package net.sf.mmm.crypto.crypt;
import java.io.InputStream;
/**
* Abstract implementation of {@link Decryptor}.
*
* @author Joerg Hohwiller (hohwille at users.sourceforge.net)
* @since 1.0.0
*/
public interface AbstractDecryptor extends Decryptor {
@Override
default InputStream wrapStream(InputStream stream) {
return new CryptorInputStream(this, stream);
}
@Override
default Decryptor combine(Decryptor... decryptors) {
if ((decryptors == null) || (decryptors.length == 0)) {
return this;
}
Decryptor[] decryptorChain = new Decryptor[decryptors.length + 1];
System.arraycopy(decryptors, 0, decryptorChain, 1, decryptors.length);
decryptorChain[0] = this;
return new DecryptorImplCombined(decryptorChain);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy