public class org.apache.cassandra.security.CipherFactory
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.apache.cassandra.security.CipherFactory
super_class: java.lang.Object
{
private final org.slf4j.Logger logger;
descriptor: Lorg/slf4j/Logger;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private static final io.netty.util.concurrent.FastThreadLocal<org.apache.cassandra.security.CipherFactory$CachedCipher> cipherThreadLocal;
descriptor: Lio/netty/util/concurrent/FastThreadLocal;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
Signature: Lio/netty/util/concurrent/FastThreadLocal<Lorg/apache/cassandra/security/CipherFactory$CachedCipher;>;
private final java.security.SecureRandom secureRandom;
descriptor: Ljava/security/SecureRandom;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final com.google.common.cache.LoadingCache<java.lang.String, java.security.Key> cache;
descriptor: Lcom/google/common/cache/LoadingCache;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Lcom/google/common/cache/LoadingCache<Ljava/lang/String;Ljava/security/Key;>;
private final int ivLength;
descriptor: I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final org.apache.cassandra.security.KeyProvider keyProvider;
descriptor: Lorg/apache/cassandra/security/KeyProvider;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
static final boolean $assertionsDisabled;
descriptor: Z
flags: (0x1018) ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: ldc Lorg/apache/cassandra/security/CipherFactory;
invokevirtual java.lang.Class.desiredAssertionStatus:()Z
ifne 1
iconst_1
goto 2
StackMap locals:
StackMap stack:
1: iconst_0
StackMap locals:
StackMap stack: int
2: putstatic org.apache.cassandra.security.CipherFactory.$assertionsDisabled:Z
3: new io.netty.util.concurrent.FastThreadLocal
dup
invokespecial io.netty.util.concurrent.FastThreadLocal.<init>:()V
putstatic org.apache.cassandra.security.CipherFactory.cipherThreadLocal:Lio/netty/util/concurrent/FastThreadLocal;
return
LocalVariableTable:
Start End Slot Name Signature
public void <init>(org.apache.cassandra.config.TransparentDataEncryptionOptions);
descriptor: (Lorg/apache/cassandra/config/TransparentDataEncryptionOptions;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=6, locals=4, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
ldc Lorg/apache/cassandra/security/CipherFactory;
invokestatic org.slf4j.LoggerFactory.getLogger:(Ljava/lang/Class;)Lorg/slf4j/Logger;
putfield org.apache.cassandra.security.CipherFactory.logger:Lorg/slf4j/Logger;
2: aload 0
getfield org.apache.cassandra.security.CipherFactory.logger:Lorg/slf4j/Logger;
ldc "initializing CipherFactory"
invokeinterface org.slf4j.Logger.info:(Ljava/lang/String;)V
3: aload 0
aload 1
getfield org.apache.cassandra.config.TransparentDataEncryptionOptions.iv_length:I
putfield org.apache.cassandra.security.CipherFactory.ivLength:I
4: aload 0
ldc "SHA1PRNG"
invokestatic java.security.SecureRandom.getInstance:(Ljava/lang/String;)Ljava/security/SecureRandom;
putfield org.apache.cassandra.security.CipherFactory.secureRandom:Ljava/security/SecureRandom;
5: aload 1
getfield org.apache.cassandra.config.TransparentDataEncryptionOptions.key_provider:Lorg/apache/cassandra/config/ParameterizedClass;
getfield org.apache.cassandra.config.ParameterizedClass.class_name:Ljava/lang/String;
invokestatic java.lang.Class.forName:(Ljava/lang/String;)Ljava/lang/Class;
astore 2
start local 2 6: aload 2
iconst_1
anewarray java.lang.Class
dup
iconst_0
ldc Lorg/apache/cassandra/config/TransparentDataEncryptionOptions;
aastore
invokevirtual java.lang.Class.getConstructor:([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
astore 3
start local 3 7: aload 0
aload 3
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload 1
aastore
invokevirtual java.lang.reflect.Constructor.newInstance:([Ljava/lang/Object;)Ljava/lang/Object;
checkcast org.apache.cassandra.security.KeyProvider
putfield org.apache.cassandra.security.CipherFactory.keyProvider:Lorg/apache/cassandra/security/KeyProvider;
end local 3 end local 2 8: goto 11
9: StackMap locals: org.apache.cassandra.security.CipherFactory org.apache.cassandra.config.TransparentDataEncryptionOptions
StackMap stack: java.lang.Exception
astore 2
start local 2 10: new java.lang.RuntimeException
dup
ldc "couldn't load cipher factory"
aload 2
invokespecial java.lang.RuntimeException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
end local 2 11: StackMap locals:
StackMap stack:
aload 0
invokestatic com.google.common.cache.CacheBuilder.newBuilder:()Lcom/google/common/cache/CacheBuilder;
12: ldc 64
invokevirtual com.google.common.cache.CacheBuilder.maximumSize:(J)Lcom/google/common/cache/CacheBuilder;
13: invokestatic java.lang.Runtime.getRuntime:()Ljava/lang/Runtime;
invokevirtual java.lang.Runtime.availableProcessors:()I
invokevirtual com.google.common.cache.CacheBuilder.concurrencyLevel:(I)Lcom/google/common/cache/CacheBuilder;
14: new org.apache.cassandra.security.CipherFactory$1
dup
aload 0
invokespecial org.apache.cassandra.security.CipherFactory$1.<init>:(Lorg/apache/cassandra/security/CipherFactory;)V
invokevirtual com.google.common.cache.CacheBuilder.removalListener:(Lcom/google/common/cache/RemovalListener;)Lcom/google/common/cache/CacheBuilder;
15: new org.apache.cassandra.security.CipherFactory$2
dup
aload 0
invokespecial org.apache.cassandra.security.CipherFactory$2.<init>:(Lorg/apache/cassandra/security/CipherFactory;)V
invokevirtual com.google.common.cache.CacheBuilder.build:(Lcom/google/common/cache/CacheLoader;)Lcom/google/common/cache/LoadingCache;
16: putfield org.apache.cassandra.security.CipherFactory.cache:Lcom/google/common/cache/LoadingCache;
17: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 18 0 this Lorg/apache/cassandra/security/CipherFactory;
0 18 1 options Lorg/apache/cassandra/config/TransparentDataEncryptionOptions;
6 8 2 keyProviderClass Ljava/lang/Class<Lorg/apache/cassandra/security/KeyProvider;>;
7 8 3 ctor Ljava/lang/reflect/Constructor;
10 11 2 e Ljava/lang/Exception;
Exception table:
from to target type
4 8 9 Class java.lang.Exception
MethodParameters:
Name Flags
options
public javax.crypto.Cipher getEncryptor(java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;Ljava/lang/String;)Ljavax/crypto/Cipher;
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield org.apache.cassandra.security.CipherFactory.ivLength:I
newarray 8
astore 3
start local 3 1: aload 0
getfield org.apache.cassandra.security.CipherFactory.secureRandom:Ljava/security/SecureRandom;
aload 3
invokevirtual java.security.SecureRandom.nextBytes:([B)V
2: aload 0
aload 1
aload 2
aload 3
iconst_1
invokevirtual org.apache.cassandra.security.CipherFactory.buildCipher:(Ljava/lang/String;Ljava/lang/String;[BI)Ljavax/crypto/Cipher;
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/apache/cassandra/security/CipherFactory;
0 3 1 transformation Ljava/lang/String;
0 3 2 keyAlias Ljava/lang/String;
1 3 3 iv [B
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
transformation
keyAlias
public javax.crypto.Cipher getDecryptor(java.lang.String, java.lang.String, byte[]);
descriptor: (Ljava/lang/String;Ljava/lang/String;[B)Ljavax/crypto/Cipher;
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: getstatic org.apache.cassandra.security.CipherFactory.$assertionsDisabled:Z
ifne 2
aload 3
ifnull 1
aload 3
arraylength
ifgt 2
StackMap locals:
StackMap stack:
1: new java.lang.AssertionError
dup
ldc "trying to decrypt, but the initialization vector is empty"
invokespecial java.lang.AssertionError.<init>:(Ljava/lang/Object;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
aload 1
aload 2
aload 3
iconst_2
invokevirtual org.apache.cassandra.security.CipherFactory.buildCipher:(Ljava/lang/String;Ljava/lang/String;[BI)Ljavax/crypto/Cipher;
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/apache/cassandra/security/CipherFactory;
0 3 1 transformation Ljava/lang/String;
0 3 2 keyAlias Ljava/lang/String;
0 3 3 iv [B
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
transformation
keyAlias
iv
javax.crypto.Cipher buildCipher(java.lang.String, java.lang.String, byte[], int);
descriptor: (Ljava/lang/String;Ljava/lang/String;[BI)Ljavax/crypto/Cipher;
flags: (0x0000)
Code:
stack=6, locals=8, args_size=5
start local 0 start local 1 start local 2 start local 3 start local 4 0: getstatic org.apache.cassandra.security.CipherFactory.cipherThreadLocal:Lio/netty/util/concurrent/FastThreadLocal;
invokevirtual io.netty.util.concurrent.FastThreadLocal.get:()Ljava/lang/Object;
checkcast org.apache.cassandra.security.CipherFactory$CachedCipher
astore 5
start local 5 1: aload 5
ifnull 7
2: aload 5
getfield org.apache.cassandra.security.CipherFactory$CachedCipher.cipher:Ljavax/crypto/Cipher;
astore 6
start local 6 3: aload 5
getfield org.apache.cassandra.security.CipherFactory$CachedCipher.mode:I
iload 4
if_icmpne 7
aload 6
invokevirtual javax.crypto.Cipher.getAlgorithm:()Ljava/lang/String;
aload 1
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 7
4: aload 5
getfield org.apache.cassandra.security.CipherFactory$CachedCipher.keyAlias:Ljava/lang/String;
aload 2
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 7
aload 6
invokevirtual javax.crypto.Cipher.getIV:()[B
aload 3
invokestatic java.util.Arrays.equals:([B[B)Z
ifeq 7
5: aload 6
6: areturn
end local 6 7: StackMap locals: org.apache.cassandra.security.CipherFactory$CachedCipher
StackMap stack:
aload 0
aload 2
invokevirtual org.apache.cassandra.security.CipherFactory.retrieveKey:(Ljava/lang/String;)Ljava/security/Key;
astore 6
start local 6 8: aload 1
invokestatic javax.crypto.Cipher.getInstance:(Ljava/lang/String;)Ljavax/crypto/Cipher;
astore 7
start local 7 9: aload 7
iload 4
aload 6
new javax.crypto.spec.IvParameterSpec
dup
aload 3
invokespecial javax.crypto.spec.IvParameterSpec.<init>:([B)V
invokevirtual javax.crypto.Cipher.init:(ILjava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;)V
10: getstatic org.apache.cassandra.security.CipherFactory.cipherThreadLocal:Lio/netty/util/concurrent/FastThreadLocal;
new org.apache.cassandra.security.CipherFactory$CachedCipher
dup
iload 4
aload 2
aload 7
invokespecial org.apache.cassandra.security.CipherFactory$CachedCipher.<init>:(ILjava/lang/String;Ljavax/crypto/Cipher;)V
invokevirtual io.netty.util.concurrent.FastThreadLocal.set:(Ljava/lang/Object;)V
11: aload 7
12: areturn
end local 7 end local 6 end local 5 13: StackMap locals: org.apache.cassandra.security.CipherFactory java.lang.String java.lang.String byte[] int
StackMap stack: java.security.GeneralSecurityException
astore 5
start local 5 14: aload 0
getfield org.apache.cassandra.security.CipherFactory.logger:Lorg/slf4j/Logger;
ldc "could not build cipher"
aload 5
invokeinterface org.slf4j.Logger.error:(Ljava/lang/String;Ljava/lang/Throwable;)V
15: new java.io.IOException
dup
ldc "cannot load cipher"
aload 5
invokespecial java.io.IOException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
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 16 0 this Lorg/apache/cassandra/security/CipherFactory;
0 16 1 transformation Ljava/lang/String;
0 16 2 keyAlias Ljava/lang/String;
0 16 3 iv [B
0 16 4 cipherMode I
1 13 5 cachedCipher Lorg/apache/cassandra/security/CipherFactory$CachedCipher;
3 7 6 cipher Ljavax/crypto/Cipher;
8 13 6 key Ljava/security/Key;
9 13 7 cipher Ljavax/crypto/Cipher;
14 16 5 e Ljava/security/GeneralSecurityException;
Exception table:
from to target type
0 6 13 Class java.security.NoSuchAlgorithmException
7 12 13 Class java.security.NoSuchAlgorithmException
0 6 13 Class javax.crypto.NoSuchPaddingException
7 12 13 Class javax.crypto.NoSuchPaddingException
0 6 13 Class java.security.InvalidAlgorithmParameterException
7 12 13 Class java.security.InvalidAlgorithmParameterException
0 6 13 Class java.security.InvalidKeyException
7 12 13 Class java.security.InvalidKeyException
Exceptions:
throws java.io.IOException
RuntimeInvisibleAnnotations:
com.google.common.annotations.VisibleForTesting()
RuntimeInvisibleTypeAnnotations:
METHOD_RETURN
com.google.common.annotations.VisibleForTesting()
MethodParameters:
Name Flags
transformation
keyAlias
iv
cipherMode
private java.security.Key retrieveKey(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/security/Key;
flags: (0x0002) ACC_PRIVATE
Code:
stack=5, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield org.apache.cassandra.security.CipherFactory.cache:Lcom/google/common/cache/LoadingCache;
aload 1
invokeinterface com.google.common.cache.LoadingCache.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.security.Key
1: areturn
2: StackMap locals:
StackMap stack: java.util.concurrent.ExecutionException
astore 2
start local 2 3: aload 2
invokevirtual java.util.concurrent.ExecutionException.getCause:()Ljava/lang/Throwable;
instanceof java.io.IOException
ifeq 5
4: aload 2
invokevirtual java.util.concurrent.ExecutionException.getCause:()Ljava/lang/Throwable;
checkcast java.io.IOException
athrow
5: StackMap locals: java.util.concurrent.ExecutionException
StackMap stack:
new java.io.IOException
dup
new java.lang.StringBuilder
dup
ldc "failed to load key from cache: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 2
invokespecial java.io.IOException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lorg/apache/cassandra/security/CipherFactory;
0 6 1 keyAlias Ljava/lang/String;
3 6 2 e Ljava/util/concurrent/ExecutionException;
Exception table:
from to target type
0 1 2 Class java.util.concurrent.ExecutionException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
keyAlias
}
SourceFile: "CipherFactory.java"
NestMembers:
org.apache.cassandra.security.CipherFactory$1 org.apache.cassandra.security.CipherFactory$2 org.apache.cassandra.security.CipherFactory$CachedCipher
InnerClasses:
org.apache.cassandra.security.CipherFactory$1
org.apache.cassandra.security.CipherFactory$2
private CachedCipher = org.apache.cassandra.security.CipherFactory$CachedCipher of org.apache.cassandra.security.CipherFactory