Top Description Fields Constructors Methods
com.oracle.bmc.auth.internal

public Class KeyPairAuthenticationDetailProvider

extends Object
implements BasicAuthenticationDetailsProvider, RefreshableOnNotAuthenticatedProvider<String>
Class Inheritance
All Implemented Interfaces
com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider, com.oracle.bmc.auth.BasicAuthenticationDetailsProvider, com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider
Imports
com.oracle.bmc.auth.BasicAuthenticationDetailsProvider, .RefreshableOnNotAuthenticatedProvider, com.oracle.bmc.util.StreamUtils, com.oracle.bmc.util.internal.StringUtils, java.io.ByteArrayInputStream, .IOException, .InputStream

Resource Principals V2 using public/private key to sign the request. This class provides the authentication based on public/private key.

Field Summary

Modifier and TypeField and Description
private final String
private final char[]
private final InputStream
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
KeyPairAuthenticationDetailProvider(final String
resource id of the resource
resourceId
,
final InputStream
private key stream to sign the sign the request
privateKeyStream
,
final char[]
passphrase for the private key
passphrase
)

Constructor of KeyPairAuthenticationDetailProvider

public
KeyPairAuthenticationDetailProvider(final String
resource id of the resource
resourceId
,
final InputStream
private key stream to sign the sign the request
privateKeyStream
,
final char[]
passphrase for the private key
passphrase
,
final String
tenancy id of the resource
tenancyId
)

Constructor of KeyPairAuthenticationDetailProvider

public
KeyPairAuthenticationDetailProvider(final String
resource id of the resource
resourceId
,
final InputStream
private key stream to sign the sign the request
privateKeyStream
,
final char[]
passphrase for the private key
passphrase
,
final String
tenancy id of the resource
tenancyId
,
final String
resource principal version
ociResourcePrincipalVersion
)

Constructor of KeyPairAuthenticationDetailProvider

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The keyId.
getKeyId
()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getKeyId.

Returns the keyId used to sign requests.

public String

Returns:

The pass phrase, or null if not applicable
getPassPhrase
()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPassPhrase.

Deprecated Use getPassphraseCharacters instead

Returns the optional pass phrase for the (encrypted) private key.

public char[]

Returns:

The pass phrase as character array, or null if not applicable
getPassphraseCharacters
()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPassphraseCharacters.

Returns the optional pass phrase for the (encrypted) private key, as a character array.

public InputStream

Returns:

A new InputStream.
getPrivateKey
()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPrivateKey.

Returns a new InputStream to the private key.

public String

Returns:

the refreshed authentication data
refresh
()

Implements com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider.refresh.

Refreshes the authentication data used by the provider

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ociResourcePrincipalVersionback to summary
private final String ociResourcePrincipalVersion
passphraseback to summary
private final char[] passphrase
privateKeyStreamback to summary
private final InputStream privateKeyStream
resourceIdback to summary
private final String resourceId
tenancyIdback to summary
private final String tenancyId

Constructor Detail

KeyPairAuthenticationDetailProviderback to summary
public KeyPairAuthenticationDetailProvider(final String resourceId, final InputStream privateKeyStream, final char[] passphrase)

Constructor of KeyPairAuthenticationDetailProvider

Parameters
resourceId:String

resource id of the resource

privateKeyStream:InputStream

private key stream to sign the sign the request

passphrase:char[]

passphrase for the private key

KeyPairAuthenticationDetailProviderback to summary
public KeyPairAuthenticationDetailProvider(final String resourceId, final InputStream privateKeyStream, final char[] passphrase, final String tenancyId)

Constructor of KeyPairAuthenticationDetailProvider

Parameters
resourceId:String

resource id of the resource

privateKeyStream:InputStream

private key stream to sign the sign the request

passphrase:char[]

passphrase for the private key

tenancyId:String

tenancy id of the resource

KeyPairAuthenticationDetailProviderback to summary
public KeyPairAuthenticationDetailProvider(final String resourceId, final InputStream privateKeyStream, final char[] passphrase, final String tenancyId, final String ociResourcePrincipalVersion)

Constructor of KeyPairAuthenticationDetailProvider

Parameters
resourceId:String

resource id of the resource

privateKeyStream:InputStream

private key stream to sign the sign the request

passphrase:char[]

passphrase for the private key

tenancyId:String

tenancy id of the resource

ociResourcePrincipalVersion:String

resource principal version

Method Detail

getKeyIdback to summary
public String getKeyId()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getKeyId.

Returns the keyId used to sign requests.

Returns:String

The keyId.

Annotations
@Override
getPassPhraseback to summary
public String getPassPhrase()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPassPhrase.

Deprecated

Use getPassphraseCharacters instead

Returns the optional pass phrase for the (encrypted) private key.

Returns:String

The pass phrase, or null if not applicable

Annotations
@Override
getPassphraseCharactersback to summary
public char[] getPassphraseCharacters()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPassphraseCharacters.

Returns the optional pass phrase for the (encrypted) private key, as a character array.

Returns:char[]

The pass phrase as character array, or null if not applicable

Annotations
@Override
getPrivateKeyback to summary
public InputStream getPrivateKey()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPrivateKey.

Returns a new InputStream to the private key. This stream should be closed by the caller, implementations should return new streams each time.

Returns:InputStream

A new InputStream.

Annotations
@Override
refreshback to summary
public String refresh()

Implements com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider.refresh.

Refreshes the authentication data used by the provider

Returns:String

the refreshed authentication data

Annotations
@Override