com.groupbyinc.flux.common.settings.KeyStoreWrapper.class Maven / Gradle / Ivy
???? 4? 3com/groupbyinc/flux/common/settings/KeyStoreWrapper java/lang/Object 2com/groupbyinc/flux/common/settings/SecureSettings KeyStoreWrapper.java ;com/groupbyinc/flux/common/settings/KeyStoreWrapper$KeyType KeyType 5com/groupbyinc/flux/common/settings/KeyStoreWrapper$1 )java/security/KeyStore$PasswordProtection
java/security/KeyStore PasswordProtection java/security/KeyStore$Entry Entry %java/security/KeyStore$SecretKeyEntry SecretKeyEntry java/util/Map$Entry
java/util/Map *java/security/KeyStore$ProtectionParameter ProtectionParameter 4com/groupbyinc/flux/common/settings/Setting$Property +com/groupbyinc/flux/common/settings/Setting ! Property java/util/Base64$Decoder $ java/util/Base64 & Decoder java/util/Base64$Encoder ) Encoder %java/lang/invoke/MethodHandles$Lookup , java/lang/invoke/MethodHandles . Lookup SEED_SETTING -Lcom/groupbyinc/flux/common/settings/Setting; aLcom/groupbyinc/flux/common/settings/Setting;
SEED_CHARS [C KEYSTORE_FILENAME Ljava/lang/String; elasticsearch.keystore 8 FORMAT_VERSION I MIN_FORMAT_VERSION NEW_KEYSTORE_TYPE PKCS12 @ NEW_KEYSTORE_STRING_KEY_ALGO PBE C NEW_KEYSTORE_FILE_KEY_ALGO
ASCII_ENCODER !Ljava/nio/charset/CharsetEncoder;
formatVersion hasPassword Z type
stringFactory Ljavax/crypto/SecretKeyFactory; fileFactory settingTypes Ljava/util/Map; `Ljava/util/Map;
keystoreBytes [B keystore 7Lcom/groupbyinc/flux/common/apache/lucene/util/SetOnce; QLcom/groupbyinc/flux/common/apache/lucene/util/SetOnce; keystorePassword dLcom/groupbyinc/flux/common/apache/lucene/util/SetOnce; $assertionsDisabled L(IZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;[B)V &java/security/NoSuchAlgorithmException \ ()V Z ^
_ 5com/groupbyinc/flux/common/apache/lucene/util/SetOnce a
b _ T U d W U f H ; h I J j K 7 l javax/crypto/SecretKeyFactory n getInstance 3(Ljava/lang/String;)Ljavax/crypto/SecretKeyFactory; p q
o r L M t N M v java/lang/String x S java/lang/RuntimeException { (Ljava/lang/Throwable;)V Z }
| ~ O P ? R S ? e (Ljava/security/NoSuchAlgorithmException; this 5Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper;
stringKeyAlgo fileKeyAlgo keystorePath *(Ljava/nio/file/Path;)Ljava/nio/file/Path; java/nio/file/Path ? resolve ((Ljava/lang/String;)Ljava/nio/file/Path; ? ? ? ? configDir Ljava/nio/file/Path; create 9([C)Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper; java/lang/Exception ? 5 java/util/HashMap ?
? _ Z [
? ,(Ljava/lang/String;)Ljava/security/KeyStore; p ?
? load (Ljava/io/InputStream;[C)V ? ?
? set (Ljava/lang/Object;)V ? ?
b ? ([C)V Z ?
? addBootstrapSeed 8(Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper;)V ? ?
? password wrapper keyStore Ljava/security/KeyStore; &java/security/GeneralSecurityException ? Y J ? getSettingNames ()Ljava/util/Set; ? ?
? 1 2 ? getKey ()Ljava/lang/String; ? ?
" ?
java/util/Set ? contains (Ljava/lang/Object;)Z ? ? ? ? java/lang/AssertionError ?
? _ %com/groupbyinc/flux/common/Randomness ? createSecure ()Ljava/security/SecureRandom; ? ?
? ? java/security/SecureRandom ? 4 5 ? nextInt (I)I ? ?
? ? setString (Ljava/lang/String;[C)V ? ?
? java/util/Arrays ? fill ([CC)V ? ?
? ? i random Ljava/security/SecureRandom; passwordLength
characters K(Ljava/nio/file/Path;)Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper; java/io/IOException ? java/lang/Throwable ? ? ?
? java/nio/file/LinkOption ? java/nio/file/Files ? exists 2(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z ? ?
? ? @com/groupbyinc/flux/common/apache/lucene/store/SimpleFSDirectory ? (Ljava/nio/file/Path;)V Z ?
? ? 8com/groupbyinc/flux/common/apache/lucene/store/IOContext ? READONCE :Lcom/groupbyinc/flux/common/apache/lucene/store/IOContext; ? ? ? openInput ?(Ljava/lang/String;Lcom/groupbyinc/flux/common/apache/lucene/store/IOContext;)Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;
? Icom/groupbyinc/flux/common/apache/lucene/store/BufferedChecksumIndexInput >(Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;)V Z
9com/groupbyinc/flux/common/apache/lucene/codecs/CodecUtil checkHeader Q(Lcom/groupbyinc/flux/common/apache/lucene/store/DataInput;Ljava/lang/String;II)I
Acom/groupbyinc/flux/common/apache/lucene/store/ChecksumIndexInput readByte ()B
9com/groupbyinc/flux/common/apache/lucene/store/IndexInput java/lang/IllegalStateException java/lang/StringBuilder
_ hasPassword boolean is corrupt: append -(Ljava/lang/String;)Ljava/lang/StringBuilder; !
" java/util/Locale$ ROOT Ljava/util/Locale;&' %( %02x* java/lang/Byte, valueOf (B)Ljava/lang/Byte;./
-0 format K(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;23
y4 toString6 ?
7 (Ljava/lang/String;)V Z9
:
readString<