@@ -201,16 +201,30 @@ private void registerServices() {
201201 }
202202
203203 /* KeyGenerator */
204- put ("KeyGenerator.AES" ,
205- "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcAESKeyGenerator" );
206- put ("KeyGenerator.HmacSHA1" ,
207- "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcHMACSha1KeyGenerator" );
208- put ("KeyGenerator.HmacSHA256" ,
209- "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcHMACSha256KeyGenerator" );
210- put ("KeyGenerator.HmacSHA384" ,
211- "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcHMACSha384KeyGenerator" );
212- put ("KeyGenerator.HmacSHA512" ,
213- "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcHMACSha512KeyGenerator" );
204+ if (FeatureDetect .AesEnabled ()) {
205+ put ("KeyGenerator.AES" ,
206+ "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcAESKeyGenerator" );
207+ }
208+ if (FeatureDetect .HmacShaEnabled ()) {
209+ put ("KeyGenerator.HmacSHA1" ,
210+ "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcHMACSha1KeyGenerator" );
211+ }
212+ if (FeatureDetect .HmacSha224Enabled ()) {
213+ put ("KeyGenerator.HmacSHA224" ,
214+ "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcHMACSha224KeyGenerator" );
215+ }
216+ if (FeatureDetect .HmacSha256Enabled ()) {
217+ put ("KeyGenerator.HmacSHA256" ,
218+ "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcHMACSha256KeyGenerator" );
219+ }
220+ if (FeatureDetect .HmacSha384Enabled ()) {
221+ put ("KeyGenerator.HmacSHA384" ,
222+ "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcHMACSha384KeyGenerator" );
223+ }
224+ if (FeatureDetect .HmacSha512Enabled ()) {
225+ put ("KeyGenerator.HmacSHA512" ,
226+ "com.wolfssl.provider.jce.WolfCryptKeyGenerator$wcHMACSha512KeyGenerator" );
227+ }
214228
215229 /* KeyPairGenerator */
216230 if (FeatureDetect .RsaKeyGenEnabled ()) {
0 commit comments