public final class ClientAuthenticationUtils extends Object
FlightClientHandler
authentication.Modifier and Type | Method and Description |
---|---|
static CredentialCallOption |
getAuthenticate(FlightClient client,
CredentialCallOption credential,
CallOption... options)
Gets the
CredentialCallOption for the provided authentication info. |
static CredentialCallOption |
getAuthenticate(FlightClient client,
String username,
String password,
ClientIncomingAuthHeaderMiddleware.Factory factory,
CallOption... options)
Gets the
CredentialCallOption for the provided authentication info. |
static InputStream |
getCertificateInputStreamFromSystem(String password)
It gets the trusted certificate based on the operating system and loads all the certificate into a
InputStream . |
static InputStream |
getCertificateStream(String keyStorePath,
String keyStorePass)
Generates an
InputStream that contains certificates for a private
key. |
static boolean |
isMac()
Check if the operating system running the software is Mac.
|
static boolean |
isWindows()
Check if the operating system running the software is Windows.
|
public static CredentialCallOption getAuthenticate(FlightClient client, CredentialCallOption credential, CallOption... options)
CredentialCallOption
for the provided authentication info.client
- the client.credential
- the credential as CallOptions.options
- the CallOption
s to use.public static CredentialCallOption getAuthenticate(FlightClient client, String username, String password, ClientIncomingAuthHeaderMiddleware.Factory factory, CallOption... options)
CredentialCallOption
for the provided authentication info.client
- the client.username
- the username.password
- the password.factory
- the ClientIncomingAuthHeaderMiddleware.Factory
to use.options
- the CallOption
s to use.public static boolean isWindows()
public static boolean isMac()
public static InputStream getCertificateInputStreamFromSystem(String password) throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException
InputStream
.KeyStoreException
- if a key store could not be loaded.CertificateException
- if a certificate could not be found.IOException
- if it fails reading the file.NoSuchAlgorithmException
public static InputStream getCertificateStream(String keyStorePath, String keyStorePass) throws GeneralSecurityException, IOException
InputStream
that contains certificates for a private
key.keyStorePath
- The path of the KeyStore.keyStorePass
- The password of the KeyStore.GeneralSecurityException
- on error.IOException
- on error.Copyright © 2023 The Apache Software Foundation. All rights reserved.