I have seen a lot of examples where you can use SMIME to encrypt and email but there is not examples to encrypt a regular file. I have a method where I insert the keys in a bd but I don't know how to use SMIME by bouncycastle to encrypt a file.
public CifradoDeArchivos obtenerCifradoDeArchivosParticular(
ParametrizacionCifradoArchivosBancos parametrizacionCifradoArchivosBancos) {
CifradoDeArchivos newInstance = null;
try {
// Se realiza la introspección
Class<?> clazz = Class
.forName(parametrizacionCifradoArchivosBancos
.getClaseImplementacion());
Constructor<?> clazzConstructor = clazz.getConstructor();
newInstance = (CifradoDeArchivos) clazzConstructor
.newInstance();
} catch (NoClassDefFoundError e) {
logger.info(e.getMessage());
}
return newInstance;
}