Interface Decrypter<DEC,ENC,EXC extends DecryptionException>
- Type Parameters:
DEC- The type of the decrypted data.ENC- The type of the encrypted data.EXC- The specific type of theDecryptionExceptionbeing thrown.
- All Superinterfaces:
org.refcodes.mixin.Disposable
- All Known Subinterfaces:
Crypter<ENC,DEC, ENCEXC, DECEXC>
- All Known Implementing Classes:
PasswordTextDecrypter
public interface Decrypter<DEC,ENC,EXC extends DecryptionException>
extends org.refcodes.mixin.Disposable
Plain interface for providing straight forward decryption functionality as of
toDecrypted(Object) and for forcing your plain functionality to
provide a bridge to the Java Cryptographic Extension (JCE) framework's
CipherSpi as of toDecrypted(byte[], int, int, byte[], int).
This way you can use your algorithms outside the JCE framework. This may be
necessary when your Java's security settings prevent running your own JCE
extensions from inside an (Oracle-) unsigned JAR.-
Method Summary
Modifier and TypeMethodDescriptiondefault intdecrypt(byte[] aBuffer) This method decrypts the provided buffer.default intdecrypt(byte[] aBuffer, int aOffset, int aLength) This method decrypts the provided buffer beginning at the given offset and the given number of bytes.inttoDecrypted(byte[] aBuffer, int aOffset, int aLength, byte[] aOutBuffer, int aOutOffset) For compatibility with the java.security framework, ehttps://www.metacodes.proly to be integrated in a sub-class of theCipherSpi.toDecrypted(ENC aInput) You pass in data of a given type and you get decrypted data of (another) given type.Methods inherited from interface org.refcodes.mixin.Disposable
dispose
-
Method Details
-
toDecrypted
-
toDecrypted
int toDecrypted(byte[] aBuffer, int aOffset, int aLength, byte[] aOutBuffer, int aOutOffset) throws DecryptionException For compatibility with the java.security framework, ehttps://www.metacodes.proly to be integrated in a sub-class of theCipherSpi.- Parameters:
aBuffer- The input to be decrypted.aOffset- The offset to start decryption.aLength- The length to be decryptedaOutBuffer- The output where to decrypt to.aOutOffset- The offset where to start writing the decrypted output.- Returns:
- The number of bytes decrypted.
- Throws:
DecryptionException- Thrown in case a decryption issue occurred regarding theDecrypter. Probably the configuration of yourEncrypterdoes not fit the one of theDecrypter.ArrayIndexOutOfBoundsException- In case you provided lengths and offsets not fitting with the provided arrays.
-
decrypt
This method decrypts the provided buffer beginning at the given offset and the given number of bytes.- Parameters:
aBuffer- The input to be decrypted.aOffset- The offset to start decryption.aLength- The length to be decrypted- Returns:
- The number of bytes decrypted.
- Throws:
DecryptionException- Thrown in case a decryption issue occurred regarding theDecrypter. Probably the configuration of yourEncrypterdoes not fit the one of theDecrypter.ArrayIndexOutOfBoundsException- In case you provided lengths and offsets not fitting with the provided arrays.
-
decrypt
This method decrypts the provided buffer.- Parameters:
aBuffer- The input to be decrypted.- Returns:
- The number of bytes decrypted.
- Throws:
DecryptionException- Thrown in case a decryption issue occurred regarding theDecrypter. Probably the configuration of yourEncrypterdoes not fit the one of theDecrypter.ArrayIndexOutOfBoundsException- In case you provided lengths and offsets not fitting with the provided arrays.
-