com.huawei.opengauss.jdbc.ssl.LazyKeyManager.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opengaussjdbc Show documentation
Show all versions of opengaussjdbc Show documentation
HuaweiCloud JDBC for GaussDB
The newest version!
???? 4? ,com/huawei/opengauss/jdbc/ssl/LazyKeyManager java/lang/Object javax/net/ssl/X509KeyManager LazyKeyManager.java Acom/huawei/opengauss/jdbc/ssl/LibPQFactory$ConsoleCallbackHandler *com/huawei/opengauss/jdbc/ssl/LibPQFactory
ConsoleCallbackHandler cert %[Ljava/security/cert/X509Certificate; key Ljava/security/PrivateKey; certfile Ljava/lang/String; keyfile cbh .Ljavax/security/auth/callback/CallbackHandler; defaultfile Z error .Lcom/huawei/opengauss/jdbc/util/PSQLException; privateKeyFactory privateKeyFactoryCls Ljava/lang/Class; Ljava/lang/Class<*>; pkFactoryClsNotFound LOGGER #Lcom/huawei/opengauss/jdbc/log/Log; h(Ljava/lang/String;Ljava/lang/String;Ljavax/security/auth/callback/CallbackHandler;ZLjava/lang/String;)V ()V ! #
$
& ( * , . 0 2 4 6 this .Lcom/huawei/opengauss/jdbc/ssl/LazyKeyManager;
keyFactory throwKeyManagerException ,com/huawei/opengauss/jdbc/util/PSQLException < chooseClientAlias R([Ljava/lang/String;[Ljava/security/Principal;Ljava/net/Socket;)Ljava/lang/String; user @ getCertificateChain 9(Ljava/lang/String;)[Ljava/security/cert/X509Certificate; B C
D "java/security/cert/X509Certificate G getIssuerX500Principal *()Ljavax/security/auth/x500/X500Principal; I J
H K [Ljava/lang/String; M [Ljava/security/Principal; O java/net/Socket Q &javax/security/auth/x500/X500Principal S equals (Ljava/lang/Object;)Z U V
T W java/lang/String Y issuer Ljava/security/Principal; ourissuer (Ljavax/security/auth/x500/X500Principal; found certchain keyType issuers socket Ljava/net/Socket; chooseServerAlias Q(Ljava/lang/String;[Ljava/security/Principal;Ljava/net/Socket;)Ljava/lang/String; 'java/security/cert/CertificateException g java/io/FileNotFoundException i X.509 k %java/security/cert/CertificateFactory m getInstance ;(Ljava/lang/String;)Ljava/security/cert/CertificateFactory; o p
n q VCould not find a java cryptographic algorithm: X.509 CertificateFactory not available. s !com/huawei/opengauss/jdbc/util/GT u tr 9(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; w x
v y (com/huawei/opengauss/jdbc/util/PSQLState { CONNECTION_FAILURE *Lcom/huawei/opengauss/jdbc/util/PSQLState; } ~ | T(Ljava/lang/String;Lcom/huawei/opengauss/jdbc/util/PSQLState;Ljava/lang/Throwable;)V ! ?
= ? java/io/FileInputStream ? (Ljava/lang/String;)V ! ?
? ? generateCertificates -(Ljava/io/InputStream;)Ljava/util/Collection; ? ?
n ? (Could not open SSL certificate file {0}. ? 9Loading the SSL certificate {0} into a KeyManager failed. ? java/util/Collection ? size ()I ? ? ? ? toArray (([Ljava/lang/Object;)[Ljava/lang/Object; ? ? ? ? cf 'Ljava/security/cert/CertificateFactory; ex )Ljava/security/cert/CertificateException; certs 9Ljava/util/Collection<+Ljava/security/cert/Certificate;>; Ljava/util/Collection; ioex Ljava/io/FileNotFoundException; gsex alias getClientAliases A(Ljava/lang/String;[Ljava/security/Principal;)[Ljava/lang/String; > ?
?
getPrivateKey .(Ljava/lang/String;)Ljava/security/PrivateKey; *java/security/spec/InvalidKeySpecException ? java/lang/Exception ? #javax/crypto/NoSuchPaddingException ? 9javax/security/auth/callback/UnsupportedCallbackException ? &java/security/GeneralSecurityException ? java/io/IOException ? &java/security/NoSuchAlgorithmException ? java/io/RandomAccessFile ? java/io/File ?
? ? r ? #(Ljava/io/File;Ljava/lang/String;)V ! ?
? ? throwNotDefaultFileException "(Ljava/io/FileNotFoundException;)V ? ?
? length ()J ? ?
? ? readFully ([B)V ? ?
? ? close ? #
? ? getPublicKey ()Ljava/security/PublicKey; ? ?
H ? java/security/PublicKey ? getAlgorithm ()Ljava/lang/String; ? ? ? ? java/security/KeyFactory ? .(Ljava/lang/String;)Ljava/security/KeyFactory; o ?
? ? &java/security/spec/PKCS8EncodedKeySpec ? ! ?
? ? generatePrivate 8(Ljava/security/spec/KeySpec;)Ljava/security/PrivateKey; ? ?
? ? [B ? resolvePrivateKey ? ?
? $javax/crypto/EncryptedPrivateKeyInfo ?
? ? ;com/huawei/opengauss/jdbc/ssl/BouncyCastlePrivateKeyFactory ?
? $ getPassword 1()Ljavax/security/auth/callback/PasswordCallback; ? ?
? getPrivateKeyFromEncryptedKey M([BLjavax/security/auth/callback/PasswordCallback;)Ljava/security/PrivateKey; ? ?
? ?
getAlgName ? ?
? ? javax/crypto/Cipher )(Ljava/lang/String;)Ljavax/crypto/Cipher; o
getMessage ?
? *(Ljava/lang/String;Ljava/lang/Throwable;)V !
? -javax/security/auth/callback/PasswordCallback Enter SSL password:
(Ljava/lang/String;Z)V !
%javax/security/auth/callback/Callback ,javax/security/auth/callback/CallbackHandler handle +([Ljavax/security/auth/callback/Callback;)V throwUnsupportedException >(Ljavax/security/auth/callback/UnsupportedCallbackException;)V
javax/crypto/spec/PBEKeySpec ()[C ?
! ([C)V !#
$
clearPassword&