Package com.oracle.bmc.auth.internal
Class KeyPairAuthenticationDetailProvider
- java.lang.Object
-
- com.oracle.bmc.auth.internal.KeyPairAuthenticationDetailProvider
-
- All Implemented Interfaces:
AbstractAuthenticationDetailsProvider
,BasicAuthenticationDetailsProvider
,RefreshableOnNotAuthenticatedProvider<String>
public class KeyPairAuthenticationDetailProvider extends Object implements BasicAuthenticationDetailsProvider, RefreshableOnNotAuthenticatedProvider<String>
Resource Principals V2 using public/private key to sign the request.This class provides the authentication based on public/private key.
-
-
Constructor Summary
Constructors Constructor Description KeyPairAuthenticationDetailProvider(String resourceId, InputStream privateKeyStream, char[] passphrase)
Constructor of KeyPairAuthenticationDetailProviderKeyPairAuthenticationDetailProvider(String resourceId, InputStream privateKeyStream, char[] passphrase, String tenancyId)
Constructor of KeyPairAuthenticationDetailProviderKeyPairAuthenticationDetailProvider(String resourceId, InputStream privateKeyStream, char[] passphrase, String tenancyId, String ociResourcePrincipalVersion)
Constructor of KeyPairAuthenticationDetailProvider
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getKeyId()
Returns the keyId used to sign requests.String
getPassPhrase()
Deprecated.Use getPassphraseCharacters insteadchar[]
getPassphraseCharacters()
Returns the optional pass phrase for the (encrypted) private key, as a character array.InputStream
getPrivateKey()
Returns a new InputStream to the private key.String
refresh()
Refreshes the authentication data used by the provider
-
-
-
Constructor Detail
-
KeyPairAuthenticationDetailProvider
public KeyPairAuthenticationDetailProvider(String resourceId, InputStream privateKeyStream, char[] passphrase)
Constructor of KeyPairAuthenticationDetailProvider- Parameters:
resourceId
- resource id of the resourceprivateKeyStream
- private key stream to sign the sign the requestpassphrase
- passphrase for the private key
-
KeyPairAuthenticationDetailProvider
public KeyPairAuthenticationDetailProvider(String resourceId, InputStream privateKeyStream, char[] passphrase, String tenancyId)
Constructor of KeyPairAuthenticationDetailProvider- Parameters:
resourceId
- resource id of the resourceprivateKeyStream
- private key stream to sign the sign the requestpassphrase
- passphrase for the private keytenancyId
- tenancy id of the resource
-
KeyPairAuthenticationDetailProvider
public KeyPairAuthenticationDetailProvider(String resourceId, InputStream privateKeyStream, char[] passphrase, String tenancyId, String ociResourcePrincipalVersion)
Constructor of KeyPairAuthenticationDetailProvider- Parameters:
resourceId
- resource id of the resourceprivateKeyStream
- private key stream to sign the sign the requestpassphrase
- passphrase for the private keytenancyId
- tenancy id of the resourceociResourcePrincipalVersion
- resource principal version
-
-
Method Detail
-
getKeyId
public String getKeyId()
Returns the keyId used to sign requests.- Specified by:
getKeyId
in interfaceBasicAuthenticationDetailsProvider
- Returns:
- The keyId.
-
getPrivateKey
public InputStream getPrivateKey()
Returns a new InputStream to the private key.This stream should be closed by the caller, implementations should return new streams each time.
- Specified by:
getPrivateKey
in interfaceBasicAuthenticationDetailsProvider
- Returns:
- A new InputStream.
-
getPassPhrase
public String getPassPhrase()
Deprecated.Use getPassphraseCharacters insteadReturns the optional pass phrase for the (encrypted) private key.- Specified by:
getPassPhrase
in interfaceBasicAuthenticationDetailsProvider
- Returns:
- The pass phrase, or null if not applicable
-
getPassphraseCharacters
public char[] getPassphraseCharacters()
Returns the optional pass phrase for the (encrypted) private key, as a character array.- Specified by:
getPassphraseCharacters
in interfaceBasicAuthenticationDetailsProvider
- Returns:
- The pass phrase as character array, or null if not applicable
-
refresh
public String refresh()
Refreshes the authentication data used by the provider- Specified by:
refresh
in interfaceRefreshableOnNotAuthenticatedProvider<String>
- Returns:
- the refreshed authentication data
-
-