Class PassphraseCredentialsProvider


  • public class PassphraseCredentialsProvider
    extends org.eclipse.jgit.transport.CredentialsProvider
    A CredentialsProvider that uses a passphrase.
    Author:
    Chris Fraser
    • Constructor Detail

      • PassphraseCredentialsProvider

        public PassphraseCredentialsProvider​(String passphrase)
        Initialize the provider with a the ssh passphrase.
        Parameters:
        passphrase - passphrase to populate the credential items with
    • Method Detail

      • isInteractive

        public boolean isInteractive()
        Specified by:
        isInteractive in class org.eclipse.jgit.transport.CredentialsProvider
      • supports

        public boolean supports​(org.eclipse.jgit.transport.CredentialItem... items)
        Specified by:
        supports in class org.eclipse.jgit.transport.CredentialsProvider
      • get

        public boolean get​(org.eclipse.jgit.transport.URIish uri,
                           org.eclipse.jgit.transport.CredentialItem... items)
                    throws org.eclipse.jgit.errors.UnsupportedCredentialItem
        Ask for the credential items to be populated with the passphrase.
        Specified by:
        get in class org.eclipse.jgit.transport.CredentialsProvider
        Parameters:
        uri - the URI of the remote resource that needs authentication.
        items - the items the application requires to complete authentication.
        Returns:
        true if the request was successful and values were supplied; false if the user canceled the request and did not supply all requested values.
        Throws:
        org.eclipse.jgit.errors.UnsupportedCredentialItem - if one of the items supplied is not supported.