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 and Description |
---|
KeyPairAuthenticationDetailProvider(String resourceId,
InputStream privateKeyStream,
char[] passphrase)
Constructor of KeyPairAuthenticationDetailProvider
|
KeyPairAuthenticationDetailProvider(String resourceId,
InputStream privateKeyStream,
char[] passphrase,
String tenancyId)
Constructor of KeyPairAuthenticationDetailProvider
|
KeyPairAuthenticationDetailProvider(String resourceId,
InputStream privateKeyStream,
char[] passphrase,
String tenancyId,
String ociResourcePrincipalVersion)
Constructor of KeyPairAuthenticationDetailProvider
|
Modifier and Type | Method and Description |
---|---|
String |
getKeyId()
Returns the keyId used to sign requests.
|
String |
getPassPhrase()
Deprecated.
Use getPassphraseCharacters instead
|
char[] |
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
|
public KeyPairAuthenticationDetailProvider(String resourceId, InputStream privateKeyStream, char[] passphrase)
Constructor of KeyPairAuthenticationDetailProvider
resourceId
- resource id of the resourceprivateKeyStream
- private key stream to sign the sign the requestpassphrase
- passphrase for the private keypublic KeyPairAuthenticationDetailProvider(String resourceId, InputStream privateKeyStream, char[] passphrase, String tenancyId)
Constructor of KeyPairAuthenticationDetailProvider
resourceId
- resource id of the resourceprivateKeyStream
- private key stream to sign the sign the requestpassphrase
- passphrase for the private keytenancyId
- tenancy id of the resourcepublic KeyPairAuthenticationDetailProvider(String resourceId, InputStream privateKeyStream, char[] passphrase, String tenancyId, String ociResourcePrincipalVersion)
Constructor of KeyPairAuthenticationDetailProvider
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 versionpublic String getKeyId()
Returns the keyId used to sign requests.
getKeyId
in interface BasicAuthenticationDetailsProvider
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.
getPrivateKey
in interface BasicAuthenticationDetailsProvider
public String getPassPhrase()
Returns the optional pass phrase for the (encrypted) private key.
getPassPhrase
in interface BasicAuthenticationDetailsProvider
public char[] getPassphraseCharacters()
Returns the optional pass phrase for the (encrypted) private key, as a character array.
getPassphraseCharacters
in interface BasicAuthenticationDetailsProvider
public String refresh()
Refreshes the authentication data used by the provider
refresh
in interface RefreshableOnNotAuthenticatedProvider<String>
Copyright © 2016–2024. All rights reserved.