me.lightspeed7.mongofs.crypto.Crypto Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongoFS Show documentation
Show all versions of mongoFS Show documentation
An extension to the MongoDB Java Driver library that goes beyond what the GridFS feature supports.
Compressed file storage, zip files, temporary files
package me.lightspeed7.mongofs.crypto;
import java.security.GeneralSecurityException;
import me.lightspeed7.mongofs.util.ChunkSize;
public interface Crypto {
/**
* The size of the buffer of data to encrypt
*
* NOTE : This value must be <= the chunkSize for the collection to keep the system performant.
*
* @return the ChunkSize
*/
ChunkSize getChunkSize();
/**
* Return the given bytes in their encrypted form
*
* @param dataIn
* @param offset
* @param length
* @return the encrypted bytes
* @throws GeneralSecurityException
*/
byte[] encrypt(byte[] dataIn, int offset, int length) throws GeneralSecurityException;
/**
* Return the given encrypted bytes back in their original form
*
* @param dataIn
* @param offset
* @param length
* @return the un-encrypted bytes
* @throws GeneralSecurityException
*/
byte[] decrypt(byte[] dataIn, int offset, int length) throws GeneralSecurityException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy