Top Fields Methods
org.apache.sshd.client.auth.password

public Interface PasswordIdentityProvider

Known Direct Subinterfaces
org.apache.sshd.client.auth.AuthenticationIdentitiesProvider
Annotations
@FunctionalInterface
Imports
java.io.IOException, java.security.GeneralSecurityException, java.util.Collection, .Collections, .Iterator, java.util.function.Supplier, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.GenericUtils

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final PasswordIdentityProvider
EMPTY_PASSWORDS_PROVIDER

An "empty" implementation of PasswordIdentityProvider that returns an empty group of passwords

Method Summary

Modifier and TypeMethod and Description
public static Iterable<String>

Returns:

The wrapping iterable
iterableOf
(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).
session
,
Collection<? extends PasswordIdentityProvider>
The providers - ignored if null/empty (i.e., returns an empty iterable instance)
providers
)

Wraps a group of PasswordIdentityProvider into an Iterable of their combined passwords

public static Iterator<String>

Returns:

The wrapping iterator
iteratorOf
(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).
session
,
PasswordIdentityProvider
The registered passwords
identities
,
PasswordIdentityProvider
Extra available passwords
passwords
)

Creates a "unified" Iterator of passwords out of 2 possible PasswordIdentityProvider

public static Iterator<String>

Returns:

A non-null iterator - which may be empty if no provider or no passwords
iteratorOf
(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).
session
,
PasswordIdentityProvider
The PasswordIdentityProvider - ignored if null (i.e., return an empty iterator)
provider
)

Resolves a non-null iterator of the available passwords

public Iterable<String>

Returns:

The currently available passwords - ignored if null
loadPasswords
(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).
session
)

public static PasswordIdentityProvider

Returns:

The wrapping provider
multiProvider
(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).
session
,
PasswordIdentityProvider...
The providers - ignored if null/empty (i.e., returns EMPTY_PASSWORDS_PROVIDER
providers
)

Wraps a group of PasswordIdentityProvider into a single one

public static PasswordIdentityProvider

Returns:

The wrapping provider
multiProvider
(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).
session
,
Collection<? extends PasswordIdentityProvider>
The providers - ignored if null/empty (i.e., returns EMPTY_PASSWORDS_PROVIDER
providers
)

Wraps a group of PasswordIdentityProvider into a single one

public static PasswordIdentityProvider

Returns:

The resolved provider
resolvePasswordIdentityProvider
(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).
session
,
PasswordIdentityProvider
The registered passwords
identities
,
PasswordIdentityProvider
The extra available passwords
passwords
)

Creates a "unified" PasswordIdentityProvider out of 2 possible ones as follows:

  • If both are null then return null.
  • If either one is null then use the non-null one.
  • If both are the same instance then use it.
  • Otherwise, returns a wrapper that groups both providers.
public static PasswordIdentityProvider

Returns:

The provider wrapper
wrapPasswords
(String...
The passwords - ignored if null/empty (i.e., returns EMPTY_PASSWORDS_PROVIDER)
passwords
)

Wraps a group of passwords into a PasswordIdentityProvider

public static PasswordIdentityProvider

Returns:

The provider wrapper
wrapPasswords
(Iterable<String>
The passwords Iterable - ignored if null (i.e., returns EMPTY_PASSWORDS_PROVIDER)
passwords
)

Wraps a group of passwords into a PasswordIdentityProvider

Field Detail

EMPTY_PASSWORDS_PROVIDERback to summary
public static final PasswordIdentityProvider EMPTY_PASSWORDS_PROVIDER

An "empty" implementation of PasswordIdentityProvider that returns an empty group of passwords

Method Detail

iterableOfback to summary
public static Iterable<String> iterableOf(SessionContext session, Collection<? extends PasswordIdentityProvider> providers)

Wraps a group of PasswordIdentityProvider into an Iterable of their combined passwords

Parameters
session:SessionContext

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).

providers:Collection<? extends PasswordIdentityProvider>

The providers - ignored if null/empty (i.e., returns an empty iterable instance)

