public class org.glassfish.grizzly.websockets.SecKey
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.glassfish.grizzly.websockets.SecKey
super_class: java.lang.Object
{
private static final java.util.Random random;
descriptor: Ljava/util/Random;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
public static final int KEY_SIZE;
descriptor: I
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: 16
private final java.lang.String secKey;
descriptor: Ljava/lang/String;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private byte[] bytes;
descriptor: [B
flags: (0x0002) ACC_PRIVATE
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: new java.security.SecureRandom
dup
invokespecial java.security.SecureRandom.<init>:()V
putstatic org.glassfish.grizzly.websockets.SecKey.random:Ljava/util/Random;
1: return
LocalVariableTable:
Start End Slot Name Signature
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
aload 0
invokevirtual org.glassfish.grizzly.websockets.SecKey.create:()Ljava/lang/String;
putfield org.glassfish.grizzly.websockets.SecKey.secKey:Ljava/lang/String;
2: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/glassfish/grizzly/websockets/SecKey;
private java.lang.String create();
descriptor: ()Ljava/lang/String;
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
bipush 16
newarray 8
putfield org.glassfish.grizzly.websockets.SecKey.bytes:[B
1: getstatic org.glassfish.grizzly.websockets.SecKey.random:Ljava/util/Random;
aload 0
getfield org.glassfish.grizzly.websockets.SecKey.bytes:[B
invokevirtual java.util.Random.nextBytes:([B)V
2: invokestatic java.util.Base64.getEncoder:()Ljava/util/Base64$Encoder;
aload 0
getfield org.glassfish.grizzly.websockets.SecKey.bytes:[B
invokevirtual java.util.Base64$Encoder.encodeToString:([B)Ljava/lang/String;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/glassfish/grizzly/websockets/SecKey;
public void <init>(java.lang.String);
descriptor: (Ljava/lang/String;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 1
ifnonnull 3
2: new org.glassfish.grizzly.websockets.HandshakeException
dup
ldc "Null keys are not allowed."
invokespecial org.glassfish.grizzly.websockets.HandshakeException.<init>:(Ljava/lang/String;)V
athrow
3: StackMap locals: org.glassfish.grizzly.websockets.SecKey java.lang.String
StackMap stack:
aload 0
aload 1
putfield org.glassfish.grizzly.websockets.SecKey.secKey:Ljava/lang/String;
4: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lorg/glassfish/grizzly/websockets/SecKey;
0 5 1 base64 Ljava/lang/String;
MethodParameters:
Name Flags
base64
public static org.glassfish.grizzly.websockets.SecKey generateServerKey(org.glassfish.grizzly.websockets.SecKey);
descriptor: (Lorg/glassfish/grizzly/websockets/SecKey;)Lorg/glassfish/grizzly/websockets/SecKey;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=4, args_size=1
start local 0 0: new java.lang.StringBuilder
dup
aload 0
invokevirtual org.glassfish.grizzly.websockets.SecKey.getSecKey:()Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 1
start local 1 1: ldc "SHA-1"
invokestatic java.security.MessageDigest.getInstance:(Ljava/lang/String;)Ljava/security/MessageDigest;
astore 2
start local 2 2: aload 2
aload 1
getstatic org.glassfish.grizzly.utils.Charsets.ASCII_CHARSET:Ljava/nio/charset/Charset;
invokevirtual java.lang.String.getBytes:(Ljava/nio/charset/Charset;)[B
invokevirtual java.security.MessageDigest.update:([B)V
3: aload 2
invokevirtual java.security.MessageDigest.digest:()[B
astore 3
start local 3 4: aload 3
arraylength
bipush 20
if_icmpeq 6
5: new org.glassfish.grizzly.websockets.HandshakeException
dup
new java.lang.StringBuilder
dup
ldc "Invalid key length. Should be 20: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 3
arraylength
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial org.glassfish.grizzly.websockets.HandshakeException.<init>:(Ljava/lang/String;)V
athrow
6: StackMap locals: java.lang.String java.security.MessageDigest byte[]
StackMap stack:
new org.glassfish.grizzly.websockets.SecKey
dup
invokestatic java.util.Base64.getEncoder:()Ljava/util/Base64$Encoder;
aload 3
invokevirtual java.util.Base64$Encoder.encodeToString:([B)Ljava/lang/String;
invokespecial org.glassfish.grizzly.websockets.SecKey.<init>:(Ljava/lang/String;)V
7: areturn
end local 3 end local 2 8: StackMap locals: org.glassfish.grizzly.websockets.SecKey java.lang.String
StackMap stack: java.security.NoSuchAlgorithmException
astore 3
start local 3 9: new org.glassfish.grizzly.websockets.HandshakeException
dup
aload 3
invokevirtual java.security.NoSuchAlgorithmException.getMessage:()Ljava/lang/String;
invokespecial org.glassfish.grizzly.websockets.HandshakeException.<init>:(Ljava/lang/String;)V
athrow
end local 3 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 10 0 clientKey Lorg/glassfish/grizzly/websockets/SecKey;
1 10 1 key Ljava/lang/String;
2 8 2 instance Ljava/security/MessageDigest;
4 8 3 digest [B
9 10 3 e Ljava/security/NoSuchAlgorithmException;
Exception table:
from to target type
1 7 8 Class java.security.NoSuchAlgorithmException
Exceptions:
throws org.glassfish.grizzly.websockets.HandshakeException
MethodParameters:
Name Flags
clientKey
public java.lang.String getSecKey();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield org.glassfish.grizzly.websockets.SecKey.secKey:Ljava/lang/String;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/glassfish/grizzly/websockets/SecKey;
public java.lang.String toString();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield org.glassfish.grizzly.websockets.SecKey.secKey:Ljava/lang/String;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/glassfish/grizzly/websockets/SecKey;
public byte[] getBytes();
descriptor: ()[B
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
getfield org.glassfish.grizzly.websockets.SecKey.bytes:[B
ifnonnull 2
1: aload 0
invokestatic java.util.Base64.getDecoder:()Ljava/util/Base64$Decoder;
aload 0
getfield org.glassfish.grizzly.websockets.SecKey.secKey:Ljava/lang/String;
invokevirtual java.util.Base64$Decoder.decode:(Ljava/lang/String;)[B
putfield org.glassfish.grizzly.websockets.SecKey.bytes:[B
2: StackMap locals:
StackMap stack:
aload 0
getfield org.glassfish.grizzly.websockets.SecKey.bytes:[B
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/glassfish/grizzly/websockets/SecKey;
public void validateServerKey(java.lang.String);
descriptor: (Ljava/lang/String;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=3, args_size=2
start local 0 start local 1 0: aload 0
invokestatic org.glassfish.grizzly.websockets.SecKey.generateServerKey:(Lorg/glassfish/grizzly/websockets/SecKey;)Lorg/glassfish/grizzly/websockets/SecKey;
astore 2
start local 2 1: aload 2
invokevirtual org.glassfish.grizzly.websockets.SecKey.getSecKey:()Ljava/lang/String;
aload 1
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 3
2: new org.glassfish.grizzly.websockets.HandshakeException
dup
ldc "Server key returned does not match expected response"
invokespecial org.glassfish.grizzly.websockets.HandshakeException.<init>:(Ljava/lang/String;)V
athrow
3: StackMap locals: org.glassfish.grizzly.websockets.SecKey
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lorg/glassfish/grizzly/websockets/SecKey;
0 4 1 serverKey Ljava/lang/String;
1 4 2 key Lorg/glassfish/grizzly/websockets/SecKey;
MethodParameters:
Name Flags
serverKey
}
SourceFile: "SecKey.java"
InnerClasses:
public Decoder = java.util.Base64$Decoder of java.util.Base64
public Encoder = java.util.Base64$Encoder of java.util.Base64