io.netty.handler.ssl.PemReader.class Maven / Gradle / Ivy
???? 2 ? io/netty/handler/ssl/PemReader java/lang/Object PemReader.java logger /Lio/netty/util/internal/logging/InternalLogger; CERT_PATTERN Ljava/util/regex/Pattern; KEY_PATTERN readCertificates *(Ljava/io/File;)[Lio/netty/buffer/ByteBuf; 'java/security/cert/CertificateException
java/io/FileNotFoundException java/io/FileInputStream (Ljava/io/File;)V
1(Ljava/io/InputStream;)[Lio/netty/buffer/ByteBuf;
safeClose (Ljava/io/InputStream;)V
java/io/File java/io/InputStream java/lang/Throwable " java/lang/StringBuilder $ ()V &
% ' !could not find certificate file: ) append -(Ljava/lang/String;)Ljava/lang/StringBuilder; + ,
% - -(Ljava/lang/Object;)Ljava/lang/StringBuilder; + /
% 0 toString ()Ljava/lang/String; 2 3
% 4 (Ljava/lang/String;)V 6
7 in Ljava/io/InputStream; e Ljava/io/FileNotFoundException; file Ljava/io/File; java/io/IOException ? readContent )(Ljava/io/InputStream;)Ljava/lang/String; A B
C 'failed to read certificate input stream E *(Ljava/lang/String;Ljava/lang/Throwable;)V G
H java/lang/String J java/util/ArrayList L
M ' O java/util/regex/Pattern Q matcher 3(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher; S T
R U java/util/List W java/util/regex/Matcher Y find (I)Z [ \
Z ] group (I)Ljava/lang/String; _ `
Z a io/netty/util/CharsetUtil c US_ASCII Ljava/nio/charset/Charset; e f d g io/netty/buffer/Unpooled i copiedBuffer M(Ljava/lang/CharSequence;Ljava/nio/charset/Charset;)Lio/netty/buffer/ByteBuf; k l
j m $io/netty/handler/codec/base64/Base64 o decode 4(Lio/netty/buffer/ByteBuf;)Lio/netty/buffer/ByteBuf; q r
p s io/netty/buffer/ByteBuf u release ()Z w x
v y add (Ljava/lang/Object;)Z { | X } end ()I ?
Z ? isEmpty ? x X ? %found no certificates in input stream ? size ? ? X ? toArray (([Ljava/lang/Object;)[Ljava/lang/Object; ? ? X ? [Lio/netty/buffer/ByteBuf; ? content Ljava/lang/String; Ljava/io/IOException; base64 Lio/netty/buffer/ByteBuf; der certs +Ljava/util/List; Ljava/util/List; m Ljava/util/regex/Matcher; start I readPrivateKey )(Ljava/io/File;)Lio/netty/buffer/ByteBuf; java/security/KeyException ? 0(Ljava/io/InputStream;)Lio/netty/buffer/ByteBuf; ? ?
? could not fine key file: ?
? 7 failed to read key input stream ?
? H
? [ x
Z ? ?could not find a PKCS #8 private key in input stream (see http://netty.io/wiki/sslcontextbuilder-and-private-key.html for more information) ? java/io/ByteArrayOutputStream ?
? ' [B ? read ([B)I ? ?
! ? write ([BII)V ? ?
? ? java/nio/charset/Charset ? name ? 3
? ? &(Ljava/lang/String;)Ljava/lang/String; 2 ?
? ? (Ljava/io/OutputStream;)V ?
? ret buf out Ljava/io/ByteArrayOutputStream; close ? &
! ? ? Failed to close a stream. ? -io/netty/util/internal/logging/InternalLogger ? warn ? G ? ? java/io/OutputStream ?
? ? Ljava/io/OutputStream;
' this Lio/netty/handler/ssl/PemReader; 4io/netty/util/internal/logging/InternalLoggerFactory ? getInstance B(Ljava/lang/Class;)Lio/netty/util/internal/logging/InternalLogger; ? ?
? ? Y-+BEGIN\s+.*CERTIFICATE[^-]*-+(?:\s|\r|\n)+([a-z0-9+/=\r\n]+)-+END\s+.*CERTIFICATE[^-]*-+ ? compile .(Ljava/lang/String;I)Ljava/util/regex/Pattern; ? ?
R ? ]-+BEGIN\s+.*PRIVATE\s+KEY[^-]*-+(?:\s|\r|\n)+([a-z0-9+/=\r\n]+)-+END\s+.*PRIVATE\s+KEY[^-]*-+ ? Code LocalVariableTable LineNumberTable
StackMapTable
Exceptions LocalVariableTypeTable
SourceFile 0
? ? 7? Y*? L+? M+? ,?N+? -?L? Y? %Y? (*? .*? 1? 5? 8? ? 9 : ; <