Skip to content

Commit

Permalink
update: CMSEncryptionServiceImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
AssahBismarkabah committed Aug 12, 2024
1 parent 843063c commit f4e1e21
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@
public class CMSEncryptionServiceImpl implements CMSEncryptionService {

private ASNCmsEncryptionConfig encryptionConfig;
private SecureRandom secureRandom;

@Inject
public CMSEncryptionServiceImpl(ASNCmsEncryptionConfig encryptionConfig) {
this.encryptionConfig = encryptionConfig;
this.secureRandom = new SecureRandom();
}

/**
Expand Down Expand Up @@ -146,7 +148,7 @@ private OutputStream streamEncrypt(OutputStream dataContentStream, Set<Recipient

return generator.open(
dataContentStream,
new JceCMSContentEncryptorBuilder(algorithm).setProvider(GeneratorModule_ProviderFactory.provider()).setSecureRandom(new SecureRandom()).build()
new JceCMSContentEncryptorBuilder(algorithm).setProvider(GeneratorModule_ProviderFactory.provider()).setSecureRandom( this.secureRandom).build()
);
}
}

0 comments on commit f4e1e21

Please sign in to comment.