All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.groupbyinc.flux.common.settings.KeyStoreWrapper.class Maven / Gradle / Ivy

There is a newer version: 198
Show newest version
????4t3com/groupbyinc/flux/common/settings/KeyStoreWrapperjava/lang/Object2com/groupbyinc/flux/common/settings/SecureSettingsKeyStoreWrapper.java9com/groupbyinc/flux/common/settings/KeyStoreWrapper$EntryEntry=com/groupbyinc/flux/common/settings/KeyStoreWrapper$EntryType	EntryTypejava/util/Map$Entry
java/util/Map%java/security/KeyStore$SecretKeyEntryjava/security/KeyStoreSecretKeyEntry)java/security/KeyStore$PasswordProtectionPasswordProtection4com/groupbyinc/flux/common/settings/Setting$Property+com/groupbyinc/flux/common/settings/SettingProperty*java/security/KeyStore$ProtectionParameterProtectionParameterjava/security/KeyStore$Entry"java/util/Base64$Decoder$java/util/Base64&DecoderALLOWED_SETTING_NAMELjava/util/regex/Pattern;SEED_SETTING-Lcom/groupbyinc/flux/common/settings/Setting;aLcom/groupbyinc/flux/common/settings/Setting;
SEED_CHARS[CKEYSTORE_FILENAMELjava/lang/String;elasticsearch.keystore2FORMAT_VERSIONIMIN_FORMAT_VERSIONKDF_ALGOPBKDF2WithHmacSHA512:	KDF_ITERS'CIPHER_KEY_BITS?GCM_TAG_BITSCIPHER_ALGOAESBCIPHER_MODEGCMECIPHER_PADDING	NoPaddingH
formatVersionhasPasswordZ	dataBytes[Bentries7Lcom/groupbyinc/flux/common/apache/lucene/util/SetOnce;?Lcom/groupbyinc/flux/common/apache/lucene/util/SetOnce;>;closed$assertionsDisabled(IZ[B)V()VTV
W5com/groupbyinc/flux/common/apache/lucene/util/SetOnceY
ZWOP	\J5	^KL	`MN	bthis5Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper;getFormatVersion()IkeystorePath*(Ljava/nio/file/Path;)Ljava/nio/file/Path;java/nio/file/Pathjresolve((Ljava/lang/String;)Ljava/nio/file/Path;lmkn	configDirLjava/nio/file/Path;create7()Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper;TU
tjava/util/HashMapv
wWset(Ljava/lang/Object;)Vyz
Z{addBootstrapSeed8(Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper;)V}~
wrapperSL	?getSettingNames()Ljava/util/Set;??
?+,	?getKey()Ljava/lang/String;??
?
java/util/Set?contains(Ljava/lang/Object;)Z????java/lang/AssertionError?
?W%com/groupbyinc/flux/common/Randomness?createSecure()Ljava/security/SecureRandom;??
??java/security/SecureRandom?/./	?nextInt(I)I??
??	setString(Ljava/lang/String;[C)V??
?java/util/Arrays?fill([CC)V??
??irandomLjava/security/SecureRandom;passwordLength
charactersloadK(Ljava/nio/file/Path;)Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper;java/io/IOException?java/lang/Throwable?hi
?java/nio/file/LinkOption?java/nio/file/Files?exists2(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z??
??@com/groupbyinc/flux/common/apache/lucene/store/SimpleFSDirectory?(Ljava/nio/file/Path;)VT?
??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T?
??9com/groupbyinc/flux/common/apache/lucene/codecs/CodecUtil?checkHeaderQ(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?
?W hasPassword boolean is corrupt: ?append-(Ljava/lang/String;)Ljava/lang/StringBuilder;??
??java/util/Locale?ROOTLjava/util/Locale;??	??%02x?java/lang/Byte?valueOf(B)Ljava/lang/Byte;??
??java/lang/StringformatK(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
toString?
?(Ljava/lang/String;)VT	
?

readString?
?
PKCS12equals?
5Corrupted legacy keystore string encryption algorithmPBE3Corrupted legacy keystore file encryption algorithmreadMapOfStrings()Ljava/util/Map;
?java/io/ByteArrayOutputStream
Wjava/io/DataOutputStream!(Ljava/io/OutputStream;)VT#
"$size&g'writeInt(I)V)*
"+entrySet-?.iterator()Ljava/util/Iterator;01?2java/util/Iterator4hasNext()Z6758next()Ljava/lang/Object;:;5<?;>writeUTF@	
"AgetValueC;DreadIntFg
?G	readBytes([BII)VIJ
?Kwrite([B)VMN
"O$closeResource1(Ljava/lang/Throwable;Ljava/lang/AutoCloseable;)VQR
StoByteArray()[BUV
WNcheckFooterF(Lcom/groupbyinc/flux/common/apache/lucene/store/ChecksumIndexInput;)JZ[
?\fileKeyAlgotype
stringKeyAlgoentry;Ljava/util/Map$Entry;Ljava/util/Map$Entry;keystoreLen
keystoreBytesoutputLjava/io/DataOutputStream;settingTypes5Ljava/util/Map;Ljava/util/Map;bytesLjava/io/ByteArrayOutputStream;dataBytesLeninputCLcom/groupbyinc/flux/common/apache/lucene/store/ChecksumIndexInput;hasPasswordByteB
indexInput;Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;keystoreFile	directoryBLcom/groupbyinc/flux/common/apache/lucene/store/SimpleFSDirectory;upgradeN(Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper;Ljava/nio/file/Path;[C)Vjava/lang/Exceptionysave(Ljava/nio/file/Path;[C)V{|
}passwordisLoadedget?;
Z?createCipher(I[C[B[B)Ljavax/crypto/Cipher;&java/security/GeneralSecurityException?javax/crypto/spec/PBEKeySpec?	([C[BII)VT?
??javax/crypto/SecretKeyFactory?getInstance3(Ljava/lang/String;)Ljavax/crypto/SecretKeyFactory;??
??generateSecret6(Ljava/security/spec/KeySpec;)Ljavax/crypto/SecretKey;??
??javax/crypto/spec/SecretKeySpec?javax/crypto/SecretKey?
getEncoded?V??([BLjava/lang/String;)VT?
??"javax/crypto/spec/GCMParameterSpec?(I[B)VT?
??AES/GCM/NoPadding?javax/crypto/Cipher?)(Ljava/lang/String;)Ljavax/crypto/Cipher;??
??initB(ILjava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;)V??
??	updateAAD?N
??opmodesaltivkeySpecLjavax/crypto/spec/PBEKeySpec;
keyFactoryLjavax/crypto/SecretKeyFactory;	secretKeyLjavax/crypto/SecretKey;secret!Ljavax/crypto/spec/SecretKeySpec;spec$Ljavax/crypto/spec/GCMParameterSpec;cipherLjavax/crypto/Cipher;decrypt([C)Vjava/io/EOFException?#Keystore has already been decrypted?decryptLegacyEntries?V
?"java/lang/IllegalArgumentException?3Keystore format does not accept non-empty passwords?
?
java/io/ByteArrayInputStream?TN
??java/io/DataInputStream?(Ljava/io/InputStream;)VT?
??
?G	readFully?N
??read?g
??java/lang/SecurityException?,Keystore has been corrupted or tampered with?
?
*(Ljava/lang/String;Ljava/lang/Throwable;)VT?
????
?javax/crypto/CipherInputStream?-(Ljava/io/InputStream;Ljavax/crypto/Cipher;)VT?
??readUTF??
??S(Ljava/lang/String;)Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper$EntryType;??
?D(Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper$EntryType;[B)VT?
	?put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;???saltLenivLenencryptedLenencryptedBytesLjava/io/DataInputStream;bytesStreamLjava/io/ByteArrayInputStream;eLjava/io/EOFException;setting	entryType?Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper$EntryType;	entrySize
entryBytes
numEntriescipherStream Ljavax/crypto/CipherInputStream;Ljava/io/IOException;encrypt
([C[B[B)[B?7
javax/crypto/CipherOutputStream.(Ljava/io/OutputStream;Ljavax/crypto/Cipher;)VT
_		name?
kN		;Lcom/groupbyinc/flux/common/settings/KeyStoreWrapper$Entry;mapEntrydLjava/util/Map$Entry;!Ljavax/crypto/CipherOutputStream;,(Ljava/lang/String;)Ljava/security/KeyStore;?#
$&toCharArray()[C()
*(Ljava/io/InputStream;[C)V?,
-aliases()Ljava/util/Enumeration;/0
1java/util/Enumeration3hasMoreElements5746nextElement8;49STRING;	<java/util/HashSet>keySet@?A(Ljava/util/Collection;)VTC
?DremoveF??GisEmptyI7?JT?
LgetEntry^(Ljava/lang/String;Ljava/security/KeyStore$ProtectionParameter;)Ljava/security/KeyStore$Entry;NO
PgetSecretKey()Ljavax/crypto/SecretKey;RS
T
getKeySpecG(Ljavax/crypto/SecretKey;Ljava/lang/Class;)Ljava/security/spec/KeySpec;VW
?XgetPasswordZ)
?[
clearPassword]V
?^!java/nio/charset/StandardCharsets`UTF_8Ljava/nio/charset/Charset;bc	adjava/nio/CharBufferfwrap([C)Ljava/nio/CharBuffer;hi
gjjava/nio/charset/Charsetlencode,(Ljava/nio/CharBuffer;)Ljava/nio/ByteBuffer;no
mpjava/nio/ByteBufferrarraytV
supositionwg
sxlimitzg
s{copyOfRange([BII)[B}~
?([BB)V??
??FILE?	?
getDecoder()Ljava/util/Base64$Decoder;??
'?decode([B)[B??
%?keyvaluenumSettingssettingNameexpectedSettings#Ljava/util/Set;Ljava/util/Set;
byteBufferLjava/nio/ByteBuffer;tmpBytessettingType
keystoreEntry'Ljava/security/KeyStore$SecretKeyEntry;charssettingEntryhLjava/util/Map$Entry;keystoreLjava/security/KeyStore;bLjava/util/Map;
inputBytes+Ljava/util/Enumeration;Ljava/util/Enumeration;+Ljava/security/KeyStore$PasswordProtection;#java/nio/file/AccessDeniedException?
ensureOpen?V
?elasticsearch.keystore.tmp?DEFAULT??	??createOutput?(Ljava/lang/String;Lcom/groupbyinc/flux/common/apache/lucene/store/IOContext;)Lcom/groupbyinc/flux/common/apache/lucene/store/IndexOutput;??
??writeHeaderQ(Lcom/groupbyinc/flux/common/apache/lucene/store/DataOutput;Ljava/lang/String;I)V??
??:com/groupbyinc/flux/common/apache/lucene/store/IndexOutput?	writeByte(B)V??
??	nextBytes?N
??
?
?+
writeBytes([BI)V??
??writeFooter?(Lcom/groupbyinc/flux/common/apache/lucene/store/IndexOutput;)V??
??Punable to create temporary keystore at [%s], please check filesystem permissions?%com/groupbyinc/flux/cli/UserException?+(ILjava/lang/String;Ljava/lang/Throwable;)VT?
??java/nio/file/CopyOption? java/nio/file/StandardCopyOption?REPLACE_EXISTING"Ljava/nio/file/StandardCopyOption;??	??ATOMIC_MOVE??	??moveY(Ljava/nio/file/Path;Ljava/nio/file/Path;[Ljava/nio/file/CopyOption;)Ljava/nio/file/Path;??
??.java/nio/file/attribute/PosixFileAttributeView?getFileAttributeViewm(Ljava/nio/file/Path;Ljava/lang/Class;[Ljava/nio/file/LinkOption;)Ljava/nio/file/attribute/FileAttributeView;??
??	rw-rw----?,java/nio/file/attribute/PosixFilePermissions?
fromString#(Ljava/lang/String;)Ljava/util/Set;??
??setPermissions(Ljava/util/Set;)V????VHI
addSuppressed(Ljava/lang/Throwable;)VKL
?Mx0Ljava/lang/Throwable;x1Ljava/lang/AutoCloseable;java/lang/ClassTdesiredAssertionStatusV7
UW
[a-z0-9_\-.]+Ycompile-(Ljava/lang/String;)Ljava/util/regex/Pattern;[\
]
keystore.seed_1com/groupbyinc/flux/common/settings/SecureSettingasecureString?(Ljava/lang/String;Lcom/groupbyinc/flux/common/settings/Setting;[Lcom/groupbyinc/flux/common/settings/Setting$Property;)Lcom/groupbyinc/flux/common/settings/Setting;cd
beLABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~!@#$%^&*-_=+?g	Signature
ConstantValueCodeLocalVariableTableLineNumberTable
StackMapTableLocalVariableTypeTable
Exceptions%()Ljava/util/Set;
SourceFileInnerClasses!)*+,i-./01j345j675j891j;<5j=>5j?@5j?A1jCD1jFG1jIJ5KLMNOPiQBRLSLTUk{*?X*?ZY?[?]*?_*?a*-?c?l*deJ5KLMNm??????fgk/*?_?ldem?	hik3	*3?o?l	pqm?	rskU?Y?uK*?]?wY?x?|*??*?l?em????	}~k?[???*???????????Y?????L=?N6?-??+?????4U????*????-??-???l4.?5[?e$7??'4?5+0?/m*
? ?$?'?+?4?D?J?U?Z?n ?
???	??k?	?*??L+???Ě???Y*??M,3?϶?N:??Y-??:3??6??6??6?6?1??Y??Y????????Y??S??????`?:		????Y???:

????Y??? ?:????Y?????:
?Y? :?"Y?%::

?(?,
?/?3:?9?0?=?:????B?E??B????H6?:?L?P
?T?::
?:
?T??X:	??H6

?:		
?L?]X?Y	?u:
-?	-?T
?::?:-?	-?T???????(???(?????l??^1?V_1	?9`1
@achd5neN
?fg??hj
?kl?MN	?m5
2?no=?J5D?pqQ?KL?,MN	%?rs?pq?tq?uvo@ab??hi
m?2?????(?2?=?D?Q?[?x????????????????????????????????@?O?^ahnx???????	?
?
??????n??k?;kk????@?9?"??"?=kk????"?5?6g?H???	?Y??kk????H??kk????p?	wxku*??????????*??*+,?~?l ?epq/mnpz?7kE*?]?????ldemn@K7k/*?a?ldem#??k
\??Y,-'???:;??:??:??Y??C??:??Y???:	???:

	??
-??
?lp\de\?5\/\?N\?NK??D??!;??3)??A??	I??
m&	'()!*3,A-I.S/Y0p???k?*?]?????Yȷ?*?_?*??+????YϷп???Y*?c??::??Y??::??6		?M,????6

?N-????6?:???????Y???T?:		:	?:?T??T?::?:
?T
??:??Y???*+,-??:??Y??::??Y??::	??Y??:
:*?]?wY?x?|
??6???H
??:

???:
??6?:
??*?]???
?	Y????W???
?????Y??
?T?::?:
?T?	?T?:

:	
?:	?T??T?::?:?T??:??Y??迱P???P?????B???B?????2???"???"?????????????????????????l.WE?5	i3?5
{!?5\J?Nn8?N?%NMnn?
?N?
?N?
N????N??N?N?
F;1
P1W*	5]$
N7a5?n
?
??
de/??N??N?N???m?:9
:<=!>&?1A2GBHMGPIWJ\KbLiMnNtO{P?Q?R?S?U?G?U?G?U?W?U?V?Y?Z[Z\Z"]0^7_?`FaPbWc]dde?f?g?h?j?Z?j?Z?j?Z?j?l?j?kmn
?i	?YYY?????		??????H???YYY???	????H???YYY????YYY?J
?YYY????????L?I?H??I?H??I?H??B?p??kf
???*????Y????Y? :*+,-??:?Y?::?"Y?%::	*?]????(?,*?]????/?3:

?9?O
?=?:????B?E?	:???B???,??P???	?T?:

:	
?:
	?T
??T?::?:?T??X?F???F?????8???8?????lf
?"a?= cC?fg5?"
de
/
?N
?N?kl(???o?= !mRqst(u8vCuFwZx?y?z?{?|?}?~??u??u??nD	?Z?YY??"?5?UI?H??I?H??p???VkOA?%L?wY?xM??Y*?c??N??Y-??::*?_?6??66?%??:??:	,	????W????+'?+?.?T?::?:
?T
?+?2:*?_?$?7?n,?:??=??W????Y,?B?E:?7?)?:?:?H???Y?忧???K???Y??*?]?wY?x?|??:?Y'?+?M:,?/?3:?9???=?:???:	?E?:
+	?Q?:?U??Y??:?\:
?_
?=?0?e
?k?q:?v?y?|??:?v???L???
?????Y???
??:6??
4?T???????:??
??*?]???	?	Y
????W???(oy?(o?y??l?H?1O?1	:)?57,?5%in??1?E??????kN??5?,?Ne?1	q??
~??????????/
)kNY??cAde:??2hj&???/?'??6?o*?E??Y???2h???/?m?5????(?0?7?A?H?O?]?c?o?y????????????????????????????'?6?Y?e?q?~????????????????????????
??? ?=?@?n??:????(U?H???
4 ??,??1?5???4?5???	Y???4?5??Y?%?4?p??!{|k<P*????Y+??N?:-????::3??,???????:@?:???:		??*,	??:
?``	?``
?`????????	???		???
???

??????'?T?::?:?
?T??-:????Y+?oS?:??YN?ҿ+??:+?o??Y??SY??S??W???????:????? ??? ????????l?<v??Bp?NOc?N	aQN
?f???1?(?PdePpqP/
Cuv>?1Btq=??m?#??
?? ?(?7?<?B?I?O?V?a?w????????????????????????????????,?=?B?O?n?	?3k??????k????????H??
k??????k??B?)?Fk?pz??kb+???*?]?????Y????*?]????B?l+dem
	
niq!??k?f*??*?]???+??	M,?
,??=?%??Y??Y????+?????п,??	N?e-?:?Y???l4fdef1NaP??Y
m&HPYn	?&	!!k?T*??*?]???+??	M,?
,????%??Y??Y????+?????п??Y,??԰l TdeT1<am&H!n	?&	!		k~??*? ?%?4??Y??Y??'??*??)???,??.???п?l?1m*
++,>.n> ??k?T*??+?0?e,?k?qN-?v-?y-?|??:*?]???+?	Y?=?????	:?????l>TdeT1T?/A??$0kNE1m"2356$7E8J9S;n?SsY	 23k?9*??+?0*?]???+?	Y??,,??7?????	N-?-????l*9de919kN,
1m?@B,C0D8Fn?8	F	k?%*??*?]???+?9?	M,?,????l %de%1
1mJKLM$On?$	?Vkk+*?;???Y=?????*????Y?????l+demRSU*Vn!>Vk?V*?;*?]???H*?]??????6*?]????C?FL+?9?+?=?	M,??????lJaVdemZ["\J]R^U`n?75?
QRkg*?+?J?M*,?N?	+?J?

?lOPQRmnM?SVkh1?X????Z?^?`??f??h?+???mOeg'j*k0jn@rsJ		


@
		@ !	#
	%'(	




© 2015 - 2024 Weber Informatics LLC | Privacy Policy