final class com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils
minor version: 0
major version: 59
flags: flags: (0x0030) ACC_FINAL, ACC_SUPER
this_class: com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils
super_class: java.lang.Object
{
private static final java.lang.String PKCS12_ALG;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "PKCS12"
private static final java.lang.String SUN_X_509;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "SunX509"
private static final java.lang.String PEM_PRIVATE_START;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "-----BEGIN PRIVATE KEY-----"
private static final java.lang.String PEM_PRIVATE_END;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "-----END PRIVATE KEY-----"
private static final java.lang.String JAVA_KEY_STORE;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "JKS"
private static final java.lang.String CLIENT_CERT;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "client-cert"
private static final java.lang.String CLIENT_KEY;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "client-key"
private static final java.lang.String PEM_RSA_PRIVATE_START;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "-----BEGIN RSA PRIVATE KEY-----"
private static final long PVK_MAGIC;
descriptor: J
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 2964713758
private static final byte[] RSA2_MAGIC;
descriptor: [B
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final java.lang.String RC4_ALG;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "RC4"
private static final java.lang.String RSA_ALG;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "RSA"
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=4, locals=0, args_size=0
0: iconst_4
newarray 8
dup
iconst_0
bipush 82
bastore
dup
iconst_1
bipush 83
bastore
dup
iconst_2
bipush 65
bastore
dup
iconst_3
bipush 50
bastore
putstatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.RSA2_MAGIC:[B
1: return
LocalVariableTable:
Start End Slot Name Signature
void <init>();
descriptor: ()V
flags: (0x0000)
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 Lcom/microsoft/sqlserver/jdbc/SQLServerCertificateUtils;
static javax.net.ssl.KeyManager[] getKeyManagerFromFile(java.lang.String, java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Ljavax/net/ssl/KeyManager;
flags: (0x0008) ACC_STATIC
Code:
stack=3, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 1
ifnull 2
aload 1
invokevirtual java.lang.String.length:()I
ifle 2
1: aload 0
aload 1
aload 2
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.readPKCS8Certificate:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Ljavax/net/ssl/KeyManager;
areturn
2: StackMap locals:
StackMap stack:
aload 0
aload 2
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.readPKCS12Certificate:(Ljava/lang/String;Ljava/lang/String;)[Ljavax/net/ssl/KeyManager;
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 certPath Ljava/lang/String;
0 3 1 keyPath Ljava/lang/String;
0 3 2 keyPassword Ljava/lang/String;
Exceptions:
throws java.io.IOException, java.security.GeneralSecurityException, com.microsoft.sqlserver.jdbc.SQLServerException
MethodParameters:
Name Flags
certPath
keyPath
keyPassword
private static javax.net.ssl.KeyManager[] readPKCS12Certificate(java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;Ljava/lang/String;)[Ljavax/net/ssl/KeyManager;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=6, locals=6, args_size=2
start local 0 start local 1 0: ldc "PKCS12"
invokestatic java.security.KeyStore.getInstance:(Ljava/lang/String;)Ljava/security/KeyStore;
astore 2
start local 2 1: aconst_null
astore 3
aconst_null
astore 4
2: new java.io.FileInputStream
dup
aload 0
invokespecial java.io.FileInputStream.<init>:(Ljava/lang/String;)V
astore 5
start local 5 3: aload 2
aload 5
aload 1
invokevirtual java.lang.String.toCharArray:()[C
invokevirtual java.security.KeyStore.load:(Ljava/io/InputStream;[C)V
4: aload 5
ifnull 12
aload 5
invokevirtual java.io.FileInputStream.close:()V
goto 12
StackMap locals: java.lang.String java.lang.String java.security.KeyStore java.lang.Throwable java.lang.Throwable java.io.FileInputStream
StackMap stack: java.lang.Throwable
5: astore 3
aload 5
ifnull 6
aload 5
invokevirtual java.io.FileInputStream.close:()V
end local 5 StackMap locals:
StackMap stack:
6: aload 3
athrow
StackMap locals:
StackMap stack: java.lang.Throwable
7: astore 4
aload 3
ifnonnull 8
aload 4
astore 3
goto 9
StackMap locals:
StackMap stack:
8: aload 3
aload 4
if_acmpeq 9
aload 3
aload 4
invokevirtual java.lang.Throwable.addSuppressed:(Ljava/lang/Throwable;)V
StackMap locals:
StackMap stack:
9: aload 3
athrow
StackMap locals: java.lang.String java.lang.String java.security.KeyStore
StackMap stack: java.io.FileNotFoundException
10: pop
11: new com.microsoft.sqlserver.jdbc.SQLServerException
dup
ldc "R_clientCertError"
invokestatic com.microsoft.sqlserver.jdbc.SQLServerException.getErrString:(Ljava/lang/String;)Ljava/lang/String;
aconst_null
iconst_0
aconst_null
invokespecial com.microsoft.sqlserver.jdbc.SQLServerException.<init>:(Ljava/lang/String;Ljava/lang/String;ILjava/lang/Throwable;)V
athrow
12: StackMap locals:
StackMap stack:
ldc "SunX509"
invokestatic javax.net.ssl.KeyManagerFactory.getInstance:(Ljava/lang/String;)Ljavax/net/ssl/KeyManagerFactory;
astore 3
start local 3 13: aload 3
aload 2
aload 1
invokevirtual java.lang.String.toCharArray:()[C
invokevirtual javax.net.ssl.KeyManagerFactory.init:(Ljava/security/KeyStore;[C)V
14: aload 3
invokevirtual javax.net.ssl.KeyManagerFactory.getKeyManagers:()[Ljavax/net/ssl/KeyManager;
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 15 0 certPath Ljava/lang/String;
0 15 1 keyPassword Ljava/lang/String;
1 15 2 keystore Ljava/security/KeyStore;
3 6 5 certStream Ljava/io/FileInputStream;
13 15 3 keyManagerFactory Ljavax/net/ssl/KeyManagerFactory;
Exception table:
from to target type
3 4 5 any
2 7 7 any
1 10 10 Class java.io.FileNotFoundException
Exceptions:
throws java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.io.FileNotFoundException, java.io.IOException, java.security.UnrecoverableKeyException, java.security.KeyStoreException, com.microsoft.sqlserver.jdbc.SQLServerException
MethodParameters:
Name Flags
certPath
keyPassword
private static javax.net.ssl.KeyManager[] readPKCS8Certificate(java.lang.String, java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Ljavax/net/ssl/KeyManager;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=8, locals=7, args_size=3
start local 0 start local 1 start local 2 0: aload 0
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.loadCertificate:(Ljava/lang/String;)Ljava/security/cert/Certificate;
astore 3
start local 3 1: aload 3
checkcast java.security.cert.X509Certificate
invokevirtual java.security.cert.X509Certificate.checkValidity:()V
2: aload 1
aload 2
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.loadPrivateKey:(Ljava/lang/String;Ljava/lang/String;)Ljava/security/PrivateKey;
astore 4
start local 4 3: ldc "JKS"
invokestatic java.security.KeyStore.getInstance:(Ljava/lang/String;)Ljava/security/KeyStore;
astore 5
start local 5 4: aload 5
aconst_null
aconst_null
invokevirtual java.security.KeyStore.load:(Ljava/io/InputStream;[C)V
5: aload 5
ldc "client-cert"
aload 3
invokevirtual java.security.KeyStore.setCertificateEntry:(Ljava/lang/String;Ljava/security/cert/Certificate;)V
6: aload 5
ldc "client-key"
aload 4
aload 2
invokevirtual java.lang.String.toCharArray:()[C
iconst_1
anewarray java.security.cert.Certificate
dup
iconst_0
aload 3
aastore
invokevirtual java.security.KeyStore.setKeyEntry:(Ljava/lang/String;Ljava/security/Key;[C[Ljava/security/cert/Certificate;)V
7: invokestatic javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm:()Ljava/lang/String;
invokestatic javax.net.ssl.KeyManagerFactory.getInstance:(Ljava/lang/String;)Ljavax/net/ssl/KeyManagerFactory;
astore 6
start local 6 8: aload 6
aload 5
aload 2
invokevirtual java.lang.String.toCharArray:()[C
invokevirtual javax.net.ssl.KeyManagerFactory.init:(Ljava/security/KeyStore;[C)V
9: aload 6
invokevirtual javax.net.ssl.KeyManagerFactory.getKeyManagers:()[Ljavax/net/ssl/KeyManager;
areturn
end local 6 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 10 0 certPath Ljava/lang/String;
0 10 1 keyPath Ljava/lang/String;
0 10 2 keyPassword Ljava/lang/String;
1 10 3 clientCertificate Ljava/security/cert/Certificate;
3 10 4 privateKey Ljava/security/PrivateKey;
4 10 5 keyStore Ljava/security/KeyStore;
8 10 6 kmf Ljavax/net/ssl/KeyManagerFactory;
Exceptions:
throws java.io.IOException, java.security.GeneralSecurityException, com.microsoft.sqlserver.jdbc.SQLServerException
MethodParameters:
Name Flags
certPath
keyPath
keyPassword
private static java.security.PrivateKey loadPrivateKeyFromPKCS8(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/security/PrivateKey;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=4, args_size=1
start local 0 0: new java.lang.StringBuilder
dup
aload 0
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
astore 1
start local 1 1: aload 1
ldc "-----BEGIN PRIVATE KEY-----"
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.deleteFirst:(Ljava/lang/StringBuilder;Ljava/lang/String;)V
2: aload 1
ldc "-----END PRIVATE KEY-----"
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.deleteFirst:(Ljava/lang/StringBuilder;Ljava/lang/String;)V
3: invokestatic java.util.Base64.getDecoder:()Ljava/util/Base64$Decoder;
aload 1
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
ldc "\\s"
ldc ""
invokevirtual java.lang.String.replaceAll:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
invokevirtual java.util.Base64$Decoder.decode:(Ljava/lang/String;)[B
astore 2
start local 2 4: ldc "RSA"
invokestatic java.security.KeyFactory.getInstance:(Ljava/lang/String;)Ljava/security/KeyFactory;
astore 3
start local 3 5: aload 3
new java.security.spec.PKCS8EncodedKeySpec
dup
aload 2
invokespecial java.security.spec.PKCS8EncodedKeySpec.<init>:([B)V
invokevirtual java.security.KeyFactory.generatePrivate:(Ljava/security/spec/KeySpec;)Ljava/security/PrivateKey;
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 key Ljava/lang/String;
1 6 1 sb Ljava/lang/StringBuilder;
4 6 2 formattedKey [B
5 6 3 factory Ljava/security/KeyFactory;
Exceptions:
throws java.io.IOException, java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException
MethodParameters:
Name Flags
key
private static void deleteFirst(java.lang.StringBuilder, java.lang.String);
descriptor: (Ljava/lang/StringBuilder;Ljava/lang/String;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=3, args_size=2
start local 0 start local 1 0: aload 0
aload 1
invokevirtual java.lang.StringBuilder.indexOf:(Ljava/lang/String;)I
istore 2
start local 2 1: iload 2
iconst_m1
if_icmpeq 3
2: aload 0
iload 2
iload 2
aload 1
invokevirtual java.lang.String.length:()I
iadd
invokevirtual java.lang.StringBuilder.delete:(II)Ljava/lang/StringBuilder;
pop
3: StackMap locals: int
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 sb Ljava/lang/StringBuilder;
0 4 1 str Ljava/lang/String;
1 4 2 i I
MethodParameters:
Name Flags
sb
str
private static java.security.PrivateKey loadPrivateKeyFromPKCS1(java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;Ljava/lang/String;)Ljava/security/PrivateKey;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=5, locals=9, args_size=2
start local 0 start local 1 0: invokestatic com.microsoft.sqlserver.jdbc.SQLServerBouncyCastleLoader.loadBouncyCastle:()V
1: aconst_null
astore 2
start local 2 2: new org.bouncycastle.openssl.PEMParser
dup
new java.io.StringReader
dup
aload 0
invokespecial java.io.StringReader.<init>:(Ljava/lang/String;)V
invokespecial org.bouncycastle.openssl.PEMParser.<init>:(Ljava/io/Reader;)V
astore 2
3: aload 2
invokevirtual org.bouncycastle.openssl.PEMParser.readObject:()Ljava/lang/Object;
astore 3
start local 3 4: new org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter
dup
invokespecial org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter.<init>:()V
ldc "BC"
invokevirtual org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter.setProvider:(Ljava/lang/String;)Lorg/bouncycastle/openssl/jcajce/JcaPEMKeyConverter;
astore 4
start local 4 5: aload 3
instanceof org.bouncycastle.openssl.PEMEncryptedKeyPair
ifeq 9
aload 1
ifnull 9
6: new org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder
dup
invokespecial org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder.<init>:()V
aload 1
invokevirtual java.lang.String.toCharArray:()[C
invokevirtual org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder.build:([C)Lorg/bouncycastle/openssl/PEMDecryptorProvider;
astore 6
start local 6 7: aload 4
aload 3
checkcast org.bouncycastle.openssl.PEMEncryptedKeyPair
aload 6
invokevirtual org.bouncycastle.openssl.PEMEncryptedKeyPair.decryptKeyPair:(Lorg/bouncycastle/openssl/PEMDecryptorProvider;)Lorg/bouncycastle/openssl/PEMKeyPair;
invokevirtual org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter.getKeyPair:(Lorg/bouncycastle/openssl/PEMKeyPair;)Ljava/security/KeyPair;
astore 5
end local 6 start local 5 8: goto 10
end local 5 9: StackMap locals: org.bouncycastle.openssl.PEMParser java.lang.Object org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter
StackMap stack:
aload 4
aload 3
checkcast org.bouncycastle.openssl.PEMKeyPair
invokevirtual org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter.getKeyPair:(Lorg/bouncycastle/openssl/PEMKeyPair;)Ljava/security/KeyPair;
astore 5
start local 5 10: StackMap locals: java.security.KeyPair
StackMap stack:
aload 5
invokevirtual java.security.KeyPair.getPrivate:()Ljava/security/PrivateKey;
astore 8
11: aload 2
ifnull 13
12: aload 2
invokevirtual org.bouncycastle.openssl.PEMParser.close:()V
13: StackMap locals: java.lang.String java.lang.String org.bouncycastle.openssl.PEMParser java.lang.Object org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter java.security.KeyPair top top java.security.PrivateKey
StackMap stack:
aload 8
areturn
end local 5 end local 4 end local 3 14: StackMap locals: java.lang.String java.lang.String org.bouncycastle.openssl.PEMParser
StackMap stack: java.lang.Throwable
astore 7
15: aload 2
ifnull 17
16: aload 2
invokevirtual org.bouncycastle.openssl.PEMParser.close:()V
17: StackMap locals: java.lang.String java.lang.String org.bouncycastle.openssl.PEMParser top top top top java.lang.Throwable
StackMap stack:
aload 7
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 18 0 key Ljava/lang/String;
0 18 1 keyPass Ljava/lang/String;
2 18 2 pemParser Lorg/bouncycastle/openssl/PEMParser;
4 14 3 object Ljava/lang/Object;
5 14 4 converter Lorg/bouncycastle/openssl/jcajce/JcaPEMKeyConverter;
8 9 5 kp Ljava/security/KeyPair;
10 14 5 kp Ljava/security/KeyPair;
7 8 6 decProv Lorg/bouncycastle/openssl/PEMDecryptorProvider;
Exception table:
from to target type
2 11 14 any
Exceptions:
throws java.io.IOException, java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException
MethodParameters:
Name Flags
key
keyPass
private static java.security.PrivateKey loadPrivateKeyFromPVK(java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;Ljava/lang/String;)Ljava/security/PrivateKey;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=10, locals=26, args_size=2
start local 0 start local 1 0: new java.io.File
dup
aload 0
invokespecial java.io.File.<init>:(Ljava/lang/String;)V
astore 2
start local 2 1: aload 2
invokevirtual java.io.File.length:()J
l2i
invokestatic java.nio.ByteBuffer.allocate:(I)Ljava/nio/ByteBuffer;
astore 3
start local 3 2: aconst_null
astore 4
aconst_null
astore 5
3: new java.io.FileInputStream
dup
aload 2
invokespecial java.io.FileInputStream.<init>:(Ljava/io/File;)V
astore 6
start local 6 4: aload 6
invokevirtual java.io.FileInputStream.getChannel:()Ljava/nio/channels/FileChannel;
aload 3
invokevirtual java.nio.channels.FileChannel.read:(Ljava/nio/ByteBuffer;)I
pop
5: aload 3
getstatic java.nio.ByteOrder.LITTLE_ENDIAN:Ljava/nio/ByteOrder;
invokevirtual java.nio.ByteBuffer.order:(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
invokevirtual java.nio.Buffer.rewind:()Ljava/nio/Buffer;
pop
6: aload 3
invokevirtual java.nio.ByteBuffer.getInt:()I
i2l
ldc 4294967295
land
lstore 7
start local 7 7: ldc 2964713758
lload 7
lcmp
ifeq 11
8: aconst_null
lload 7
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
ldc "R_pvkHeaderError"
invokestatic com.microsoft.sqlserver.jdbc.SQLServerResource.getResource:(Ljava/lang/String;)Ljava/lang/String;
9: ldc ""
iconst_0
10: invokestatic com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError:(Lcom/microsoft/sqlserver/jdbc/SQLServerConnection;Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;Z)V
11: StackMap locals: java.lang.String java.lang.String java.io.File java.nio.ByteBuffer java.lang.Throwable java.lang.Throwable java.io.FileInputStream long
StackMap stack:
aload 3
aload 3
invokevirtual java.nio.Buffer.position:()I
bipush 8
iadd
invokevirtual java.nio.Buffer.position:(I)Ljava/nio/Buffer;
pop
12: aload 3
invokevirtual java.nio.ByteBuffer.getInt:()I
ifeq 13
iconst_1
goto 14
StackMap locals:
StackMap stack:
13: iconst_0
StackMap locals:
StackMap stack: int
14: istore 9
start local 9 15: aload 3
invokevirtual java.nio.ByteBuffer.getInt:()I
istore 10
start local 10 16: aload 3
invokevirtual java.nio.ByteBuffer.getInt:()I
istore 11
start local 11 17: iload 10
newarray 8
astore 12
start local 12 18: aload 3
aload 12
invokevirtual java.nio.ByteBuffer.get:([B)Ljava/nio/ByteBuffer;
pop
19: aload 3
aload 3
invokevirtual java.nio.Buffer.position:()I
bipush 8
iadd
invokevirtual java.nio.Buffer.position:(I)Ljava/nio/Buffer;
pop
20: iload 11
bipush 8
isub
newarray 8
astore 13
start local 13 21: aload 3
aload 13
invokevirtual java.nio.ByteBuffer.get:([B)Ljava/nio/ByteBuffer;
pop
22: iload 9
ifeq 29
23: ldc "SHA1"
invokestatic java.security.MessageDigest.getInstance:(Ljava/lang/String;)Ljava/security/MessageDigest;
astore 14
start local 14 24: aload 14
aload 12
invokevirtual java.security.MessageDigest.update:([B)V
25: aload 1
ifnull 27
26: aload 14
aload 1
invokevirtual java.lang.String.getBytes:()[B
invokevirtual java.security.MessageDigest.update:([B)V
27: StackMap locals: java.lang.String java.lang.String java.io.File java.nio.ByteBuffer java.lang.Throwable java.lang.Throwable java.io.FileInputStream long int int int byte[] byte[] java.security.MessageDigest
StackMap stack:
aload 14
invokevirtual java.security.MessageDigest.digest:()[B
astore 15
start local 15 28: aload 13
aload 15
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.getSecretKeyFromHash:([B[B)[B
astore 13
end local 15 end local 14 29: StackMap locals:
StackMap stack:
aload 13
invokestatic java.nio.ByteBuffer.wrap:([B)Ljava/nio/ByteBuffer;
getstatic java.nio.ByteOrder.LITTLE_ENDIAN:Ljava/nio/ByteOrder;
invokevirtual java.nio.ByteBuffer.order:(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
astore 14
start local 14 30: aload 14
getstatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.RSA2_MAGIC:[B
arraylength
invokevirtual java.nio.Buffer.position:(I)Ljava/nio/Buffer;
pop
31: aload 14
invokevirtual java.nio.ByteBuffer.getInt:()I
bipush 8
idiv
istore 15
start local 15 32: aload 14
invokevirtual java.nio.ByteBuffer.getInt:()I
i2l
invokestatic java.math.BigInteger.valueOf:(J)Ljava/math/BigInteger;
astore 16
start local 16 33: aload 14
iload 15
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.getBigInteger:(Ljava/nio/ByteBuffer;I)Ljava/math/BigInteger;
astore 17
start local 17 34: aload 14
iload 15
iconst_2
idiv
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.getBigInteger:(Ljava/nio/ByteBuffer;I)Ljava/math/BigInteger;
astore 18
start local 18 35: aload 14
iload 15
iconst_2
idiv
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.getBigInteger:(Ljava/nio/ByteBuffer;I)Ljava/math/BigInteger;
astore 19
start local 19 36: aload 14
iload 15
iconst_2
idiv
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.getBigInteger:(Ljava/nio/ByteBuffer;I)Ljava/math/BigInteger;
astore 20
start local 20 37: aload 14
iload 15
iconst_2
idiv
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.getBigInteger:(Ljava/nio/ByteBuffer;I)Ljava/math/BigInteger;
astore 21
start local 21 38: aload 14
iload 15
iconst_2
idiv
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.getBigInteger:(Ljava/nio/ByteBuffer;I)Ljava/math/BigInteger;
astore 22
start local 22 39: aload 14
iload 15
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.getBigInteger:(Ljava/nio/ByteBuffer;I)Ljava/math/BigInteger;
astore 23
start local 23 40: new java.security.spec.RSAPrivateCrtKeySpec
dup
aload 17
aload 16
aload 23
aload 18
41: aload 19
aload 20
aload 21
aload 22
42: invokespecial java.security.spec.RSAPrivateCrtKeySpec.<init>:(Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
astore 24
start local 24 43: ldc "RSA"
invokestatic java.security.KeyFactory.getInstance:(Ljava/lang/String;)Ljava/security/KeyFactory;
astore 25
start local 25 44: aload 25
aload 24
invokevirtual java.security.KeyFactory.generatePrivate:(Ljava/security/spec/KeySpec;)Ljava/security/PrivateKey;
45: aload 6
ifnull 46
aload 6
invokevirtual java.io.FileInputStream.close:()V
46: StackMap locals: java.lang.String java.lang.String java.io.File java.nio.ByteBuffer java.lang.Throwable java.lang.Throwable java.io.FileInputStream long int int int byte[] byte[] java.nio.ByteBuffer int java.math.BigInteger java.math.BigInteger java.math.BigInteger java.math.BigInteger java.math.BigInteger java.math.BigInteger java.math.BigInteger java.math.BigInteger java.security.spec.RSAPrivateCrtKeySpec java.security.KeyFactory
StackMap stack: java.security.PrivateKey
areturn
end local 25 end local 24 end local 23 end local 22 end local 21 end local 20 end local 19 end local 18 end local 17 end local 16 end local 15 end local 14 end local 13 end local 12 end local 11 end local 10 end local 9 end local 7 StackMap locals: java.lang.String java.lang.String java.io.File java.nio.ByteBuffer java.lang.Throwable java.lang.Throwable java.io.FileInputStream
StackMap stack: java.lang.Throwable
47: astore 4
48: aload 6
ifnull 49
aload 6
invokevirtual java.io.FileInputStream.close:()V
end local 6 StackMap locals:
StackMap stack:
49: aload 4
athrow
StackMap locals:
StackMap stack: java.lang.Throwable
50: astore 5
aload 4
ifnonnull 51
aload 5
astore 4
goto 52
StackMap locals:
StackMap stack:
51: aload 4
aload 5
if_acmpeq 52
aload 4
aload 5
invokevirtual java.lang.Throwable.addSuppressed:(Ljava/lang/Throwable;)V
StackMap locals:
StackMap stack:
52: aload 4
athrow
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 53 0 keyPath Ljava/lang/String;
0 53 1 keyPass Ljava/lang/String;
1 53 2 f Ljava/io/File;
2 53 3 buffer Ljava/nio/ByteBuffer;
4 49 6 in Ljava/io/FileInputStream;
7 47 7 magic J
15 47 9 encrypted Z
16 47 10 saltLength I
17 47 11 keyLength I
18 47 12 salt [B
21 47 13 key [B
24 29 14 digest Ljava/security/MessageDigest;
28 29 15 hash [B
30 47 14 buff Ljava/nio/ByteBuffer;
32 47 15 byteLength I
33 47 16 publicExponent Ljava/math/BigInteger;
34 47 17 modulus Ljava/math/BigInteger;
35 47 18 prime1 Ljava/math/BigInteger;
36 47 19 prime2 Ljava/math/BigInteger;
37 47 20 primeExponent1 Ljava/math/BigInteger;
38 47 21 primeExponent2 Ljava/math/BigInteger;
39 47 22 crtCoefficient Ljava/math/BigInteger;
40 47 23 privateExponent Ljava/math/BigInteger;
43 47 24 spec Ljava/security/spec/RSAPrivateCrtKeySpec;
44 47 25 factory Ljava/security/KeyFactory;
Exception table:
from to target type
4 45 47 any
3 46 50 any
47 50 50 any
Exceptions:
throws java.io.IOException, java.security.GeneralSecurityException, com.microsoft.sqlserver.jdbc.SQLServerException
MethodParameters:
Name Flags
keyPath
keyPass
private static java.security.cert.Certificate loadCertificate(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/security/cert/Certificate;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=5, args_size=1
start local 0 0: ldc "X509"
invokestatic java.security.cert.CertificateFactory.getInstance:(Ljava/lang/String;)Ljava/security/cert/CertificateFactory;
astore 1
start local 1 1: aconst_null
astore 2
aconst_null
astore 3
2: aload 0
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.fileToStream:(Ljava/lang/String;)Ljava/io/InputStream;
astore 4
start local 4 3: aload 1
aload 4
invokevirtual java.security.cert.CertificateFactory.generateCertificate:(Ljava/io/InputStream;)Ljava/security/cert/Certificate;
4: aload 4
ifnull 5
aload 4
invokevirtual java.io.InputStream.close:()V
5: StackMap locals: java.lang.String java.security.cert.CertificateFactory java.lang.Throwable java.lang.Throwable java.io.InputStream
StackMap stack: java.security.cert.Certificate
areturn
StackMap locals:
StackMap stack: java.lang.Throwable
6: astore 2
7: aload 4
ifnull 8
aload 4
invokevirtual java.io.InputStream.close:()V
end local 4 StackMap locals:
StackMap stack:
8: aload 2
athrow
StackMap locals:
StackMap stack: java.lang.Throwable
9: astore 3
aload 2
ifnonnull 10
aload 3
astore 2
goto 11
StackMap locals:
StackMap stack:
10: aload 2
aload 3
if_acmpeq 11
aload 2
aload 3
invokevirtual java.lang.Throwable.addSuppressed:(Ljava/lang/Throwable;)V
StackMap locals:
StackMap stack:
11: aload 2
athrow
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 certificatePem Ljava/lang/String;
1 12 1 certificateFactory Ljava/security/cert/CertificateFactory;
3 8 4 certStream Ljava/io/InputStream;
Exception table:
from to target type
3 4 6 any
2 5 9 any
6 9 9 any
Exceptions:
throws java.io.IOException, java.security.GeneralSecurityException, com.microsoft.sqlserver.jdbc.SQLServerException
MethodParameters:
Name Flags
certificatePem
private static java.security.PrivateKey loadPrivateKey(java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;Ljava/lang/String;)Ljava/security/PrivateKey;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=3, args_size=2
start local 0 start local 1 0: aload 0
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.getStringFromFile:(Ljava/lang/String;)Ljava/lang/String;
astore 2
start local 2 1: aload 2
ldc "-----BEGIN PRIVATE KEY-----"
invokevirtual java.lang.String.contains:(Ljava/lang/CharSequence;)Z
ifeq 3
2: aload 2
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.loadPrivateKeyFromPKCS8:(Ljava/lang/String;)Ljava/security/PrivateKey;
areturn
3: StackMap locals: java.lang.String
StackMap stack:
aload 2
ldc "-----BEGIN RSA PRIVATE KEY-----"
invokevirtual java.lang.String.contains:(Ljava/lang/CharSequence;)Z
ifeq 5
4: aload 2
aload 1
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.loadPrivateKeyFromPKCS1:(Ljava/lang/String;Ljava/lang/String;)Ljava/security/PrivateKey;
areturn
5: StackMap locals:
StackMap stack:
aload 0
aload 1
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.loadPrivateKeyFromPVK:(Ljava/lang/String;Ljava/lang/String;)Ljava/security/PrivateKey;
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 privateKeyPemPath Ljava/lang/String;
0 6 1 privateKeyPassword Ljava/lang/String;
1 6 2 privateKeyPem Ljava/lang/String;
Exceptions:
throws java.security.GeneralSecurityException, java.io.IOException, com.microsoft.sqlserver.jdbc.SQLServerException
MethodParameters:
Name Flags
privateKeyPemPath
privateKeyPassword
private static boolean startsWithMagic(byte[]);
descriptor: ([B)Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=2, args_size=1
start local 0 0: iconst_0
istore 1
start local 1 1: goto 5
2: StackMap locals: int
StackMap stack:
aload 0
iload 1
baload
getstatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.RSA2_MAGIC:[B
iload 1
baload
if_icmpeq 4
3: iconst_0
ireturn
4: StackMap locals:
StackMap stack:
iinc 1 1
StackMap locals:
StackMap stack:
5: iload 1
getstatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.RSA2_MAGIC:[B
arraylength
if_icmplt 2
end local 1 6: iconst_1
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 b [B
1 6 1 i I
MethodParameters:
Name Flags
b
private static byte[] getSecretKeyFromHash(byte[], byte[]);
descriptor: ([B[B)[B
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=6, locals=4, args_size=2
start local 0 start local 1 0: new javax.crypto.spec.SecretKeySpec
dup
aload 1
iconst_0
bipush 16
ldc "RC4"
invokespecial javax.crypto.spec.SecretKeySpec.<init>:([BIILjava/lang/String;)V
astore 2
start local 2 1: aload 2
aload 0
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.decryptSecretKey:(Ljavax/crypto/SecretKey;[B)[B
astore 3
start local 3 2: aload 3
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.startsWithMagic:([B)Z
ifeq 4
3: aload 3
areturn
4: StackMap locals: javax.crypto.SecretKey byte[]
StackMap stack:
aload 1
iconst_5
aload 1
arraylength
iconst_0
invokestatic java.util.Arrays.fill:([BIIB)V
5: new javax.crypto.spec.SecretKeySpec
dup
aload 1
iconst_0
bipush 16
ldc "RC4"
invokespecial javax.crypto.spec.SecretKeySpec.<init>:([BIILjava/lang/String;)V
astore 2
6: aload 2
aload 0
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.decryptSecretKey:(Ljavax/crypto/SecretKey;[B)[B
astore 3
7: aload 3
invokestatic com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils.startsWithMagic:([B)Z
ifeq 9
8: aload 3
areturn
9: StackMap locals:
StackMap stack:
aconst_null
aload 0
ldc "R_pvkParseError"
invokestatic com.microsoft.sqlserver.jdbc.SQLServerResource.getResource:(Ljava/lang/String;)Ljava/lang/String;
ldc ""
10: iconst_0
11: invokestatic com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError:(Lcom/microsoft/sqlserver/jdbc/SQLServerConnection;Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;Z)V
12: aconst_null
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 13 0 originalKey [B
0 13 1 keyHash [B
1 13 2 key Ljavax/crypto/SecretKey;
2 13 3 decrypted [B
Exceptions:
throws java.security.GeneralSecurityException, com.microsoft.sqlserver.jdbc.SQLServerException
MethodParameters:
Name Flags
originalKey
keyHash
private static byte[] decryptSecretKey(javax.crypto.SecretKey, byte[]);
descriptor: (Ljavax/crypto/SecretKey;[B)[B
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=3, args_size=2
start local 0 start local 1 0: aload 0
invokeinterface javax.crypto.SecretKey.getAlgorithm:()Ljava/lang/String;
invokestatic javax.crypto.Cipher.getInstance:(Ljava/lang/String;)Ljavax/crypto/Cipher;
astore 2
start local 2 1: aload 2
iconst_2
aload 0
invokevirtual javax.crypto.Cipher.init:(ILjava/security/Key;)V
2: aload 2
aload 1
invokevirtual javax.crypto.Cipher.doFinal:([B)[B
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 key Ljavax/crypto/SecretKey;
0 3 1 encoded [B
1 3 2 cipher Ljavax/crypto/Cipher;
Exceptions:
throws java.security.GeneralSecurityException
MethodParameters:
Name Flags
key
encoded
private static java.math.BigInteger getBigInteger(java.nio.ByteBuffer, int);
descriptor: (Ljava/nio/ByteBuffer;I)Ljava/math/BigInteger;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=4, args_size=2
start local 0 start local 1 0: iload 1
iconst_1
iadd
newarray 8
astore 2
start local 2 1: iconst_0
istore 3
start local 3 2: goto 5
3: StackMap locals: byte[] int
StackMap stack:
aload 2
aload 2
arraylength
iconst_1
isub
iload 3
isub
aload 0
invokevirtual java.nio.ByteBuffer.get:()B
bastore
4: iinc 3 1
StackMap locals:
StackMap stack:
5: iload 3
iload 1
if_icmplt 3
end local 3 6: new java.math.BigInteger
dup
aload 2
invokespecial java.math.BigInteger.<init>:([B)V
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 buffer Ljava/nio/ByteBuffer;
0 7 1 length I
1 7 2 array [B
2 6 3 i I
MethodParameters:
Name Flags
buffer
length
private static java.io.InputStream fileToStream(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/io/InputStream;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=6, locals=6, args_size=1
start local 0 0: aconst_null
astore 1
aconst_null
astore 2
1: new java.io.FileInputStream
dup
aload 0
invokespecial java.io.FileInputStream.<init>:(Ljava/lang/String;)V
astore 3
start local 3 2: new java.io.DataInputStream
dup
aload 3
invokespecial java.io.DataInputStream.<init>:(Ljava/io/InputStream;)V
astore 4
start local 4 3: aload 4
invokevirtual java.io.DataInputStream.available:()I
newarray 8
astore 5
start local 5 4: aload 4
aload 5
invokevirtual java.io.DataInputStream.readFully:([B)V
5: new java.io.ByteArrayInputStream
dup
aload 5
invokespecial java.io.ByteArrayInputStream.<init>:([B)V
6: aload 4
ifnull 7
aload 4
invokevirtual java.io.DataInputStream.close:()V
StackMap locals: java.lang.String java.lang.Throwable java.lang.Throwable java.io.FileInputStream java.io.DataInputStream byte[]
StackMap stack: java.io.ByteArrayInputStream
7: aload 3
ifnull 8
aload 3
invokevirtual java.io.FileInputStream.close:()V
8: StackMap locals:
StackMap stack: java.io.ByteArrayInputStream
areturn
end local 5 StackMap locals: java.lang.String java.lang.Throwable java.lang.Throwable java.io.FileInputStream java.io.DataInputStream
StackMap stack: java.lang.Throwable
9: astore 1
10: aload 4
ifnull 11
aload 4
invokevirtual java.io.DataInputStream.close:()V
end local 4 StackMap locals:
StackMap stack:
11: aload 1
athrow
StackMap locals:
StackMap stack: java.lang.Throwable
12: astore 2
aload 1
ifnonnull 13
aload 2
astore 1
goto 14
StackMap locals:
StackMap stack:
13: aload 1
aload 2
if_acmpeq 14
aload 1
aload 2
invokevirtual java.lang.Throwable.addSuppressed:(Ljava/lang/Throwable;)V
StackMap locals:
StackMap stack:
14: aload 3
ifnull 15
aload 3
invokevirtual java.io.FileInputStream.close:()V
end local 3 StackMap locals:
StackMap stack:
15: aload 1
athrow
StackMap locals:
StackMap stack: java.lang.Throwable
16: astore 2
aload 1
ifnonnull 17
aload 2
astore 1
goto 18
StackMap locals:
StackMap stack:
17: aload 1
aload 2
if_acmpeq 18
aload 1
aload 2
invokevirtual java.lang.Throwable.addSuppressed:(Ljava/lang/Throwable;)V
StackMap locals:
StackMap stack:
18: aload 1
athrow
StackMap locals: java.lang.String
StackMap stack: java.io.FileNotFoundException
19: pop
20: new com.microsoft.sqlserver.jdbc.SQLServerException
dup
ldc "R_clientCertError"
invokestatic com.microsoft.sqlserver.jdbc.SQLServerException.getErrString:(Ljava/lang/String;)Ljava/lang/String;
aconst_null
iconst_0
aconst_null
invokespecial com.microsoft.sqlserver.jdbc.SQLServerException.<init>:(Ljava/lang/String;Ljava/lang/String;ILjava/lang/Throwable;)V
athrow
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 21 0 fname Ljava/lang/String;
2 15 3 fis Ljava/io/FileInputStream;
3 11 4 dis Ljava/io/DataInputStream;
4 9 5 bytes [B
Exception table:
from to target type
3 6 9 any
2 7 12 any
9 12 12 any
1 8 16 any
9 16 16 any
0 8 19 Class java.io.FileNotFoundException
9 19 19 Class java.io.FileNotFoundException
Exceptions:
throws java.io.IOException, com.microsoft.sqlserver.jdbc.SQLServerException
MethodParameters:
Name Flags
fname
private static java.lang.String getStringFromFile(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/lang/String;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=1, args_size=1
start local 0 0: new java.lang.String
dup
aload 0
iconst_0
anewarray java.lang.String
invokestatic java.nio.file.Paths.get:(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;
invokestatic java.nio.file.Files.readAllBytes:(Ljava/nio/file/Path;)[B
invokespecial java.lang.String.<init>:([B)V
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 filePath Ljava/lang/String;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
filePath
}
SourceFile: "SQLServerCertificateUtils.java"
InnerClasses:
public Decoder = java.util.Base64$Decoder of java.util.Base64