8285263: Minor cleanup could be done in java.security

Reviewed-by: weijun
This commit is contained in:
Mark Powers 2022-06-13 15:13:56 +00:00 committed by Weijun Wang
parent b97a4f6cdc
commit 17695962ac
94 changed files with 480 additions and 601 deletions

View file

@ -25,15 +25,13 @@
package java.security;
import java.io.*;
import java.util.Locale;
import javax.crypto.spec.SecretKeySpec;
import java.io.NotSerializableException;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.security.spec.InvalidKeySpecException;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.SecretKeySpec;
import java.util.Locale;
/**
* Standardized representation for serialized Key objects.
@ -65,7 +63,7 @@ public class KeyRep implements Serializable {
*
* @since 1.5
*/
public static enum Type {
public enum Type {
/** Type for secret keys. */
SECRET,
@ -87,28 +85,28 @@ public class KeyRep implements Serializable {
*
* @serial
*/
private Type type;
private final Type type;
/**
* The Key algorithm
*
* @serial
*/
private String algorithm;
private final String algorithm;
/**
* The Key encoding format
*
* @serial
*/
private String format;
private final String format;
/**
* The encoded Key bytes
*
* @serial
*/
private byte[] encoded;
private final byte[] encoded;
/**
* Construct the alternate Key class.