public class org.apache.zookeeper.common.X509TestContext extends java.lang.Object
{
private static final java.lang.String TRUST_STORE_PREFIX;
private static final java.lang.String KEY_STORE_PREFIX;
private final java.io.File tempDir;
private final org.apache.zookeeper.common.X509KeyType trustStoreKeyType;
private final java.security.KeyPair trustStoreKeyPair;
private final long trustStoreCertExpirationMillis;
private final java.security.cert.X509Certificate trustStoreCertificate;
private final java.lang.String trustStorePassword;
private java.io.File trustStoreJksFile;
private java.io.File trustStorePemFile;
private java.io.File trustStorePkcs12File;
private java.io.File trustStoreBcfksFile;
private final org.apache.zookeeper.common.X509KeyType keyStoreKeyType;
private final java.security.KeyPair keyStoreKeyPair;
private final long keyStoreCertExpirationMillis;
private final java.security.cert.X509Certificate keyStoreCertificate;
private final java.lang.String keyStorePassword;
private java.io.File keyStoreJksFile;
private java.io.File keyStorePemFile;
private java.io.File keyStorePkcs12File;
private java.io.File keyStoreBcfksFile;
private final java.lang.Boolean hostnameVerification;
private void <init>(java.io.File, java.security.KeyPair, long, java.lang.String, java.security.KeyPair, long, java.lang.String, java.lang.Boolean) throws java.io.IOException, java.security.GeneralSecurityException, org.bouncycastle.operator.OperatorCreationException
{
java.security.cert.X509Certificate v, v, v;
java.lang.IllegalStateException v;
java.security.KeyPair v, v;
org.apache.zookeeper.common.X509TestContext v;
org.bouncycastle.asn.x.X500Name v, v;
org.bouncycastle.asn.x.X500NameStyle v, v;
org.bouncycastle.asn.ASN1ObjectIdentifier v, v;
boolean v;
java.lang.invoke.MethodHandles$Lookup v, v;
java.security.Provider v;
long v, v;
java.lang.Boolean v;
java.lang.String v, v, v, v, v, v, v;
org.bouncycastle.asn.x.X500NameBuilder v, v;
java.security.PublicKey v;
java.lang.IllegalArgumentException v;
java.io.File v;
org.apache.zookeeper.common.X509KeyType v, v;
java.lang.Class v, v;
java.lang.Object v, v, v, v, v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v := @parameter: java.io.File;
v := @parameter: java.security.KeyPair;
v := @parameter: long;
v := @parameter: java.lang.String;
v := @parameter: java.security.KeyPair;
v := @parameter: long;
v := @parameter: java.lang.String;
v := @parameter: java.lang.Boolean;
specialinvoke v.<java.lang.Object: void <init>()>();
v = staticinvoke <java.security.Security: java.security.Provider getProvider(java.lang.String)>("BC");
if v != null goto label;
v = new java.lang.IllegalStateException;
specialinvoke v.<java.lang.IllegalStateException: void <init>(java.lang.String)>("BC Security provider was not found");
throw v;
label:
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object)>(v);
v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir> = v;
v = virtualinvoke v.<java.io.File: boolean isDirectory()>();
if v != 0 goto label;
v = new java.lang.IllegalArgumentException;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.io.File)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Not a directory: \u0001");
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>(v);
throw v;
label:
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object)>(v);
v.<org.apache.zookeeper.common.X509TestContext: java.security.KeyPair trustStoreKeyPair> = v;
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: org.apache.zookeeper.common.X509KeyType keyPairToType(java.security.KeyPair)>(v);
v.<org.apache.zookeeper.common.X509TestContext: org.apache.zookeeper.common.X509KeyType trustStoreKeyType> = v;
v.<org.apache.zookeeper.common.X509TestContext: long trustStoreCertExpirationMillis> = v;
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object)>(v);
v.<org.apache.zookeeper.common.X509TestContext: java.lang.String trustStorePassword> = v;
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object)>(v);
v.<org.apache.zookeeper.common.X509TestContext: java.security.KeyPair keyStoreKeyPair> = v;
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: org.apache.zookeeper.common.X509KeyType keyPairToType(java.security.KeyPair)>(v);
v.<org.apache.zookeeper.common.X509TestContext: org.apache.zookeeper.common.X509KeyType keyStoreKeyType> = v;
v.<org.apache.zookeeper.common.X509TestContext: long keyStoreCertExpirationMillis> = v;
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object)>(v);
v.<org.apache.zookeeper.common.X509TestContext: java.lang.String keyStorePassword> = v;
v = new org.bouncycastle.asn.x.X500NameBuilder;
v = <org.bouncycastle.asn.x.style.BCStyle: org.bouncycastle.asn.x.X500NameStyle INSTANCE>;
specialinvoke v.<org.bouncycastle.asn.x.X500NameBuilder: void <init>(org.bouncycastle.asn.x.X500NameStyle)>(v);
v = <org.bouncycastle.asn.x.style.BCStyle: org.bouncycastle.asn.ASN1ObjectIdentifier CN>;
v = staticinvoke <java.lang.invoke.MethodHandles: java.lang.invoke.MethodHandles$Lookup lookup()>();
v = virtualinvoke v.<java.lang.invoke.MethodHandles$Lookup: java.lang.Class lookupClass()>();
v = virtualinvoke v.<java.lang.Class: java.lang.String getCanonicalName()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u Root CA");
virtualinvoke v.<org.bouncycastle.asn.x.X500NameBuilder: org.bouncycastle.asn.x.X500NameBuilder addRDN(org.bouncycastle.asn.ASN1ObjectIdentifier,java.lang.String)>(v, v);
v = virtualinvoke v.<org.bouncycastle.asn.x.X500NameBuilder: org.bouncycastle.asn.x.X500Name build()>();
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: java.security.cert.X509Certificate newSelfSignedCACert(org.bouncycastle.asn.x.X500Name,java.security.KeyPair,long)>(v, v, v);
v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate trustStoreCertificate> = v;
v = new org.bouncycastle.asn.x.X500NameBuilder;
v = <org.bouncycastle.asn.x.style.BCStyle: org.bouncycastle.asn.x.X500NameStyle INSTANCE>;
specialinvoke v.<org.bouncycastle.asn.x.X500NameBuilder: void <init>(org.bouncycastle.asn.x.X500NameStyle)>(v);
v = <org.bouncycastle.asn.x.style.BCStyle: org.bouncycastle.asn.ASN1ObjectIdentifier CN>;
v = staticinvoke <java.lang.invoke.MethodHandles: java.lang.invoke.MethodHandles$Lookup lookup()>();
v = virtualinvoke v.<java.lang.invoke.MethodHandles$Lookup: java.lang.Class lookupClass()>();
v = virtualinvoke v.<java.lang.Class: java.lang.String getCanonicalName()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u Zookeeper Test");
virtualinvoke v.<org.bouncycastle.asn.x.X500NameBuilder: org.bouncycastle.asn.x.X500NameBuilder addRDN(org.bouncycastle.asn.ASN1ObjectIdentifier,java.lang.String)>(v, v);
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate trustStoreCertificate>;
v = virtualinvoke v.<org.bouncycastle.asn.x.X500NameBuilder: org.bouncycastle.asn.x.X500Name build()>();
v = virtualinvoke v.<java.security.KeyPair: java.security.PublicKey getPublic()>();
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: java.security.cert.X509Certificate newCert(java.security.cert.X509Certificate,java.security.KeyPair,org.bouncycastle.asn.x.X500Name,java.security.PublicKey,long)>(v, v, v, v, v);
v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate keyStoreCertificate> = v;
v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStoreJksFile> = null;
v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStorePemFile> = null;
v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStorePkcs12File> = null;
v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStoreJksFile> = null;
v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStorePemFile> = null;
v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStorePkcs12File> = null;
v.<org.apache.zookeeper.common.X509TestContext: java.lang.Boolean hostnameVerification> = v;
return;
}
private org.apache.zookeeper.common.X509KeyType keyPairToType(java.security.KeyPair)
{
java.security.KeyPair v;
org.apache.zookeeper.common.X509TestContext v;
org.apache.zookeeper.common.X509KeyType v, v;
java.security.PrivateKey v;
java.lang.String v;
boolean v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v := @parameter: java.security.KeyPair;
v = virtualinvoke v.<java.security.KeyPair: java.security.PrivateKey getPrivate()>();
v = interfaceinvoke v.<java.security.PrivateKey: java.lang.String getAlgorithm()>();
v = virtualinvoke v.<java.lang.String: boolean contains(java.lang.CharSequence)>("RSA");
if v == 0 goto label;
v = <org.apache.zookeeper.common.X509KeyType: org.apache.zookeeper.common.X509KeyType RSA>;
return v;
label:
v = <org.apache.zookeeper.common.X509KeyType: org.apache.zookeeper.common.X509KeyType EC>;
return v;
}
public java.io.File getTempDir()
{
org.apache.zookeeper.common.X509TestContext v;
java.io.File v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir>;
return v;
}
public org.apache.zookeeper.common.X509KeyType getTrustStoreKeyType()
{
org.apache.zookeeper.common.X509TestContext v;
org.apache.zookeeper.common.X509KeyType v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: org.apache.zookeeper.common.X509KeyType trustStoreKeyType>;
return v;
}
public java.security.KeyPair getTrustStoreKeyPair()
{
java.security.KeyPair v;
org.apache.zookeeper.common.X509TestContext v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.KeyPair trustStoreKeyPair>;
return v;
}
public long getTrustStoreCertExpirationMillis()
{
org.apache.zookeeper.common.X509TestContext v;
long v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: long trustStoreCertExpirationMillis>;
return v;
}
public java.security.cert.X509Certificate getTrustStoreCertificate()
{
java.security.cert.X509Certificate v;
org.apache.zookeeper.common.X509TestContext v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate trustStoreCertificate>;
return v;
}
public java.lang.String getTrustStorePassword()
{
org.apache.zookeeper.common.X509TestContext v;
java.lang.String v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String trustStorePassword>;
return v;
}
public java.io.File getTrustStoreFile(org.apache.zookeeper.common.KeyStoreFileType) throws java.io.IOException
{
org.apache.zookeeper.common.X509TestContext v;
java.lang.IllegalArgumentException v;
java.io.File v, v, v, v;
org.apache.zookeeper.common.KeyStoreFileType[] v;
int[] v;
int v, v;
java.lang.String v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v := @parameter: org.apache.zookeeper.common.KeyStoreFileType;
v = <org.apache.zookeeper.common.X509TestContext$1: int[] $SwitchMap$org$apache$zookeeper$common$KeyStoreFileType>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: int ordinal()>();
v = v[v];
tableswitch(v)
{
case 1: goto label;
case 2: goto label;
case 3: goto label;
case 4: goto label;
default: goto label;
};
label:
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getTrustStoreJksFile()>();
return v;
label:
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getTrustStorePemFile()>();
return v;
label:
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getTrustStorePkcs12File()>();
return v;
label:
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getTrustStoreBcfksFile()>();
return v;
label:
v = new java.lang.IllegalArgumentException;
v = staticinvoke <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType[] values()>();
v = staticinvoke <java.util.Arrays: java.lang.String toString(java.lang.Object[])>(v);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (org.apache.zookeeper.common.KeyStoreFileType,java.lang.String)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Invalid trust store type: \u, must be one of: \u0001");
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>(v);
throw v;
}
private java.io.File getTrustStoreJksFile() throws java.io.IOException
{
java.lang.Throwable v;
java.security.cert.X509Certificate v;
byte[] v;
org.apache.zookeeper.common.X509TestContext v;
java.io.FileOutputStream v;
java.io.IOException v;
java.io.File v, v, v, v;
java.security.GeneralSecurityException v;
java.lang.String v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStoreJksFile>;
if v != null goto label;
v = <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType JKS>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getDefaultFileExtension()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir>;
v = staticinvoke <java.io.File: java.io.File createTempFile(java.lang.String,java.lang.String,java.io.File)>("zk_test_ca", v, v);
virtualinvoke v.<java.io.File: void deleteOnExit()>();
label:
v = new java.io.FileOutputStream;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File)>(v);
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate trustStoreCertificate>;
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String trustStorePassword>;
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: byte[] certToJavaTrustStoreBytes(java.security.cert.X509Certificate,java.lang.String)>(v, v);
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
virtualinvoke v.<java.io.FileOutputStream: void flush()>();
label:
virtualinvoke v.<java.io.FileOutputStream: void close()>();
goto label;
label:
v := @caughtexception;
throw v;
label:
v := @caughtexception;
v = new java.io.IOException;
specialinvoke v.<java.io.IOException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStoreJksFile> = v;
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStoreJksFile>;
return v;
catch java.lang.Throwable from label to label with label;
catch java.security.GeneralSecurityException from label to label with label;
}
private java.io.File getTrustStorePemFile() throws java.io.IOException
{
java.security.cert.X509Certificate v;
org.apache.zookeeper.common.X509TestContext v;
java.io.File v, v, v, v;
java.nio.charset.Charset v;
java.lang.String v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStorePemFile>;
if v != null goto label;
v = <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType PEM>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getDefaultFileExtension()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir>;
v = staticinvoke <java.io.File: java.io.File createTempFile(java.lang.String,java.lang.String,java.io.File)>("zk_test_ca", v, v);
virtualinvoke v.<java.io.File: void deleteOnExit()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate trustStoreCertificate>;
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: java.lang.String pemEncodeX509Certificate(java.security.cert.X509Certificate)>(v);
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset US_ASCII>;
staticinvoke <org.apache.commons.io.FileUtils: void writeStringToFile(java.io.File,java.lang.String,java.nio.charset.Charset,boolean)>(v, v, v, 0);
v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStorePemFile> = v;
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStorePemFile>;
return v;
}
private java.io.File getTrustStorePkcs12File() throws java.io.IOException
{
java.lang.Throwable v;
java.security.cert.X509Certificate v;
byte[] v;
org.apache.zookeeper.common.X509TestContext v;
java.io.FileOutputStream v;
java.io.IOException v;
java.io.File v, v, v, v;
java.security.GeneralSecurityException v;
java.lang.String v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStorePkcs12File>;
if v != null goto label;
v = <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType PKCS12>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getDefaultFileExtension()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir>;
v = staticinvoke <java.io.File: java.io.File createTempFile(java.lang.String,java.lang.String,java.io.File)>("zk_test_ca", v, v);
virtualinvoke v.<java.io.File: void deleteOnExit()>();
label:
v = new java.io.FileOutputStream;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File)>(v);
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate trustStoreCertificate>;
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String trustStorePassword>;
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: byte[] certToPKCS12TrustStoreBytes(java.security.cert.X509Certificate,java.lang.String)>(v, v);
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
virtualinvoke v.<java.io.FileOutputStream: void flush()>();
label:
virtualinvoke v.<java.io.FileOutputStream: void close()>();
goto label;
label:
v := @caughtexception;
throw v;
label:
v := @caughtexception;
v = new java.io.IOException;
specialinvoke v.<java.io.IOException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStorePkcs12File> = v;
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStorePkcs12File>;
return v;
catch java.lang.Throwable from label to label with label;
catch java.security.GeneralSecurityException from label to label with label;
}
private java.io.File getTrustStoreBcfksFile() throws java.io.IOException
{
java.lang.Throwable v;
java.security.cert.X509Certificate v;
byte[] v;
org.apache.zookeeper.common.X509TestContext v;
java.io.FileOutputStream v;
java.io.IOException v;
java.io.File v, v, v, v;
java.security.GeneralSecurityException v;
java.lang.String v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStoreBcfksFile>;
if v != null goto label;
v = <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType BCFKS>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getDefaultFileExtension()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir>;
v = staticinvoke <java.io.File: java.io.File createTempFile(java.lang.String,java.lang.String,java.io.File)>("zk_test_ca", v, v);
virtualinvoke v.<java.io.File: void deleteOnExit()>();
label:
v = new java.io.FileOutputStream;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File)>(v);
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate trustStoreCertificate>;
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String trustStorePassword>;
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: byte[] certToBCFKSTrustStoreBytes(java.security.cert.X509Certificate,java.lang.String)>(v, v);
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
virtualinvoke v.<java.io.FileOutputStream: void flush()>();
label:
virtualinvoke v.<java.io.FileOutputStream: void close()>();
goto label;
label:
v := @caughtexception;
throw v;
label:
v := @caughtexception;
v = new java.io.IOException;
specialinvoke v.<java.io.IOException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStoreBcfksFile> = v;
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File trustStoreBcfksFile>;
return v;
catch java.lang.Throwable from label to label with label;
catch java.security.GeneralSecurityException from label to label with label;
}
public org.apache.zookeeper.common.X509KeyType getKeyStoreKeyType()
{
org.apache.zookeeper.common.X509TestContext v;
org.apache.zookeeper.common.X509KeyType v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: org.apache.zookeeper.common.X509KeyType keyStoreKeyType>;
return v;
}
public java.security.KeyPair getKeyStoreKeyPair()
{
java.security.KeyPair v;
org.apache.zookeeper.common.X509TestContext v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.KeyPair keyStoreKeyPair>;
return v;
}
public long getKeyStoreCertExpirationMillis()
{
org.apache.zookeeper.common.X509TestContext v;
long v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: long keyStoreCertExpirationMillis>;
return v;
}
public java.security.cert.X509Certificate getKeyStoreCertificate()
{
java.security.cert.X509Certificate v;
org.apache.zookeeper.common.X509TestContext v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate keyStoreCertificate>;
return v;
}
public java.lang.String getKeyStorePassword()
{
org.apache.zookeeper.common.X509TestContext v;
java.lang.String v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String keyStorePassword>;
return v;
}
public boolean isKeyStoreEncrypted()
{
org.apache.zookeeper.common.X509TestContext v;
int v;
java.lang.String v;
boolean v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String keyStorePassword>;
v = virtualinvoke v.<java.lang.String: int length()>();
if v <= 0 goto label;
v = 1;
goto label;
label:
v = 0;
label:
return v;
}
public java.io.File getKeyStoreFile(org.apache.zookeeper.common.KeyStoreFileType) throws java.io.IOException
{
org.apache.zookeeper.common.X509TestContext v;
java.lang.IllegalArgumentException v;
java.io.File v, v, v, v;
org.apache.zookeeper.common.KeyStoreFileType[] v;
int[] v;
int v, v;
java.lang.String v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v := @parameter: org.apache.zookeeper.common.KeyStoreFileType;
v = <org.apache.zookeeper.common.X509TestContext$1: int[] $SwitchMap$org$apache$zookeeper$common$KeyStoreFileType>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: int ordinal()>();
v = v[v];
tableswitch(v)
{
case 1: goto label;
case 2: goto label;
case 3: goto label;
case 4: goto label;
default: goto label;
};
label:
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getKeyStoreJksFile()>();
return v;
label:
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getKeyStorePemFile()>();
return v;
label:
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getKeyStorePkcs12File()>();
return v;
label:
v = specialinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getKeyStoreBcfksFile()>();
return v;
label:
v = new java.lang.IllegalArgumentException;
v = staticinvoke <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType[] values()>();
v = staticinvoke <java.util.Arrays: java.lang.String toString(java.lang.Object[])>(v);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (org.apache.zookeeper.common.KeyStoreFileType,java.lang.String)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Invalid key store type: \u, must be one of: \u0001");
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>(v);
throw v;
}
private java.io.File getKeyStoreJksFile() throws java.io.IOException
{
java.lang.Throwable v;
java.security.cert.X509Certificate v;
byte[] v;
java.security.KeyPair v;
org.apache.zookeeper.common.X509TestContext v;
java.security.GeneralSecurityException v;
java.lang.String v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
java.io.FileOutputStream v;
java.io.IOException v;
java.io.File v, v, v, v;
java.security.PrivateKey v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStoreJksFile>;
if v != null goto label;
v = <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType JKS>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getDefaultFileExtension()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir>;
v = staticinvoke <java.io.File: java.io.File createTempFile(java.lang.String,java.lang.String,java.io.File)>("zk_test_key", v, v);
virtualinvoke v.<java.io.File: void deleteOnExit()>();
label:
v = new java.io.FileOutputStream;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File)>(v);
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate keyStoreCertificate>;
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.KeyPair keyStoreKeyPair>;
v = virtualinvoke v.<java.security.KeyPair: java.security.PrivateKey getPrivate()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String keyStorePassword>;
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: byte[] certAndPrivateKeyToJavaKeyStoreBytes(java.security.cert.X509Certificate,java.security.PrivateKey,java.lang.String)>(v, v, v);
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
virtualinvoke v.<java.io.FileOutputStream: void flush()>();
label:
virtualinvoke v.<java.io.FileOutputStream: void close()>();
goto label;
label:
v := @caughtexception;
throw v;
label:
v := @caughtexception;
v = new java.io.IOException;
specialinvoke v.<java.io.IOException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStoreJksFile> = v;
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStoreJksFile>;
return v;
catch java.lang.Throwable from label to label with label;
catch java.security.GeneralSecurityException from label to label with label;
}
private java.io.File getKeyStorePemFile() throws java.io.IOException
{
java.lang.Throwable v;
java.security.cert.X509Certificate v;
java.security.KeyPair v;
org.apache.zookeeper.common.X509TestContext v;
java.io.IOException v;
java.io.File v, v, v, v;
java.nio.charset.Charset v;
java.security.PrivateKey v;
java.lang.String v, v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStorePemFile>;
if v != null goto label;
label:
v = <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType PEM>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getDefaultFileExtension()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir>;
v = staticinvoke <java.io.File: java.io.File createTempFile(java.lang.String,java.lang.String,java.io.File)>("zk_test_key", v, v);
virtualinvoke v.<java.io.File: void deleteOnExit()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate keyStoreCertificate>;
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.KeyPair keyStoreKeyPair>;
v = virtualinvoke v.<java.security.KeyPair: java.security.PrivateKey getPrivate()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String keyStorePassword>;
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: java.lang.String pemEncodeCertAndPrivateKey(java.security.cert.X509Certificate,java.security.PrivateKey,java.lang.String)>(v, v, v);
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset US_ASCII>;
staticinvoke <org.apache.commons.io.FileUtils: void writeStringToFile(java.io.File,java.lang.String,java.nio.charset.Charset,boolean)>(v, v, v, 0);
v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStorePemFile> = v;
label:
goto label;
label:
v := @caughtexception;
v = new java.io.IOException;
specialinvoke v.<java.io.IOException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStorePemFile>;
return v;
catch org.bouncycastle.operator.OperatorCreationException from label to label with label;
}
private java.io.File getKeyStorePkcs12File() throws java.io.IOException
{
java.lang.Throwable v;
java.security.cert.X509Certificate v;
byte[] v;
java.security.KeyPair v;
org.apache.zookeeper.common.X509TestContext v;
java.security.GeneralSecurityException v;
java.lang.String v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
java.io.FileOutputStream v;
java.io.IOException v;
java.io.File v, v, v, v;
java.security.PrivateKey v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStorePkcs12File>;
if v != null goto label;
v = <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType PKCS12>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getDefaultFileExtension()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir>;
v = staticinvoke <java.io.File: java.io.File createTempFile(java.lang.String,java.lang.String,java.io.File)>("zk_test_key", v, v);
virtualinvoke v.<java.io.File: void deleteOnExit()>();
label:
v = new java.io.FileOutputStream;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File)>(v);
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate keyStoreCertificate>;
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.KeyPair keyStoreKeyPair>;
v = virtualinvoke v.<java.security.KeyPair: java.security.PrivateKey getPrivate()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String keyStorePassword>;
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: byte[] certAndPrivateKeyToPKCS12Bytes(java.security.cert.X509Certificate,java.security.PrivateKey,java.lang.String)>(v, v, v);
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
virtualinvoke v.<java.io.FileOutputStream: void flush()>();
label:
virtualinvoke v.<java.io.FileOutputStream: void close()>();
goto label;
label:
v := @caughtexception;
throw v;
label:
v := @caughtexception;
v = new java.io.IOException;
specialinvoke v.<java.io.IOException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStorePkcs12File> = v;
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStorePkcs12File>;
return v;
catch java.lang.Throwable from label to label with label;
catch java.security.GeneralSecurityException from label to label with label;
}
private java.io.File getKeyStoreBcfksFile() throws java.io.IOException
{
java.lang.Throwable v;
java.security.cert.X509Certificate v;
byte[] v;
java.security.KeyPair v;
org.apache.zookeeper.common.X509TestContext v;
java.security.GeneralSecurityException v;
java.lang.String v, v;
org.apache.zookeeper.common.KeyStoreFileType v;
java.io.FileOutputStream v;
java.io.IOException v;
java.io.File v, v, v, v;
java.security.PrivateKey v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStoreBcfksFile>;
if v != null goto label;
v = <org.apache.zookeeper.common.KeyStoreFileType: org.apache.zookeeper.common.KeyStoreFileType BCFKS>;
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getDefaultFileExtension()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File tempDir>;
v = staticinvoke <java.io.File: java.io.File createTempFile(java.lang.String,java.lang.String,java.io.File)>("zk_test_key", v, v);
virtualinvoke v.<java.io.File: void deleteOnExit()>();
label:
v = new java.io.FileOutputStream;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File)>(v);
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.cert.X509Certificate keyStoreCertificate>;
v = v.<org.apache.zookeeper.common.X509TestContext: java.security.KeyPair keyStoreKeyPair>;
v = virtualinvoke v.<java.security.KeyPair: java.security.PrivateKey getPrivate()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.String keyStorePassword>;
v = staticinvoke <org.apache.zookeeper.common.X509TestHelpers: byte[] certAndPrivateKeyToBCFKSBytes(java.security.cert.X509Certificate,java.security.PrivateKey,java.lang.String)>(v, v, v);
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
virtualinvoke v.<java.io.FileOutputStream: void flush()>();
label:
virtualinvoke v.<java.io.FileOutputStream: void close()>();
goto label;
label:
v := @caughtexception;
throw v;
label:
v := @caughtexception;
v = new java.io.IOException;
specialinvoke v.<java.io.IOException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStoreBcfksFile> = v;
label:
v = v.<org.apache.zookeeper.common.X509TestContext: java.io.File keyStoreBcfksFile>;
return v;
catch java.lang.Throwable from label to label with label;
catch java.security.GeneralSecurityException from label to label with label;
}
public void setSystemProperties(org.apache.zookeeper.common.X509Util, org.apache.zookeeper.common.KeyStoreFileType, org.apache.zookeeper.common.KeyStoreFileType) throws java.io.IOException
{
org.apache.zookeeper.common.X509TestContext v;
java.lang.Boolean v, v;
java.lang.String v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
org.apache.zookeeper.common.KeyStoreFileType v, v;
org.apache.zookeeper.common.X509Util v;
java.io.File v, v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v := @parameter: org.apache.zookeeper.common.X509Util;
v := @parameter: org.apache.zookeeper.common.KeyStoreFileType;
v := @parameter: org.apache.zookeeper.common.KeyStoreFileType;
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslKeystoreLocationProperty()>();
v = virtualinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getKeyStoreFile(org.apache.zookeeper.common.KeyStoreFileType)>(v);
v = virtualinvoke v.<java.io.File: java.lang.String getAbsolutePath()>();
staticinvoke <java.lang.System: java.lang.String setProperty(java.lang.String,java.lang.String)>(v, v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslKeystorePasswdProperty()>();
v = virtualinvoke v.<org.apache.zookeeper.common.X509TestContext: java.lang.String getKeyStorePassword()>();
staticinvoke <java.lang.System: java.lang.String setProperty(java.lang.String,java.lang.String)>(v, v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslKeystoreTypeProperty()>();
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getPropertyValue()>();
staticinvoke <java.lang.System: java.lang.String setProperty(java.lang.String,java.lang.String)>(v, v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslTruststoreLocationProperty()>();
v = virtualinvoke v.<org.apache.zookeeper.common.X509TestContext: java.io.File getTrustStoreFile(org.apache.zookeeper.common.KeyStoreFileType)>(v);
v = virtualinvoke v.<java.io.File: java.lang.String getAbsolutePath()>();
staticinvoke <java.lang.System: java.lang.String setProperty(java.lang.String,java.lang.String)>(v, v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslTruststorePasswdProperty()>();
v = virtualinvoke v.<org.apache.zookeeper.common.X509TestContext: java.lang.String getTrustStorePassword()>();
staticinvoke <java.lang.System: java.lang.String setProperty(java.lang.String,java.lang.String)>(v, v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslTruststoreTypeProperty()>();
v = virtualinvoke v.<org.apache.zookeeper.common.KeyStoreFileType: java.lang.String getPropertyValue()>();
staticinvoke <java.lang.System: java.lang.String setProperty(java.lang.String,java.lang.String)>(v, v);
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.Boolean hostnameVerification>;
if v == null goto label;
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslHostnameVerificationEnabledProperty()>();
v = v.<org.apache.zookeeper.common.X509TestContext: java.lang.Boolean hostnameVerification>;
v = virtualinvoke v.<java.lang.Boolean: java.lang.String toString()>();
staticinvoke <java.lang.System: java.lang.String setProperty(java.lang.String,java.lang.String)>(v, v);
goto label;
label:
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslHostnameVerificationEnabledProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
label:
return;
}
public void clearSystemProperties(org.apache.zookeeper.common.X509Util)
{
org.apache.zookeeper.common.X509TestContext v;
org.apache.zookeeper.common.X509Util v;
java.lang.String v, v, v, v, v, v, v, v, v;
v := @this: org.apache.zookeeper.common.X509TestContext;
v := @parameter: org.apache.zookeeper.common.X509Util;
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslKeystoreLocationProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslKeystorePasswdProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslKeystorePasswdPathProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslKeystoreTypeProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslTruststoreLocationProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslTruststorePasswdProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslTruststorePasswdPathProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslTruststoreTypeProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.zookeeper.common.X509Util: java.lang.String getSslHostnameVerificationEnabledProperty()>();
staticinvoke <java.lang.System: java.lang.String clearProperty(java.lang.String)>(v);
return;
}
public static org.apache.zookeeper.common.X509TestContext$Builder newBuilder()
{
org.apache.zookeeper.common.X509TestContext$Builder v;
v = new org.apache.zookeeper.common.X509TestContext$Builder;
specialinvoke v.<org.apache.zookeeper.common.X509TestContext$Builder: void <init>()>();
return v;
}
}