@@ -41,9 +41,8 @@ public KeychainLoginService(final HostPasswordStore keychain) {
4141 }
4242
4343 @ Override
44- public void validate (final Session <?> session , final LoginCallback prompt , final LoginOptions options ) throws ConnectionCanceledException , LoginFailureException {
45- log .debug ("Validate login credentials for {}" , session );
46- final Host host = session .getHost ();
44+ public void validate (final Host host , final X509KeyManager keys , final LoginCallback prompt , final LoginOptions options ) throws ConnectionCanceledException , LoginFailureException {
45+ log .debug ("Validate login credentials for {}" , host );
4746 final Credentials credentials = host .getCredentials ();
4847 if (credentials .isPublicKeyAuthentication ()) {
4948 if (!credentials .getIdentity ().attributes ().getPermission ().isReadable ()) {
@@ -92,9 +91,8 @@ public void validate(final Session<?> session, final LoginCallback prompt, final
9291 if (options .certificate ) {
9392 final String alias = host .getCredentials ().getCertificate ();
9493 if (StringUtils .isNotBlank (alias )) {
95- final X509KeyManager manager = session .getFeature (X509KeyManager .class );
96- if (manager != null ) {
97- if (null == manager .getPrivateKey (alias )) {
94+ if (keys != null ) {
95+ if (null == keys .getPrivateKey (alias )) {
9896 log .warn ("No private key found for alias {} in keychain" , alias );
9997 throw new LoginFailureException (LocaleFactory .localizedString ("Provide additional login credentials" , "Credentials" ));
10098 }
0 commit comments