JCE: add support for SecureRandom.getInstance("DEFAULT"), maps to HashDRBG
parent
430b8b7503
commit
45deb2802f
|
@ -34,6 +34,7 @@ The JCE provider currently supports the following algorithms:
|
|||
SHA-512
|
||||
|
||||
SecureRandom Class
|
||||
DEFAULT (maps to HashDRBG)
|
||||
HashDRBG
|
||||
|
||||
Cipher Class
|
||||
|
|
|
@ -65,6 +65,8 @@ public final class WolfCryptProvider extends Provider {
|
|||
/* SecureRandom */
|
||||
/* TODO: May need to add "SHA1PRNG" alias, other JCA consumemrs may
|
||||
* explicitly request it? Needs more testing. */
|
||||
put("SecureRandom.DEFAULT",
|
||||
"com.wolfssl.provider.jce.WolfCryptRandom");
|
||||
put("SecureRandom.HashDRBG",
|
||||
"com.wolfssl.provider.jce.WolfCryptRandom");
|
||||
|
||||
|
|
|
@ -57,7 +57,13 @@ public class WolfCryptRandomTest {
|
|||
public void testGetRandomFromProvider()
|
||||
throws NoSuchProviderException, NoSuchAlgorithmException {
|
||||
|
||||
SecureRandom rand = SecureRandom.getInstance("HashDRBG", "wolfJCE");
|
||||
SecureRandom rand = null;
|
||||
|
||||
/* HashDRBG */
|
||||
rand = SecureRandom.getInstance("HashDRBG", "wolfJCE");
|
||||
|
||||
/* DEFAULT */
|
||||
rand = SecureRandom.getInstance("DEFAULT", "wolfJCE");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue