public final class sun.security.util.KeyUtil
minor version: 0
major version: 59
flags: flags: (0x0031) ACC_PUBLIC, ACC_FINAL, ACC_SUPER
this_class: sun.security.util.KeyUtil
super_class: java.lang.Object
{
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lsun/security/util/KeyUtil;
public static final int getKeySize(java.security.Key);
descriptor: (Ljava/security/Key;)I
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Code:
stack=2, locals=4, args_size=1
start local 0 0: iconst_m1
istore 1
start local 1 1: aload 0
instanceof sun.security.util.Length
ifeq 8
2: aload 0
checkcast sun.security.util.Length
astore 2
start local 2 3: aload 2
invokeinterface sun.security.util.Length.length:()I
istore 1
end local 2 4: goto 6
StackMap locals: java.security.Key int
StackMap stack: java.lang.UnsupportedOperationException
5: pop
6: StackMap locals:
StackMap stack:
iload 1
iflt 8
7: iload 1
ireturn
8: StackMap locals:
StackMap stack:
aload 0
instanceof javax.crypto.SecretKey
ifeq 14
9: aload 0
checkcast javax.crypto.SecretKey
astore 2
start local 2 10: aload 2
invokeinterface javax.crypto.SecretKey.getFormat:()Ljava/lang/String;
astore 3
start local 3 11: ldc "RAW"
aload 3
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 45
aload 2
invokeinterface javax.crypto.SecretKey.getEncoded:()[B
ifnull 45
12: aload 2
invokeinterface javax.crypto.SecretKey.getEncoded:()[B
arraylength
bipush 8
imul
istore 1
end local 3 end local 2 13: goto 45
StackMap locals:
StackMap stack:
14: aload 0
instanceof java.security.interfaces.RSAKey
ifeq 18
15: aload 0
checkcast java.security.interfaces.RSAKey
astore 2
start local 2 16: aload 2
invokeinterface java.security.interfaces.RSAKey.getModulus:()Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.bitLength:()I
istore 1
end local 2 17: goto 45
StackMap locals:
StackMap stack:
18: aload 0
instanceof java.security.interfaces.ECKey
ifeq 22
19: aload 0
checkcast java.security.interfaces.ECKey
astore 2
start local 2 20: aload 2
invokeinterface java.security.interfaces.ECKey.getParams:()Ljava/security/spec/ECParameterSpec;
invokevirtual java.security.spec.ECParameterSpec.getOrder:()Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.bitLength:()I
istore 1
end local 2 21: goto 45
StackMap locals:
StackMap stack:
22: aload 0
instanceof java.security.interfaces.DSAKey
ifeq 29
23: aload 0
checkcast java.security.interfaces.DSAKey
astore 2
start local 2 24: aload 2
invokeinterface java.security.interfaces.DSAKey.getParams:()Ljava/security/interfaces/DSAParams;
astore 3
start local 3 25: aload 3
ifnull 26
aload 3
invokeinterface java.security.interfaces.DSAParams.getP:()Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.bitLength:()I
goto 27
StackMap locals: java.security.interfaces.DSAKey java.security.interfaces.DSAParams
StackMap stack:
26: iconst_m1
StackMap locals:
StackMap stack: int
27: istore 1
end local 3 end local 2 28: goto 45
StackMap locals:
StackMap stack:
29: aload 0
instanceof javax.crypto.interfaces.DHKey
ifeq 33
30: aload 0
checkcast javax.crypto.interfaces.DHKey
astore 2
start local 2 31: aload 2
invokeinterface javax.crypto.interfaces.DHKey.getParams:()Ljavax/crypto/spec/DHParameterSpec;
invokevirtual javax.crypto.spec.DHParameterSpec.getP:()Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.bitLength:()I
istore 1
end local 2 32: goto 45
StackMap locals:
StackMap stack:
33: aload 0
instanceof java.security.interfaces.EdECKey
ifeq 45
34: aload 0
checkcast java.security.interfaces.EdECKey
invokeinterface java.security.interfaces.EdECKey.getParams:()Ljava/security/spec/NamedParameterSpec;
invokevirtual java.security.spec.NamedParameterSpec.getName:()Ljava/lang/String;
astore 2
start local 2 35: aload 2
getstatic java.security.spec.NamedParameterSpec.ED25519:Ljava/security/spec/NamedParameterSpec;
invokevirtual java.security.spec.NamedParameterSpec.getName:()Ljava/lang/String;
invokevirtual java.lang.String.equalsIgnoreCase:(Ljava/lang/String;)Z
ifeq 38
36: sipush 255
istore 1
37: goto 45
StackMap locals: java.lang.String
StackMap stack:
38: aload 2
39: getstatic java.security.spec.NamedParameterSpec.ED448:Ljava/security/spec/NamedParameterSpec;
invokevirtual java.security.spec.NamedParameterSpec.getName:()Ljava/lang/String;
40: invokevirtual java.lang.String.equalsIgnoreCase:(Ljava/lang/String;)Z
41: ifeq 44
42: sipush 448
istore 1
43: goto 45
44: StackMap locals:
StackMap stack:
iconst_m1
istore 1
end local 2 45: StackMap locals:
StackMap stack:
iload 1
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 46 0 key Ljava/security/Key;
1 46 1 size I
3 4 2 ruler Lsun/security/util/Length;
10 13 2 sk Ljavax/crypto/SecretKey;
11 13 3 format Ljava/lang/String;
16 17 2 pubk Ljava/security/interfaces/RSAKey;
20 21 2 pubk Ljava/security/interfaces/ECKey;
24 28 2 pubk Ljava/security/interfaces/DSAKey;
25 28 3 params Ljava/security/interfaces/DSAParams;
31 32 2 pubk Ljavax/crypto/interfaces/DHKey;
35 45 2 nc Ljava/lang/String;
Exception table:
from to target type
2 4 5 Class java.lang.UnsupportedOperationException
MethodParameters:
Name Flags
key
public static final int getKeySize(java.security.AlgorithmParameters);
descriptor: (Ljava/security/AlgorithmParameters;)I
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Code:
stack=2, locals=4, args_size=1
start local 0 0: aload 0
invokevirtual java.security.AlgorithmParameters.getAlgorithm:()Ljava/lang/String;
astore 1
start local 1 1: aload 1
dup
astore 2
invokevirtual java.lang.String.hashCode:()I
lookupswitch { // 2
-1976312388: 2
2206: 3
default: 26
}
StackMap locals: java.lang.String java.lang.String
StackMap stack:
2: aload 2
ldc "DiffieHellman"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 19
goto 26
StackMap locals:
StackMap stack:
3: aload 2
ldc "EC"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 4
goto 26
4: StackMap locals:
StackMap stack:
aload 0
5: ldc Lsun/security/util/ECKeySizeParameterSpec;
6: invokevirtual java.security.AlgorithmParameters.getParameterSpec:(Ljava/lang/Class;)Ljava/security/spec/AlgorithmParameterSpec;
checkcast sun.security.util.ECKeySizeParameterSpec
astore 3
start local 3 7: aload 3
ifnull 11
8: aload 3
invokevirtual sun.security.util.ECKeySizeParameterSpec.getKeySize:()I
9: ireturn
end local 3 10: StackMap locals:
StackMap stack: java.security.spec.InvalidParameterSpecException
pop
11: StackMap locals:
StackMap stack:
aload 0
12: ldc Ljava/security/spec/ECParameterSpec;
13: invokevirtual java.security.AlgorithmParameters.getParameterSpec:(Ljava/lang/Class;)Ljava/security/spec/AlgorithmParameterSpec;
checkcast java.security.spec.ECParameterSpec
astore 3
start local 3 14: aload 3
ifnull 26
15: aload 3
invokevirtual java.security.spec.ECParameterSpec.getOrder:()Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.bitLength:()I
16: ireturn
end local 3 17: StackMap locals:
StackMap stack: java.security.spec.InvalidParameterSpecException
pop
18: goto 26
19: StackMap locals:
StackMap stack:
aload 0
20: ldc Ljavax/crypto/spec/DHParameterSpec;
21: invokevirtual java.security.AlgorithmParameters.getParameterSpec:(Ljava/lang/Class;)Ljava/security/spec/AlgorithmParameterSpec;
checkcast javax.crypto.spec.DHParameterSpec
astore 3
start local 3 22: aload 3
ifnull 26
23: aload 3
invokevirtual javax.crypto.spec.DHParameterSpec.getP:()Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.bitLength:()I
24: ireturn
end local 3 25: StackMap locals:
StackMap stack: java.security.spec.InvalidParameterSpecException
pop
26: StackMap locals:
StackMap stack:
iconst_m1
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 27 0 parameters Ljava/security/AlgorithmParameters;
1 27 1 algorithm Ljava/lang/String;
7 10 3 ps Lsun/security/util/ECKeySizeParameterSpec;
14 17 3 ps Ljava/security/spec/ECParameterSpec;
22 25 3 ps Ljavax/crypto/spec/DHParameterSpec;
Exception table:
from to target type
4 9 10 Class java.security.spec.InvalidParameterSpecException
11 16 17 Class java.security.spec.InvalidParameterSpecException
19 24 25 Class java.security.spec.InvalidParameterSpecException
MethodParameters:
Name Flags
parameters
public static final void validate(java.security.Key);
descriptor: (Ljava/security/Key;)V
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
ifnonnull 4
1: new java.lang.NullPointerException
dup
2: ldc "The key to be validated cannot be null"
3: invokespecial java.lang.NullPointerException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
aload 0
instanceof javax.crypto.interfaces.DHPublicKey
ifeq 6
5: aload 0
checkcast javax.crypto.interfaces.DHPublicKey
invokestatic sun.security.util.KeyUtil.validateDHPublicKey:(Ljavax/crypto/interfaces/DHPublicKey;)V
6: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 key Ljava/security/Key;
Exceptions:
throws java.security.InvalidKeyException
MethodParameters:
Name Flags
key
public static final void validate(java.security.spec.KeySpec);
descriptor: (Ljava/security/spec/KeySpec;)V
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
ifnonnull 4
1: new java.lang.NullPointerException
dup
2: ldc "The key spec to be validated cannot be null"
3: invokespecial java.lang.NullPointerException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
aload 0
instanceof javax.crypto.spec.DHPublicKeySpec
ifeq 6
5: aload 0
checkcast javax.crypto.spec.DHPublicKeySpec
invokestatic sun.security.util.KeyUtil.validateDHPublicKey:(Ljavax/crypto/spec/DHPublicKeySpec;)V
6: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 keySpec Ljava/security/spec/KeySpec;
Exceptions:
throws java.security.InvalidKeyException
MethodParameters:
Name Flags
keySpec
public static final boolean isOracleJCEProvider(java.lang.String);
descriptor: (Ljava/lang/String;)Z
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
ifnull 5
1: aload 0
ldc "SunJCE"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 4
2: aload 0
ldc "SunMSCAPI"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 4
3: aload 0
ldc "SunPKCS11"
invokevirtual java.lang.String.startsWith:(Ljava/lang/String;)Z
ifeq 5
4: StackMap locals:
StackMap stack:
iconst_1
ireturn
StackMap locals:
StackMap stack:
5: iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 providerName Ljava/lang/String;
MethodParameters:
Name Flags
providerName
public static byte[] checkTlsPreMasterSecretKey(int, int, java.security.SecureRandom, byte[], boolean);
descriptor: (IILjava/security/SecureRandom;[BZ)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=7, args_size=5
start local 0 start local 1 start local 2 start local 3 start local 4 0: aload 2
ifnonnull 2
1: invokestatic sun.security.jca.JCAUtil.getSecureRandom:()Ljava/security/SecureRandom;
astore 2
2: StackMap locals:
StackMap stack:
bipush 48
newarray 8
astore 5
start local 5 3: aload 2
aload 5
invokevirtual java.security.SecureRandom.nextBytes:([B)V
4: iload 4
ifne 14
aload 3
ifnull 14
5: aload 3
arraylength
bipush 48
if_icmpeq 7
6: aload 5
areturn
7: StackMap locals: byte[]
StackMap stack:
aload 3
iconst_0
baload
sipush 255
iand
bipush 8
ishl
aload 3
iconst_1
baload
sipush 255
iand
ior
8: istore 6
start local 6 9: iload 0
iload 6
if_icmpeq 13
10: iload 0
sipush 769
if_icmpgt 12
11: iload 1
iload 6
if_icmpeq 13
12: StackMap locals: int
StackMap stack:
aload 5
astore 3
13: StackMap locals:
StackMap stack:
aload 3
areturn
end local 6 14: StackMap locals:
StackMap stack:
aload 5
areturn
end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 15 0 clientVersion I
0 15 1 serverVersion I
0 15 2 random Ljava/security/SecureRandom;
0 15 3 encoded [B
0 15 4 isFailOver Z
3 15 5 replacer [B
9 14 6 encodedVersion I
MethodParameters:
Name Flags
clientVersion
serverVersion
random
encoded
isFailOver
private static void validateDHPublicKey(javax.crypto.interfaces.DHPublicKey);
descriptor: (Ljavax/crypto/interfaces/DHPublicKey;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=5, args_size=1
start local 0 0: aload 0
invokeinterface javax.crypto.interfaces.DHPublicKey.getParams:()Ljavax/crypto/spec/DHParameterSpec;
astore 1
start local 1 1: aload 1
invokevirtual javax.crypto.spec.DHParameterSpec.getP:()Ljava/math/BigInteger;
astore 2
start local 2 2: aload 1
invokevirtual javax.crypto.spec.DHParameterSpec.getG:()Ljava/math/BigInteger;
astore 3
start local 3 3: aload 0
invokeinterface javax.crypto.interfaces.DHPublicKey.getY:()Ljava/math/BigInteger;
astore 4
start local 4 4: aload 2
aload 3
aload 4
invokestatic sun.security.util.KeyUtil.validateDHPublicKey:(Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
5: return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 publicKey Ljavax/crypto/interfaces/DHPublicKey;
1 6 1 paramSpec Ljavax/crypto/spec/DHParameterSpec;
2 6 2 p Ljava/math/BigInteger;
3 6 3 g Ljava/math/BigInteger;
4 6 4 y Ljava/math/BigInteger;
Exceptions:
throws java.security.InvalidKeyException
MethodParameters:
Name Flags
publicKey
private static void validateDHPublicKey(javax.crypto.spec.DHPublicKeySpec);
descriptor: (Ljavax/crypto/spec/DHPublicKeySpec;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
invokevirtual javax.crypto.spec.DHPublicKeySpec.getP:()Ljava/math/BigInteger;
1: aload 0
invokevirtual javax.crypto.spec.DHPublicKeySpec.getG:()Ljava/math/BigInteger;
aload 0
invokevirtual javax.crypto.spec.DHPublicKeySpec.getY:()Ljava/math/BigInteger;
2: invokestatic sun.security.util.KeyUtil.validateDHPublicKey:(Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
3: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 publicKeySpec Ljavax/crypto/spec/DHPublicKeySpec;
Exceptions:
throws java.security.InvalidKeyException
MethodParameters:
Name Flags
publicKeySpec
private static void validateDHPublicKey(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
descriptor: (Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=6, args_size=3
start local 0 start local 1 start local 2 0: getstatic java.math.BigInteger.ONE:Ljava/math/BigInteger;
astore 3
start local 3 1: aload 0
getstatic java.math.BigInteger.ONE:Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.subtract:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
astore 4
start local 4 2: aload 2
aload 3
invokevirtual java.math.BigInteger.compareTo:(Ljava/math/BigInteger;)I
ifgt 6
3: new java.security.InvalidKeyException
dup
4: ldc "Diffie-Hellman public key is too small"
5: invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
6: StackMap locals: java.math.BigInteger java.math.BigInteger
StackMap stack:
aload 2
aload 4
invokevirtual java.math.BigInteger.compareTo:(Ljava/math/BigInteger;)I
iflt 10
7: new java.security.InvalidKeyException
dup
8: ldc "Diffie-Hellman public key is too large"
9: invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
10: StackMap locals:
StackMap stack:
aload 0
aload 2
invokevirtual java.math.BigInteger.remainder:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
astore 5
start local 5 11: aload 5
getstatic java.math.BigInteger.ZERO:Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.equals:(Ljava/lang/Object;)Z
ifeq 13
12: new java.security.InvalidKeyException
dup
ldc "Invalid Diffie-Hellman parameters"
invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
13: StackMap locals: java.math.BigInteger
StackMap stack:
return
end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 14 0 p Ljava/math/BigInteger;
0 14 1 g Ljava/math/BigInteger;
0 14 2 y Ljava/math/BigInteger;
1 14 3 leftOpen Ljava/math/BigInteger;
2 14 4 rightOpen Ljava/math/BigInteger;
11 14 5 r Ljava/math/BigInteger;
Exceptions:
throws java.security.InvalidKeyException
MethodParameters:
Name Flags
p
g
y
public static byte[] trimZeroes(byte[]);
descriptor: ([B)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=3, args_size=1
start local 0 0: iconst_0
istore 1
start local 1 1: goto 3
2: StackMap locals: int
StackMap stack:
iinc 1 1
3: StackMap locals:
StackMap stack:
iload 1
aload 0
arraylength
iconst_1
isub
if_icmpge 4
aload 0
iload 1
baload
ifeq 2
4: StackMap locals:
StackMap stack:
iload 1
ifne 6
5: aload 0
areturn
6: StackMap locals:
StackMap stack:
aload 0
arraylength
iload 1
isub
newarray 8
astore 2
start local 2 7: aload 0
iload 1
aload 2
iconst_0
aload 2
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
8: aload 2
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 b [B
1 9 1 i I
7 9 2 t [B
MethodParameters:
Name Flags
b
}
SourceFile: "KeyUtil.java"