Returns:Iterable<String>

The wrapping iterable

iteratorOfback to summary
public static Iterator<String> iteratorOf(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) throws IOException, GeneralSecurityException

Creates a "unified" Iterator of passwords out of 2 possible PasswordIdentityProvider

Parameters
session:SessionContext

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).

identities:PasswordIdentityProvider

The registered passwords

passwords:PasswordIdentityProvider

Extra available passwords

Returns:Iterator<String>

The wrapping iterator

Exceptions
IOException:
If failed to load the passwords
GeneralSecurityException:
If some security issue with the passwords
See Also
resolvePasswordIdentityProvider(SessionContext, PasswordIdentityProvider, PasswordIdentityProvider)
iteratorOfback to summary
public static Iterator<String> iteratorOf(SessionContext session, PasswordIdentityProvider provider) throws IOException, GeneralSecurityException

Resolves a non-null iterator of the available passwords

Parameters
session:SessionContext

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).

provider:PasswordIdentityProvider

The PasswordIdentityProvider - ignored if null (i.e., return an empty iterator)

Returns:Iterator<String>

A non-null iterator - which may be empty if no provider or no passwords

Exceptions
IOException:
If failed to load the passwords
GeneralSecurityException:
If some security issue with the passwords
loadPasswordsback to summary
public Iterable<String> loadPasswords(SessionContext session) throws IOException, GeneralSecurityException
Parameters
session:SessionContext

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).

Returns:Iterable<String>

The currently available passwords - ignored if null

Exceptions
IOException:
If failed to load the passwords
GeneralSecurityException:
If some security issue with the passwords
multiProviderback to summary
public static PasswordIdentityProvider multiProvider(SessionContext session, PasswordIdentityProvider... providers)

Wraps a group of PasswordIdentityProvider into a single one

Parameters
session:SessionContext

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).

providers:PasswordIdentityProvider[]

The providers - ignored if null/empty (i.e., returns EMPTY_PASSWORDS_PROVIDER

Returns:PasswordIdentityProvider

The wrapping provider

See Also
multiProvider(SessionContext, Collection)
multiProviderback to summary
public static PasswordIdentityProvider multiProvider(SessionContext session, Collection<? extends PasswordIdentityProvider> providers)

Wraps a group of PasswordIdentityProvider into a single one

Parameters
session:SessionContext

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).

providers:Collection<? extends PasswordIdentityProvider>

The providers - ignored if null/empty (i.e., returns EMPTY_PASSWORDS_PROVIDER

Returns:PasswordIdentityProvider

The wrapping provider

resolvePasswordIdentityProviderback to summary
public static PasswordIdentityProvider resolvePasswordIdentityProvider(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords)

Creates a "unified" PasswordIdentityProvider out of 2 possible ones as follows:

  • If both are null then return null.
  • If either one is null then use the non-null one.
  • If both are the same instance then use it.
  • Otherwise, returns a wrapper that groups both providers.
Parameters
session:SessionContext

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).

identities:PasswordIdentityProvider

The registered passwords

passwords:PasswordIdentityProvider

The extra available passwords

Returns:PasswordIdentityProvider

The resolved provider

See Also
multiProvider(SessionContext, PasswordIdentityProvider...)
wrapPasswordsback to summary
public static PasswordIdentityProvider wrapPasswords(String... passwords)

Wraps a group of passwords into a PasswordIdentityProvider

Parameters
passwords:String[]

The passwords - ignored if null/empty (i.e., returns EMPTY_PASSWORDS_PROVIDER)

Returns:PasswordIdentityProvider

The provider wrapper

wrapPasswordsback to summary
public static PasswordIdentityProvider wrapPasswords(Iterable<String> passwords)

Wraps a group of passwords into a PasswordIdentityProvider

Parameters
passwords:Iterable<String>

The passwords Iterable - ignored if null (i.e., returns EMPTY_PASSWORDS_PROVIDER)

Returns:PasswordIdentityProvider

The provider wrapper