
classes.io.netty.handler.ssl.util.SelfSignedCertificate.class Maven / Gradle / Ivy
???? 2Y P ? P ?
P ? ?
P ?
? ?
P ?
\ ? ?
? ?
? ?
? ? ? ?
?
? ? ? P ? ? ? ?
? ? ? ? ?
? ?
? P ? P ?
? ? P ? ?
? ?
? ?
? ? ? P ?
? ? ?
) ? ?
) ?
) ?
) ? ? ? ? ?
1 ?
P ? ? ?
? ?
? ? ? ? ?
? ? ?
? ? ?
) ? ?
?
? ?
A ?
K ?
?
? ?
P
% ?
?
W?,
R ?w?? logger /Lio/netty/util/internal/logging/InternalLogger; DEFAULT_NOT_BEFORE Ljava/util/Date; DEFAULT_NOT_AFTER certificate Ljava/io/File;
privateKey cert $Ljava/security/cert/X509Certificate; key Ljava/security/PrivateKey; ()V Code LineNumberTable LocalVariableTable this 1Lio/netty/handler/ssl/util/SelfSignedCertificate;
Exceptions #(Ljava/util/Date;Ljava/util/Date;)V notBefore notAfter (Ljava/lang/String;)V fqdn Ljava/lang/String; 5(Ljava/lang/String;Ljava/util/Date;Ljava/util/Date;)V 2(Ljava/lang/String;Ljava/security/SecureRandom;I)V random Ljava/security/SecureRandom; bits I R(Ljava/lang/String;Ljava/security/SecureRandom;ILjava/util/Date;Ljava/util/Date;)V keyGen Ljava/security/KeyPairGenerator; keypair Ljava/security/KeyPair; e (Ljava/security/NoSuchAlgorithmException; paths [Ljava/lang/String; t2 Ljava/lang/Throwable; t Ljava/io/IOException; Ljava/lang/Exception; certificateInput Ljava/io/FileInputStream;
StackMapTable
? ? ? ? ? ? ()Ljava/io/File; &()Ljava/security/cert/X509Certificate; ()Ljava/security/PrivateKey; delete newSelfSignedCertificate e(Ljava/lang/String;Ljava/security/PrivateKey;Ljava/security/cert/X509Certificate;)[Ljava/lang/String; keyText
encodedBuf Lio/netty/buffer/ByteBuf; certText
wrappedBuf keyFile keyOut Ljava/io/OutputStream; certFile certOut ? ?
safeDelete (Ljava/io/File;)V safeClose '(Ljava/io/File;Ljava/io/OutputStream;)V
SourceFile SelfSignedCertificate.java _ ` a ` i q example.com i w i } i j RSA !"#$ &java/security/NoSuchAlgorithmException java/lang/Error i%&'( java/lang/Throwable ] ^ KFailed to generate a self-signed X.509 certificate using sun.security.x509:)*+, GFailed to generate a self-signed X.509 certificate using Bouncy Castle: 'java/security/cert/CertificateException ^No provider succeeded to generate a self-signed certificate. See debug log for the root cause. i t java/io/File b c d c- ? g h java/io/FileInputStream i ? X509./01 "java/security/cert/X509Certificate e f2 j java/io/IOException java/lang/StringBuilder Failed to close a file: 3435678+ java/lang/Exception /java/security/cert/CertificateEncodingException ? ?9:;<=>?@ -----BEGIN PRIVATE KEY-----
ABC6D
-----END PRIVATE KEY-----
EF keyutil_3G .keyHIJ j java/io/FileOutputStreamKLMN ? ? -----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
.crt java/lang/StringO7 ?F Failed to delete a file: 8 t /io/netty/handler/ssl/util/SelfSignedCertificatePQ java/util/Date /io.netty.selfSignedCertificate.defaultNotBeforeRSTUVW iX .io.netty.selfSignedCertificate.defaultNotAfter java/lang/Object java/security/SecureRandom java/security/KeyPair java/security/PrivateKey io/netty/buffer/ByteBuf java/io/OutputStream 3io/netty/handler/ssl/util/ThreadLocalInsecureRandom current ()Ljava/security/SecureRandom; java/security/KeyPairGenerator getInstance 4(Ljava/lang/String;)Ljava/security/KeyPairGenerator;
initialize (ILjava/security/SecureRandom;)V generateKeyPair ()Ljava/security/KeyPair; (Ljava/lang/Throwable;)V 8io/netty/handler/ssl/util/OpenJdkSelfSignedCertGenerator generate z(Ljava/lang/String;Ljava/security/KeyPair;Ljava/security/SecureRandom;Ljava/util/Date;Ljava/util/Date;)[Ljava/lang/String; -io/netty/util/internal/logging/InternalLogger debug *(Ljava/lang/String;Ljava/lang/Throwable;)V =io/netty/handler/ssl/util/BouncyCastleSelfSignedCertGenerator
getPrivate %java/security/cert/CertificateFactory ;(Ljava/lang/String;)Ljava/security/cert/CertificateFactory; generateCertificate 7(Ljava/io/InputStream;)Ljava/security/cert/Certificate; close append -(Ljava/lang/String;)Ljava/lang/StringBuilder; -(Ljava/lang/Object;)Ljava/lang/StringBuilder; toString ()Ljava/lang/String; warn
getEncoded ()[B io/netty/buffer/Unpooled
wrappedBuffer ([B)Lio/netty/buffer/ByteBuf; $io/netty/handler/codec/base64/Base64 encode 5(Lio/netty/buffer/ByteBuf;Z)Lio/netty/buffer/ByteBuf; io/netty/util/CharsetUtil US_ASCII Ljava/nio/charset/Charset; .(Ljava/nio/charset/Charset;)Ljava/lang/String; release ()Z (C)Ljava/lang/StringBuilder; createTempFile 4(Ljava/lang/String;Ljava/lang/String;)Ljava/io/File; deleteOnExit getBytes (Ljava/nio/charset/Charset;)[B write ([B)V getPath 4io/netty/util/internal/logging/InternalLoggerFactory B(Ljava/lang/Class;)Lio/netty/util/internal/logging/InternalLogger; java/lang/System currentTimeMillis ()J )io/netty/util/internal/SystemPropertyUtil getLong (Ljava/lang/String;J)J (J)V 1 P \ ] ^ _ ` a ` b c d c e f g h i j k 9 *? ? ? ? l
O
P m n o p i q k K *+,? ? l
X Y m n o r ` s ` p i t k D *+? ? ? ? l
a b m n o u v p i w k Z *+? ,-? ? l
n
o m * n o u v r ` s ` p i x k Z *+,? ? ? ? l
y
z m * n o u v y z { | p i } k ? )*? ?
:,? ? :? :? Y? ?+,? :? 9:? ? +,? :? : ? ? ? Y? ?*? Y2? ? *? Y2? ? *? ? :? Y*? ? !:*"? #? $? %? &? p? '? h: ? ? )Y? *+? ,*? ? -? . ? / ? C: ? 1Y ? 2?:
? -? '? %:? ? )Y? *+? ,*? ? -? .? /
??
( 5 8 F S V ? ? ? ( ? ? ? 0 ? ? ? ? ( ? ? ? l ? % ? ? ? ? ? ? ? ( ? 5 ? 8 ? : ? F ? S ? V ? X ? d ? n ? } ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?% ?( ? m ? ~ ? ?
? ? 5 ? ? S ? ? X ? ? : 4 ? ? ? ? ? ?
? ? ? ? ) n o ) u v ) y z ) { | ) r ` ) s ` ( ? ? n ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ?O ?? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? T ? ? ? ? ? ? ? ? ?d ?K ?? ? ? ? ? ? ? ? ? ? ?!? p b ? k / *? ? l ? m n o d ? k / *? ? l ? m n o e ? k / *? &? l ? m n o g ? k / *? ? l ? m n o ? j k A *? ? 3*? ? 3? l ? ? ? m n o ? ? k P ?+? 4 ? 5N-? 6:? )Y? *7? ,? 8? 9? ,:? ,? .:? ;W? :? ;W?-? ;W?
:-? ;W?? )Y? *