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 InputStream |
getClientCertificateStream(String clientCertificatePath)
Generates an
InputStream that contains certificates for a path-based
mTLS Client Certificate. |
static InputStream |
getClientKeyStream(String clientKeyPath)
Generates an
InputStream that contains certificates for a path-based
mTLS Client Key. |
static InputStream |
getTlsRootCertificatesStream(String tlsRootsCertificatesPath)
Generates an
InputStream that contains certificates for path-based
TLS Root Certificates. |
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 CallOptions 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 CallOptions 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.NoSuchAlgorithmExceptionpublic 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.public static InputStream getTlsRootCertificatesStream(String tlsRootsCertificatesPath) throws GeneralSecurityException, IOException
InputStream that contains certificates for path-based
TLS Root Certificates.tlsRootsCertificatesPath - The path of the TLS Root Certificates.GeneralSecurityException - on error.IOException - on error.public static InputStream getClientCertificateStream(String clientCertificatePath) throws GeneralSecurityException, IOException
InputStream that contains certificates for a path-based
mTLS Client Certificate.clientCertificatePath - The path of the mTLS Client Certificate.GeneralSecurityException - on error.IOException - on error.public static InputStream getClientKeyStream(String clientKeyPath) throws GeneralSecurityException, IOException
InputStream that contains certificates for a path-based
mTLS Client Key.clientKeyPath - The path of the mTLS Client Key.GeneralSecurityException - on error.IOException - on error.Copyright © 2024 The Apache Software Foundation. All rights reserved.