8267319: Use larger default key sizes and algorithms based on CNSA

Reviewed-by: weijun, xuelei
This commit is contained in:
Valerie Peng 2022-03-24 22:50:26 +00:00
parent c1048021fe
commit 313bc7f64f
29 changed files with 496 additions and 178 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,7 +34,7 @@ import java.util.Arrays;
import javax.crypto.KeyGeneratorSpi;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import sun.security.util.SecurityProviderConstants;
/**
* This class generates a AES key.
@ -46,7 +46,8 @@ import javax.crypto.spec.SecretKeySpec;
public final class AESKeyGenerator extends KeyGeneratorSpi {
private SecureRandom random = null;
private int keySize = 16; // default keysize (in number of bytes)
// default keysize (in number of bytes)
private int keySize = SecurityProviderConstants.getDefAESKeySize() >> 3;
/**
* Empty constructor.