Class CredentialConfig
DBMS_CLOUD credential.
Select AI profiles reference credentials so the database can authenticate to an AI provider or object storage service. This configuration supports both username/password credentials and OCI API signing key credentials. Secret values are passed to the database credential creation call; they are not used directly by Java after the credential has been created.
Secret values are retained in memory as String values so they can be
bound to DBMS_CLOUD.CREATE_CREDENTIAL. The SDK does not log password
or private-key values. Applications should not log, persist, or expose this
configuration in diagnostics.
A name-only configuration can be used to reference or drop an existing credential. Credential creation validates that the configuration contains either username/password fields or complete OCI signing-key fields, but not both.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CredentialConfig.BuilderCreates a builder for a credential with the required database credential name.Returns the database credential name.Returns the fingerprint for the OCI API signing key.Returns the password.Returns the private key material stored in the credential request.Returns the OCI tenancy OCID stored in the credential.Returns the username used for username/password cloud service credentials.Returns the OCI user OCID stored in the credential.static CredentialConfigociSigningKey(String credentialName, String userOcid, String tenancyOcid, String privateKey, String fingerprint) Creates an OCI signing-key credential configuration.static CredentialConfigusernamePassword(String credentialName, String username, String password) Creates a username/password credential configuration.
-
Method Details
-
builder
Creates a builder for a credential with the required database credential name.- Parameters:
credentialName- database credential name- Returns:
- builder initialized with mandatory credential name
- Throws:
IllegalArgumentException- whencredentialNameis null or blank
-
usernamePassword
public static CredentialConfig usernamePassword(String credentialName, String username, String password) Creates a username/password credential configuration.- Parameters:
credentialName- database credential nameusername- cloud service usernamepassword- cloud service password, ornullwhen the target service does not require one- Returns:
- credential configuration for username/password credential creation
- Throws:
IllegalArgumentException- whencredentialNameis null or blank
-
ociSigningKey
public static CredentialConfig ociSigningKey(String credentialName, String userOcid, String tenancyOcid, String privateKey, String fingerprint) Creates an OCI signing-key credential configuration.- Parameters:
credentialName- database credential nameuserOcid- OCI user OCIDtenancyOcid- OCI tenancy OCIDprivateKey- PEM private key materialfingerprint- OCI API key fingerprint- Returns:
- credential configuration for OCI signing-key credential creation
- Throws:
IllegalArgumentException- whencredentialNameis null or blank
-
getCredentialName
Returns the database credential name.- Returns:
- credential name
-
getUsername
Returns the username used for username/password cloud service credentials.- Returns:
- username, or
nullwhen not set
-
getPassword
Returns the password.This value is sensitive. Do not log, persist, or expose it in diagnostics. The SDK uses it only to bind DBMS_CLOUD.CREATE_CREDENTIAL parameters.
- Returns:
- password, or
nullwhen not set.
-
getUserOcid
Returns the OCI user OCID stored in the credential.- Returns:
- OCI user OCID, or
nullwhen not set
-
getTenancyOcid
Returns the OCI tenancy OCID stored in the credential.- Returns:
- OCI tenancy OCID, or
nullwhen not set
-
getPrivateKey
Returns the private key material stored in the credential request.This value is sensitive. Do not log, persist, or expose it in diagnostics. The SDK uses it only to bind DBMS_CLOUD.CREATE_CREDENTIAL parameters.
- Returns:
- private key material, or
nullwhen not set
-
getFingerprint
Returns the fingerprint for the OCI API signing key.- Returns:
- key fingerprint, or
nullwhen not set
-