8264681: Use the blessed modifier order in java.security

Reviewed-by: mullan, shade
This commit is contained in:
Alex Blewitt 2021-04-14 06:01:00 +00:00 committed by Aleksey Shipilev
parent ea5c55a4ae
commit ebbce91e79
53 changed files with 160 additions and 160 deletions

View File

@ -56,7 +56,7 @@ public final class EncryptionKey implements SecretKey {
*
* @serial
*/
final private KeyImpl key;
private final KeyImpl key;
private transient boolean destroyed = false;

View File

@ -49,9 +49,9 @@ import java.util.Objects;
*/
public final class KerberosCredMessage implements Destroyable {
final private KerberosPrincipal sender;
final private KerberosPrincipal recipient;
final private byte[] message;
private final KerberosPrincipal sender;
private final KerberosPrincipal recipient;
private final byte[] message;
private boolean destroyed = false;

View File

@ -110,22 +110,22 @@ public final class ServicePermission extends Permission
/**
* Initiate a security context to the specified service
*/
private final static int INITIATE = 0x1;
private static final int INITIATE = 0x1;
/**
* Accept a security context
*/
private final static int ACCEPT = 0x2;
private static final int ACCEPT = 0x2;
/**
* All actions
*/
private final static int ALL = INITIATE|ACCEPT;
private static final int ALL = INITIATE|ACCEPT;
/**
* No actions.
*/
private final static int NONE = 0x0;
private static final int NONE = 0x0;
// the actions mask
private transient int mask;

View File

@ -93,7 +93,7 @@ public class GSSNameImpl implements GSSName {
* its internal name type and getStringNameType() output are
* always the new value.
*/
final static Oid oldHostbasedServiceName;
static final Oid oldHostbasedServiceName;
static {
Oid tmp = null;

View File

@ -32,7 +32,7 @@ import sun.net.www.protocol.http.HttpCallerInfo;
* info about what triggers the JGSS calls.
*/
public class HttpCaller extends GSSCaller {
final private HttpCallerInfo hci;
private final HttpCallerInfo hci;
public HttpCaller(HttpCallerInfo hci) {
super("HTTP_CLIENT");

View File

@ -116,7 +116,7 @@ public final class ProviderList {
new HashMap<PreferencesEntry, MechanismFactory>(5);
private HashSet<Oid> mechs = new HashSet<Oid>(5);
final private GSSCaller caller;
private final GSSCaller caller;
public ProviderList(GSSCaller caller, boolean useNative) {
this.caller = caller;

View File

@ -124,7 +124,7 @@ class Krb5Context implements GSSContextSpi {
private Credentials serviceCreds;
private KrbApReq apReq;
Ticket serviceTicket;
final private GSSCaller caller;
private final GSSCaller caller;
private static final boolean DEBUG = Krb5Util.DEBUG;
/**

View File

@ -60,7 +60,7 @@ public final class Krb5MechFactory implements MechanismFactory {
GSSName.NT_EXPORT_NAME,
NT_GSS_KRB5_PRINCIPAL};
final private GSSCaller caller;
private final GSSCaller caller;
private static Krb5CredElement getCredFromSubject(GSSNameSpi name,
boolean initiate)

View File

@ -79,7 +79,7 @@ public class SpNegoContext implements GSSContextSpi {
private Oid internal_mech = null;
// the SpNegoMechFactory that creates this context
final private SpNegoMechFactory factory;
private final SpNegoMechFactory factory;
// debug property
static final boolean DEBUG = GetBooleanAction

View File

@ -45,9 +45,9 @@ public abstract class NetClient implements AutoCloseable {
}
}
abstract public void send(byte[] data) throws IOException;
abstract public byte[] receive() throws IOException;
abstract public void close() throws IOException;
public abstract void send(byte[] data) throws IOException;
public abstract byte[] receive() throws IOException;
public abstract void close() throws IOException;
}
class TCPClient extends NetClient {

View File

@ -56,9 +56,9 @@ import static java.nio.charset.StandardCharsets.UTF_8;
*/
public class PAForUserEnc {
final public PrincipalName name;
final private EncryptionKey key;
final public static String AUTH_PACKAGE = "Kerberos";
public final PrincipalName name;
private final EncryptionKey key;
public static final String AUTH_PACKAGE = "Kerberos";
public PAForUserEnc(PrincipalName name, EncryptionKey key) {
this.name = name;

View File

@ -48,7 +48,7 @@ final class ReferralsCache {
private static Map<ReferralCacheKey, Map<String, ReferralCacheEntry>>
referralsMap = new HashMap<>();
static private final class ReferralCacheKey {
private static final class ReferralCacheKey {
private PrincipalName cname;
private PrincipalName sname;
ReferralCacheKey (PrincipalName cname, PrincipalName sname) {

View File

@ -53,7 +53,7 @@ public final class Des {
// string-to-key encoding. When set, the specified charset
// name is used. Otherwise, the system default charset.
private final static String CHARSET = GetPropertyAction
private static final String CHARSET = GetPropertyAction
.privilegedGetProperty("sun.security.krb5.msinterop.des.s2kcharset");
private static final long[] bad_keys = {

View File

@ -64,7 +64,7 @@ public class KrbDataInputStream extends BufferedInputStream{
* @throws IOException if there are not enough bytes or it represents
* a negative value
*/
final public int readLength4() throws IOException {
public final int readLength4() throws IOException {
int len = read(4);
if (len < 0) {
throw new IOException("Invalid encoding");

View File

@ -48,7 +48,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
*
* @author Rosanna Lee
*/
final public class ClientFactoryImpl implements SaslClientFactory {
public final class ClientFactoryImpl implements SaslClientFactory {
private static final String[] myMechs = {
"EXTERNAL",
"CRAM-MD5",

View File

@ -141,7 +141,7 @@ abstract class CramMD5Base {
clearPassword();
}
static private final int MD5_BLOCKSIZE = 64;
private static final int MD5_BLOCKSIZE = 64;
/**
* Hashes its input arguments according to HMAC-MD5 (RFC 2104)
* and returns the resulting digest in its ASCII representation.
@ -155,7 +155,7 @@ abstract class CramMD5Base {
* opad is the byte 0x5c repeated 64 times
* text is the data to be protected
*/
final static String HMAC_MD5(byte[] key, byte[] text)
static final String HMAC_MD5(byte[] key, byte[] text)
throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");

View File

@ -40,7 +40,7 @@ import javax.security.auth.callback.CallbackHandler;
*
* @author Rosanna Lee
*/
final public class ServerFactoryImpl implements SaslServerFactory {
public final class ServerFactoryImpl implements SaslServerFactory {
private static final String[] myMechs = {
"CRAM-MD5", //
};

View File

@ -272,7 +272,7 @@ abstract class DigestMD5Base extends AbstractSaslImpl {
*/
/** This array maps the characters to their 6 bit values */
private final static char[] pem_array = {
private static final char[] pem_array = {
// 0 1 2 3 4 5 6 7
'A','B','C','D','E','F','G','H', // 0
'I','J','K','L','M','N','O','P', // 1
@ -807,9 +807,9 @@ abstract class DigestMD5Base extends AbstractSaslImpl {
*/
class DigestIntegrity implements SecurityCtx {
/* Used for generating integrity keys - specified in RFC 2831*/
static final private String CLIENT_INT_MAGIC = "Digest session key to " +
private static final String CLIENT_INT_MAGIC = "Digest session key to " +
"client-to-server signing key magic constant";
static final private String SVR_INT_MAGIC = "Digest session key to " +
private static final String SVR_INT_MAGIC = "Digest session key to " +
"server-to-client signing key magic constant";
/* Key pairs for integrity checking */
@ -1086,9 +1086,9 @@ abstract class DigestMD5Base extends AbstractSaslImpl {
*/
final class DigestPrivacy extends DigestIntegrity implements SecurityCtx {
/* Used for generating privacy keys - specified in RFC 2831 */
static final private String CLIENT_CONF_MAGIC =
private static final String CLIENT_CONF_MAGIC =
"Digest H(A1) to client-to-server sealing key magic constant";
static final private String SVR_CONF_MAGIC =
private static final String SVR_CONF_MAGIC =
"Digest H(A1) to server-to-client sealing key magic constant";
private Cipher encCipher;

View File

@ -90,9 +90,9 @@ final class NTLMClient implements SaslClient {
"com.sun.security.sasl.ntlm.version";
private static final String NTLM_RANDOM =
"com.sun.security.sasl.ntlm.random";
private final static String NTLM_DOMAIN =
private static final String NTLM_DOMAIN =
"com.sun.security.sasl.ntlm.domain";
private final static String NTLM_HOSTNAME =
private static final String NTLM_HOSTNAME =
"com.sun.security.sasl.ntlm.hostname";
private final Client client;

View File

@ -83,11 +83,11 @@ import javax.security.sasl.*;
final class NTLMServer implements SaslServer {
private final static String NTLM_VERSION =
private static final String NTLM_VERSION =
"com.sun.security.sasl.ntlm.version";
private final static String NTLM_DOMAIN =
private static final String NTLM_DOMAIN =
"com.sun.security.sasl.ntlm.domain";
private final static String NTLM_HOSTNAME =
private static final String NTLM_HOSTNAME =
"com.sun.security.sasl.ntlm.hostname";
private static final String NTLM_RANDOM =
"com.sun.security.sasl.ntlm.random";

View File

@ -34,17 +34,17 @@ import java.util.Map;
*
* @author Rosanna Lee
*/
final public class PolicyUtils {
public final class PolicyUtils {
// Can't create one of these
private PolicyUtils() {
}
public final static int NOPLAINTEXT = 0x0001;
public final static int NOACTIVE = 0x0002;
public final static int NODICTIONARY = 0x0004;
public final static int FORWARD_SECRECY = 0x0008;
public final static int NOANONYMOUS = 0x0010;
public final static int PASS_CREDENTIALS = 0x0200;
public static final int NOPLAINTEXT = 0x0001;
public static final int NOACTIVE = 0x0002;
public static final int NODICTIONARY = 0x0004;
public static final int FORWARD_SECRECY = 0x0008;
public static final int NOANONYMOUS = 0x0010;
public static final int PASS_CREDENTIALS = 0x0200;
/**
* Determines whether a mechanism's characteristics, as defined in flags,

View File

@ -62,7 +62,7 @@ public interface CanonicalizationMethod extends Transform {
* The <a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315">Canonical
* XML (without comments)</a> canonicalization method algorithm URI.
*/
final static String INCLUSIVE =
static final String INCLUSIVE =
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
/**
@ -70,7 +70,7 @@ public interface CanonicalizationMethod extends Transform {
* <a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments">
* Canonical XML with comments</a> canonicalization method algorithm URI.
*/
final static String INCLUSIVE_WITH_COMMENTS =
static final String INCLUSIVE_WITH_COMMENTS =
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";
/**
@ -78,7 +78,7 @@ public interface CanonicalizationMethod extends Transform {
* Canonical XML (without comments)</a> canonicalization method algorithm
* URI.
*/
final static String EXCLUSIVE =
static final String EXCLUSIVE =
"http://www.w3.org/2001/10/xml-exc-c14n#";
/**
@ -86,7 +86,7 @@ public interface CanonicalizationMethod extends Transform {
* Exclusive Canonical XML with comments</a> canonicalization method
* algorithm URI.
*/
final static String EXCLUSIVE_WITH_COMMENTS =
static final String EXCLUSIVE_WITH_COMMENTS =
"http://www.w3.org/2001/10/xml-exc-c14n#WithComments";
/**
@ -95,7 +95,7 @@ public interface CanonicalizationMethod extends Transform {
*
* @since 13
*/
final static String INCLUSIVE_11 = "http://www.w3.org/2006/12/xml-c14n11";
static final String INCLUSIVE_11 = "http://www.w3.org/2006/12/xml-c14n11";
/**
* The <a href="https://www.w3.org/TR/xml-c14n11/#WithComments">
@ -104,7 +104,7 @@ public interface CanonicalizationMethod extends Transform {
*
* @since 13
*/
final static String INCLUSIVE_11_WITH_COMMENTS =
static final String INCLUSIVE_11_WITH_COMMENTS =
"http://www.w3.org/2006/12/xml-c14n11#WithComments";
/**

View File

@ -69,7 +69,7 @@ public interface Manifest extends XMLStructure {
* specified as the value of the <code>type</code> parameter of the
* {@link Reference} class to identify the referent's type).
*/
final static String TYPE = "http://www.w3.org/2000/09/xmldsig#Manifest";
static final String TYPE = "http://www.w3.org/2000/09/xmldsig#Manifest";
/**
* Returns the Id of this <code>Manifest</code>.

View File

@ -68,7 +68,7 @@ public interface SignatureProperties extends XMLStructure {
* can be specified as the value of the <code>type</code> parameter of the
* {@link Reference} class to identify the referent's type).
*/
final static String TYPE =
static final String TYPE =
"http://www.w3.org/2000/09/xmldsig#SignatureProperties";
/**

View File

@ -69,32 +69,32 @@ public interface Transform extends XMLStructure, AlgorithmMethod {
* The <a href="http://www.w3.org/2000/09/xmldsig#base64">Base64</a>
* transform algorithm URI.
*/
final static String BASE64 = "http://www.w3.org/2000/09/xmldsig#base64";
static final String BASE64 = "http://www.w3.org/2000/09/xmldsig#base64";
/**
* The <a href="http://www.w3.org/2000/09/xmldsig#enveloped-signature">
* Enveloped Signature</a> transform algorithm URI.
*/
final static String ENVELOPED =
static final String ENVELOPED =
"http://www.w3.org/2000/09/xmldsig#enveloped-signature";
/**
* The <a href="http://www.w3.org/TR/1999/REC-xpath-19991116">XPath</a>
* transform algorithm URI.
*/
final static String XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116";
static final String XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116";
/**
* The <a href="http://www.w3.org/2002/06/xmldsig-filter2">
* XPath Filter 2</a> transform algorithm URI.
*/
final static String XPATH2 = "http://www.w3.org/2002/06/xmldsig-filter2";
static final String XPATH2 = "http://www.w3.org/2002/06/xmldsig-filter2";
/**
* The <a href="http://www.w3.org/TR/1999/REC-xslt-19991116">XSLT</a>
* transform algorithm URI.
*/
final static String XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116";
static final String XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116";
/**
* Returns the algorithm-specific input parameters associated with this

View File

@ -86,7 +86,7 @@ public interface XMLObject extends XMLStructure {
* specified as the value of the <code>type</code> parameter of the
* {@link Reference} class to identify the referent's type).
*/
final static String TYPE = "http://www.w3.org/2000/09/xmldsig#Object";
static final String TYPE = "http://www.w3.org/2000/09/xmldsig#Object";
/**
* Returns an {@link java.util.Collections#unmodifiableList unmodifiable

View File

@ -89,7 +89,7 @@ public interface XMLSignature extends XMLStructure {
* The XML Namespace URI of the W3C Recommendation for XML-Signature
* Syntax and Processing.
*/
final static String XMLNS = "http://www.w3.org/2000/09/xmldsig#";
static final String XMLNS = "http://www.w3.org/2000/09/xmldsig#";
/**
* Validates the signature according to the

View File

@ -133,7 +133,7 @@ public interface KeyValue extends XMLStructure {
* {@link RetrievalMethod} class to describe a remote
* <code>DSAKeyValue</code> structure.
*/
final static String DSA_TYPE =
static final String DSA_TYPE =
"http://www.w3.org/2000/09/xmldsig#DSAKeyValue";
/**
@ -143,7 +143,7 @@ public interface KeyValue extends XMLStructure {
* {@link RetrievalMethod} class to describe a remote
* <code>RSAKeyValue</code> structure.
*/
final static String RSA_TYPE =
static final String RSA_TYPE =
"http://www.w3.org/2000/09/xmldsig#RSAKeyValue";
/**
@ -153,7 +153,7 @@ public interface KeyValue extends XMLStructure {
* {@link RetrievalMethod} class to describe a remote
* <code>ECKeyValue</code> structure.
*/
final static String EC_TYPE =
static final String EC_TYPE =
"http://www.w3.org/2009/xmldsig11#ECKeyValue";
/**

View File

@ -80,7 +80,7 @@ public interface PGPData extends XMLStructure {
* value of the <code>type</code> parameter of the {@link RetrievalMethod}
* class to describe a remote <code>PGPData</code> structure.
*/
final static String TYPE = "http://www.w3.org/2000/09/xmldsig#PGPData";
static final String TYPE = "http://www.w3.org/2000/09/xmldsig#PGPData";
/**
* Returns the PGP public key identifier of this <code>PGPData</code> as

View File

@ -87,7 +87,7 @@ public interface X509Data extends XMLStructure {
* {@link RetrievalMethod} class to describe a remote
* <code>X509Data</code> structure.
*/
final static String TYPE = "http://www.w3.org/2000/09/xmldsig#X509Data";
static final String TYPE = "http://www.w3.org/2000/09/xmldsig#X509Data";
/**
* URI identifying the binary (ASN.1 DER) X.509 Certificate KeyInfo type:
@ -95,7 +95,7 @@ public interface X509Data extends XMLStructure {
* specified as the value of the <code>type</code> parameter of the
* {@link RetrievalMethod} class to describe a remote X509 Certificate.
*/
final static String RAW_X509_CERTIFICATE_TYPE =
static final String RAW_X509_CERTIFICATE_TYPE =
"http://www.w3.org/2000/09/xmldsig#rawX509Certificate";
/**

View File

@ -84,7 +84,7 @@ final class Config {
osArch = props.get(2);
}
private final static boolean DEBUG = false;
private static final boolean DEBUG = false;
private static void debug(Object o) {
if (DEBUG) {
@ -898,7 +898,7 @@ final class Config {
});
}
private final static CK_ATTRIBUTE[] CK_A0 = new CK_ATTRIBUTE[0];
private static final CK_ATTRIBUTE[] CK_A0 = new CK_ATTRIBUTE[0];
private String parseOperation() throws IOException {
String op = parseWord();

View File

@ -56,16 +56,16 @@ import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
final class P11Cipher extends CipherSpi {
// mode constant for ECB mode
private final static int MODE_ECB = 3;
private static final int MODE_ECB = 3;
// mode constant for CBC mode
private final static int MODE_CBC = 4;
private static final int MODE_CBC = 4;
// mode constant for CTR mode
private final static int MODE_CTR = 5;
private static final int MODE_CTR = 5;
// padding constant for NoPadding
private final static int PAD_NONE = 5;
private static final int PAD_NONE = 5;
// padding constant for PKCS5Padding
private final static int PAD_PKCS5 = 6;
private static final int PAD_PKCS5 = 6;
private static interface Padding {
// ENC: format the specified buffer with padding bytes and return the

View File

@ -56,15 +56,15 @@ final class P11Digest extends MessageDigestSpi implements Cloneable,
MessageDigestSpi2 {
/* fields initialized, no session acquired */
private final static int S_BLANK = 1;
private static final int S_BLANK = 1;
/* data in buffer, session acquired, but digest not initialized */
private final static int S_BUFFERED = 2;
private static final int S_BUFFERED = 2;
/* session initialized for digesting */
private final static int S_INIT = 3;
private static final int S_INIT = 3;
private final static int BUFFER_SIZE = 96;
private static final int BUFFER_SIZE = 96;
// token instance
private final Token token;

View File

@ -72,9 +72,9 @@ abstract class P11Key implements Key, Length {
private static final long serialVersionUID = -2575874101938349339L;
private final static String PUBLIC = "public";
private final static String PRIVATE = "private";
private final static String SECRET = "secret";
private static final String PUBLIC = "public";
private static final String PRIVATE = "private";
private static final String SECRET = "secret";
// type of key, one of (PUBLIC, PRIVATE, SECRET)
final String type;
@ -280,7 +280,7 @@ abstract class P11Key implements Key, Length {
}
}
private final static CK_ATTRIBUTE[] A0 = new CK_ATTRIBUTE[0];
private static final CK_ATTRIBUTE[] A0 = new CK_ATTRIBUTE[0];
private static CK_ATTRIBUTE[] getAttributes(Session session, long keyID,
CK_ATTRIBUTE[] knownAttributes, CK_ATTRIBUTE[] desiredAttributes) {

View File

@ -2666,7 +2666,7 @@ final class P11KeyStore extends KeyStoreSpi {
}
}
private final static long[] LONG0 = new long[0];
private static final long[] LONG0 = new long[0];
private static long[] findObjects(Session session, CK_ATTRIBUTE[] attrs)
throws PKCS11Exception {

View File

@ -68,7 +68,7 @@ import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
*/
final class P11PSSSignature extends SignatureSpi {
private final static boolean DEBUG = false;
private static final boolean DEBUG = false;
// mappings of digest algorithms and their output length in bytes
private static final Hashtable<String, Integer> DIGEST_LENGTHS =
@ -153,14 +153,14 @@ final class P11PSSSignature extends SignatureSpi {
private int bytesProcessed = 0;
// constant for signing mode
private final static int M_SIGN = 1;
private static final int M_SIGN = 1;
// constant for verification mode
private final static int M_VERIFY = 2;
private static final int M_VERIFY = 2;
// constant for type digesting, we do the hashing ourselves
private final static int T_DIGEST = 1;
private static final int T_DIGEST = 1;
// constant for type update, token does everything
private final static int T_UPDATE = 2;
private static final int T_UPDATE = 2;
P11PSSSignature(Token token, String algorithm, long mechId)
throws NoSuchAlgorithmException, PKCS11Exception {

View File

@ -50,24 +50,24 @@ import sun.security.util.KeyUtil;
final class P11RSACipher extends CipherSpi {
// minimum length of PKCS#1 v1.5 padding
private final static int PKCS1_MIN_PADDING_LENGTH = 11;
private static final int PKCS1_MIN_PADDING_LENGTH = 11;
// constant byte[] of length 0
private final static byte[] B0 = new byte[0];
private static final byte[] B0 = new byte[0];
// mode constant for public key encryption
private final static int MODE_ENCRYPT = 1;
private static final int MODE_ENCRYPT = 1;
// mode constant for private key decryption
private final static int MODE_DECRYPT = 2;
private static final int MODE_DECRYPT = 2;
// mode constant for private key encryption (signing)
private final static int MODE_SIGN = 3;
private static final int MODE_SIGN = 3;
// mode constant for public key decryption (verifying)
private final static int MODE_VERIFY = 4;
private static final int MODE_VERIFY = 4;
// padding type constant for NoPadding
private final static int PAD_NONE = 1;
private static final int PAD_NONE = 1;
// padding type constant for PKCS1Padding
private final static int PAD_PKCS1 = 2;
private static final int PAD_PKCS1 = 2;
// token instance
private final Token token;

View File

@ -143,20 +143,20 @@ final class P11Signature extends SignatureSpi {
private boolean p1363Format = false;
// constant for signing mode
private final static int M_SIGN = 1;
private static final int M_SIGN = 1;
// constant for verification mode
private final static int M_VERIFY = 2;
private static final int M_VERIFY = 2;
// constant for type digesting, we do the hashing ourselves
private final static int T_DIGEST = 1;
private static final int T_DIGEST = 1;
// constant for type update, token does everything
private final static int T_UPDATE = 2;
private static final int T_UPDATE = 2;
// constant for type raw, used with RawDSA and NONEwithECDSA only
private final static int T_RAW = 3;
private static final int T_RAW = 3;
// PKCS#11 spec for CKM_ECDSA states that the length should not be longer
// than 1024 bits", but this is a little arbitrary
private final static int RAW_ECDSA_MAX = 128;
private static final int RAW_ECDSA_MAX = 128;
P11Signature(Token token, String algorithm, long mechanism)

View File

@ -50,7 +50,7 @@ import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
*/
public final class P11TlsKeyMaterialGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsKeyMaterialGenerator must be "
private static final String MSG = "TlsKeyMaterialGenerator must be "
+ "initialized using a TlsKeyMaterialParameterSpec";
// token instance

View File

@ -44,7 +44,7 @@ import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
*/
public final class P11TlsMasterSecretGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsMasterSecretGenerator must be "
private static final String MSG = "TlsMasterSecretGenerator must be "
+ "initialized using a TlsMasterSecretParameterSpec";
// token instance

View File

@ -53,7 +53,7 @@ import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
*/
final class P11TlsPrfGenerator extends KeyGeneratorSpi {
private final static String MSG =
private static final String MSG =
"TlsPrfGenerator must be initialized using a TlsPrfParameterSpec";
// token instance

View File

@ -45,7 +45,7 @@ import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
*/
final class P11TlsRsaPremasterSecretGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsRsaPremasterSecretGenerator must be "
private static final String MSG = "TlsRsaPremasterSecretGenerator must be "
+ "initialized using a TlsRsaPremasterSecretParameterSpec";
// token instance

View File

@ -168,7 +168,7 @@ public final class P11Util {
}
}
private final static char[] hexDigits = "0123456789abcdef".toCharArray();
private static final char[] hexDigits = "0123456789abcdef".toCharArray();
static String toString(byte[] b) {
if (b == null) {

View File

@ -58,20 +58,20 @@ import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
*/
public final class Secmod {
private final static boolean DEBUG = false;
private static final boolean DEBUG = false;
private final static Secmod INSTANCE;
private static final Secmod INSTANCE;
static {
sun.security.pkcs11.wrapper.PKCS11.loadNative();
INSTANCE = new Secmod();
}
private final static String NSS_LIB_NAME = "nss3";
private static final String NSS_LIB_NAME = "nss3";
private final static String SOFTTOKEN_LIB_NAME = "softokn3";
private static final String SOFTTOKEN_LIB_NAME = "softokn3";
private final static String TRUST_LIB_NAME = "nssckbi";
private static final String TRUST_LIB_NAME = "nssckbi";
// handle to be passed to the native code, 0 means not initialized
private long nssHandle;

View File

@ -44,7 +44,7 @@ import sun.security.pkcs11.wrapper.*;
final class Session implements Comparable<Session> {
// time after which to close idle sessions, in milliseconds (3 minutes)
private final static long MAX_IDLE_TIME = 3 * 60 * 1000;
private static final long MAX_IDLE_TIME = 3 * 60 * 1000;
// token instance
final Token token;

View File

@ -69,9 +69,9 @@ import java.util.concurrent.atomic.AtomicInteger;
*/
final class SessionManager {
private final static int DEFAULT_MAX_SESSIONS = 32;
private static final int DEFAULT_MAX_SESSIONS = 32;
private final static Debug debug = Debug.getInstance("pkcs11");
private static final Debug debug = Debug.getInstance("pkcs11");
// token instance
private final Token token;

View File

@ -432,7 +432,7 @@ public final class SunPKCS11 extends AuthProvider {
// Map from mechanism to List of Descriptors that should be
// registered if the mechanism is supported
private final static Map<Integer,List<Descriptor>> descriptors =
private static final Map<Integer,List<Descriptor>> descriptors =
new HashMap<Integer,List<Descriptor>>();
private static int[] m(long m1) {
@ -480,29 +480,29 @@ public final class SunPKCS11 extends AuthProvider {
}
}
private final static String MD = "MessageDigest";
private static final String MD = "MessageDigest";
private final static String SIG = "Signature";
private static final String SIG = "Signature";
private final static String KPG = "KeyPairGenerator";
private static final String KPG = "KeyPairGenerator";
private final static String KG = "KeyGenerator";
private static final String KG = "KeyGenerator";
private final static String AGP = "AlgorithmParameters";
private static final String AGP = "AlgorithmParameters";
private final static String KF = "KeyFactory";
private static final String KF = "KeyFactory";
private final static String SKF = "SecretKeyFactory";
private static final String SKF = "SecretKeyFactory";
private final static String CIP = "Cipher";
private static final String CIP = "Cipher";
private final static String MAC = "Mac";
private static final String MAC = "Mac";
private final static String KA = "KeyAgreement";
private static final String KA = "KeyAgreement";
private final static String KS = "KeyStore";
private static final String KS = "KeyStore";
private final static String SR = "SecureRandom";
private static final String SR = "SecureRandom";
static {
// names of all the implementation classes

View File

@ -54,14 +54,14 @@ import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
*/
final class TemplateManager {
private final static boolean DEBUG = false;
private static final boolean DEBUG = false;
// constant for any operation (either O_IMPORT or O_GENERATE)
final static String O_ANY = "*";
static final String O_ANY = "*";
// constant for operation create ("importing" existing key material)
final static String O_IMPORT = "import";
static final String O_IMPORT = "import";
// constant for operation generate (generating new key material)
final static String O_GENERATE = "generate";
static final String O_GENERATE = "generate";
private static class KeyAndTemplate {
final TemplateKey key;
@ -186,7 +186,7 @@ final class TemplateManager {
*/
private static final class Template {
private final static CK_ATTRIBUTE[] A0 = new CK_ATTRIBUTE[0];
private static final CK_ATTRIBUTE[] A0 = new CK_ATTRIBUTE[0];
private CK_ATTRIBUTE[] attributes;

View File

@ -53,7 +53,7 @@ class Token implements Serializable {
// how often to check if the token is still present (in ms)
// this is different from checking if a token has been inserted,
// that is done in SunPKCS11. Currently 50 ms.
private final static long CHECK_INTERVAL = 50;
private static final long CHECK_INTERVAL = 50;
final SunPKCS11 provider;
@ -117,10 +117,10 @@ class Token implements Serializable {
private long lastLoginCheck;
// mutex for token-present-check
private final static Object CHECK_LOCK = new Object();
private static final Object CHECK_LOCK = new Object();
// object for indicating unsupported mechanism in 'mechInfoMap'
private final static CK_MECHANISM_INFO INVALID_MECH =
private static final CK_MECHANISM_INFO INVALID_MECH =
new CK_MECHANISM_INFO(0, 0, 0);
// flag indicating whether the token supports raw secret key material import

View File

@ -72,52 +72,52 @@ public class CK_ATTRIBUTE {
// *MUST NEVER* be modified, e.g. by using them in a
// C_GetAttributeValue() call!
public final static CK_ATTRIBUTE TOKEN_FALSE =
public static final CK_ATTRIBUTE TOKEN_FALSE =
new CK_ATTRIBUTE(CKA_TOKEN, false);
public final static CK_ATTRIBUTE SENSITIVE_FALSE =
public static final CK_ATTRIBUTE SENSITIVE_FALSE =
new CK_ATTRIBUTE(CKA_SENSITIVE, false);
public final static CK_ATTRIBUTE EXTRACTABLE_TRUE =
public static final CK_ATTRIBUTE EXTRACTABLE_TRUE =
new CK_ATTRIBUTE(CKA_EXTRACTABLE, true);
public final static CK_ATTRIBUTE ENCRYPT_TRUE =
public static final CK_ATTRIBUTE ENCRYPT_TRUE =
new CK_ATTRIBUTE(CKA_ENCRYPT, true);
public final static CK_ATTRIBUTE DECRYPT_TRUE =
public static final CK_ATTRIBUTE DECRYPT_TRUE =
new CK_ATTRIBUTE(CKA_DECRYPT, true);
public final static CK_ATTRIBUTE WRAP_TRUE =
public static final CK_ATTRIBUTE WRAP_TRUE =
new CK_ATTRIBUTE(CKA_WRAP, true);
public final static CK_ATTRIBUTE UNWRAP_TRUE =
public static final CK_ATTRIBUTE UNWRAP_TRUE =
new CK_ATTRIBUTE(CKA_UNWRAP, true);
public final static CK_ATTRIBUTE SIGN_TRUE =
public static final CK_ATTRIBUTE SIGN_TRUE =
new CK_ATTRIBUTE(CKA_SIGN, true);
public final static CK_ATTRIBUTE VERIFY_TRUE =
public static final CK_ATTRIBUTE VERIFY_TRUE =
new CK_ATTRIBUTE(CKA_VERIFY, true);
public final static CK_ATTRIBUTE SIGN_RECOVER_TRUE =
public static final CK_ATTRIBUTE SIGN_RECOVER_TRUE =
new CK_ATTRIBUTE(CKA_SIGN_RECOVER, true);
public final static CK_ATTRIBUTE VERIFY_RECOVER_TRUE =
public static final CK_ATTRIBUTE VERIFY_RECOVER_TRUE =
new CK_ATTRIBUTE(CKA_VERIFY_RECOVER, true);
public final static CK_ATTRIBUTE DERIVE_TRUE =
public static final CK_ATTRIBUTE DERIVE_TRUE =
new CK_ATTRIBUTE(CKA_DERIVE, true);
public final static CK_ATTRIBUTE ENCRYPT_NULL =
public static final CK_ATTRIBUTE ENCRYPT_NULL =
new CK_ATTRIBUTE(CKA_ENCRYPT);
public final static CK_ATTRIBUTE DECRYPT_NULL =
public static final CK_ATTRIBUTE DECRYPT_NULL =
new CK_ATTRIBUTE(CKA_DECRYPT);
public final static CK_ATTRIBUTE WRAP_NULL =
public static final CK_ATTRIBUTE WRAP_NULL =
new CK_ATTRIBUTE(CKA_WRAP);
public final static CK_ATTRIBUTE UNWRAP_NULL =
public static final CK_ATTRIBUTE UNWRAP_NULL =
new CK_ATTRIBUTE(CKA_UNWRAP);
public CK_ATTRIBUTE() {

View File

@ -253,7 +253,7 @@ public class ECDSAOperations {
return ECOperations.allZero(temp1);
}
static public ImmutableIntegerModuloP b2a(IntegerModuloP b,
public static ImmutableIntegerModuloP b2a(IntegerModuloP b,
IntegerFieldModuloP orderField, byte[] temp1) {
b.asByteArray(temp1);
ImmutableIntegerModuloP b2 = orderField.getElement(temp1);

View File

@ -218,9 +218,9 @@ public class EdDSAParameters {
return dom.apply(sigParams);
}
private final static String prefixStr25519 =
private static final String prefixStr25519 =
"SigEd25519 no Ed25519 collisions";
private final static String prefixStr448 = "SigEd448";
private static final String prefixStr448 = "SigEd448";
// Used for Ed25519
static byte[] dom2(EdDSAParameterSpec sigParams) {

View File

@ -62,20 +62,20 @@ import sun.security.util.KeyUtil;
public final class CRSACipher extends CipherSpi {
// constant for an empty byte array
private final static byte[] B0 = new byte[0];
private static final byte[] B0 = new byte[0];
// mode constant for public key encryption
private final static int MODE_ENCRYPT = 1;
private static final int MODE_ENCRYPT = 1;
// mode constant for private key decryption
private final static int MODE_DECRYPT = 2;
private static final int MODE_DECRYPT = 2;
// mode constant for private key encryption (signing)
private final static int MODE_SIGN = 3;
private static final int MODE_SIGN = 3;
// mode constant for public key decryption (verifying)
private final static int MODE_VERIFY = 4;
private static final int MODE_VERIFY = 4;
// constant for PKCS#1 v1.5 RSA
private final static String PAD_PKCS1 = "PKCS1Padding";
private final static int PAD_PKCS1_LENGTH = 11;
private static final String PAD_PKCS1 = "PKCS1Padding";
private static final int PAD_PKCS1_LENGTH = 11;
// current mode, one of MODE_* above. Set when init() is called
private int mode;