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 StringgetKeyId()Returns the keyId used to sign requests.StringgetPassPhrase()Deprecated.Use getPassphraseCharacters insteadchar[]getPassphraseCharacters()Returns the optional pass phrase for the (encrypted) private key, as a character array.InputStreamgetPrivateKey()Returns a new InputStream to the private key.Stringrefresh()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:
getKeyIdin 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:
getPrivateKeyin interfaceBasicAuthenticationDetailsProvider- Returns:
- A new InputStream.
-
getPassPhrase
public String getPassPhrase()
Deprecated.Use getPassphraseCharacters insteadReturns 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()
Returns 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
-
refresh
public String refresh()
Refreshes the authentication data used by the provider- Specified by:
refreshin interfaceRefreshableOnNotAuthenticatedProvider<String>- Returns:
- the refreshed authentication data
-
-