Package com.oracle.bmc.auth
Class YubikeyAuthenticationDetailsProvider
- java.lang.Object
-
- com.oracle.bmc.auth.YubikeyAuthenticationDetailsProvider
-
- All Implemented Interfaces:
AbstractAuthenticationDetailsProvider,AuthenticationDetailsProvider,BasicAuthenticationDetailsProvider,RegionProvider
public class YubikeyAuthenticationDetailsProvider extends Object implements AuthenticationDetailsProvider, RegionProvider
Implementation ofAuthenticationDetailsProviderthat uses yubikey for authentication.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classYubikeyAuthenticationDetailsProvider.YubikeyAuthenticationDetailsProviderBuilder
-
Constructor Summary
Constructors Constructor Description YubikeyAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile, Region region, String tenantId, String userId, char[] yubikeyPassphraseCharacters, YubikeyConfig yubikeyConfig, String keyId)Creates a new YubikeyAuthenticationDetailsProvider instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static YubikeyAuthenticationDetailsProvider.YubikeyAuthenticationDetailsProviderBuilderbuilder()StringgetFingerprint()Returns the fingerprint of the key being used.StringgetKeyId()Returns the keyId used to sign requests.StringgetPassPhrase()Deprecated.char[]getPassphraseCharacters()Returns the optional pass phrase for the (encrypted) private key, as a character array.InputStreamgetPrivateKey()Returns a new InputStream to the private key.RegiongetRegion()Returns the region.StringgetTenantId()Returns the tenant OCID.StringgetUserId()Returns the user OCID.PrivateKeygetYubikeyPrivateKey()StringtoString()
-
-
-
Constructor Detail
-
YubikeyAuthenticationDetailsProvider
public YubikeyAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile, Region region, String tenantId, String userId, char[] yubikeyPassphraseCharacters, YubikeyConfig yubikeyConfig, String keyId) throws IOException, NullPointerException
Creates a new YubikeyAuthenticationDetailsProvider instance.Details come from Builder. For certain parameters, if the value is @null, then the details from YubikeyConfig are used, if the values are still null, then config file is tried.
- Parameters:
configFile- The configuration file to use, if anyregion- region which overrides the region from the configFiletenantId- tenantId which overrides tenantId in the configFileuserId- userId which overrides the user in the configFileyubikeyPassphraseCharacters- passphraseCharacters which override passphrase in the configFileyubikeyConfig- The yubikeyConfig to use, if anykeyId- keyId to use with form tenantId/userId/YubikeyFingerprint- Throws:
IOException- if the configuration file could not be loadedNullPointerException
-
-
Method Detail
-
getKeyId
public String getKeyId()
Description copied from interface:BasicAuthenticationDetailsProviderReturns the keyId used to sign requests.- Specified by:
getKeyIdin interfaceBasicAuthenticationDetailsProvider- Returns:
- The keyId.
-
getPrivateKey
public InputStream getPrivateKey()
Description copied from interface:BasicAuthenticationDetailsProviderReturns a new InputStream to the private key.This stream should be closed by the caller, implementations should return new streams each time.
- Specified by:
getPrivateKeyin interfaceBasicAuthenticationDetailsProvider- Returns:
- A new InputStream.
-
getPassPhrase
@Deprecated public String getPassPhrase()
Deprecated.Description copied from interface:BasicAuthenticationDetailsProviderReturns the optional pass phrase for the (encrypted) private key.- Specified by:
getPassPhrasein interfaceBasicAuthenticationDetailsProvider- Returns:
- The pass phrase, or null if not applicable
-
getPassphraseCharacters
public char[] getPassphraseCharacters()
Description copied from interface:BasicAuthenticationDetailsProviderReturns the optional pass phrase for the (encrypted) private key, as a character array.- Specified by:
getPassphraseCharactersin interfaceBasicAuthenticationDetailsProvider- Returns:
- The pass phrase as character array, or null if not applicable
-
getFingerprint
public String getFingerprint()
Description copied from interface:AuthenticationDetailsProviderReturns the fingerprint of the key being used.- Specified by:
getFingerprintin interfaceAuthenticationDetailsProvider- Returns:
- The fingerprint.
-
getTenantId
public String getTenantId()
Description copied from interface:AuthenticationDetailsProviderReturns the tenant OCID.- Specified by:
getTenantIdin interfaceAuthenticationDetailsProvider- Returns:
- The tenant OCID.
-
getUserId
public String getUserId()
Description copied from interface:AuthenticationDetailsProviderReturns the user OCID.- Specified by:
getUserIdin interfaceAuthenticationDetailsProvider- Returns:
- The user OCID.
-
getRegion
public Region getRegion()
Description copied from interface:RegionProviderReturns the region.- Specified by:
getRegionin interfaceRegionProvider- Returns:
- Region object.
-
getYubikeyPrivateKey
public PrivateKey getYubikeyPrivateKey()
-
builder
public static YubikeyAuthenticationDetailsProvider.YubikeyAuthenticationDetailsProviderBuilder builder()
-
-