Class CredentialConfig

java.lang.Object
com.oracle.database.selectai.model.CredentialConfig

public final class CredentialConfig extends Object
Configuration used to create an Oracle 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:
  • Method Details

    • builder

      public static CredentialConfig.Builder builder(String credentialName)
      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 - when credentialName is null or blank
    • usernamePassword

      public static CredentialConfig usernamePassword(String credentialName, String username, String password)
      Creates a username/password credential configuration.
      Parameters:
      credentialName - database credential name
      username - cloud service username
      password - cloud service password, or null when the target service does not require one
      Returns:
      credential configuration for username/password credential creation
      Throws:
      IllegalArgumentException - when credentialName is 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 name
      userOcid - OCI user OCID
      tenancyOcid - OCI tenancy OCID
      privateKey - PEM private key material
      fingerprint - OCI API key fingerprint
      Returns:
      credential configuration for OCI signing-key credential creation
      Throws:
      IllegalArgumentException - when credentialName is null or blank
    • getCredentialName

      Returns the database credential name.
      Returns:
      credential name
    • getUsername

      public String getUsername()
      Returns the username used for username/password cloud service credentials.
      Returns:
      username, or null when not set
    • getPassword

      public String 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 null when not set.
    • getUserOcid

      public String getUserOcid()
      Returns the OCI user OCID stored in the credential.
      Returns:
      OCI user OCID, or null when not set
    • getTenancyOcid

      Returns the OCI tenancy OCID stored in the credential.
      Returns:
      OCI tenancy OCID, or null when 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 null when not set
    • getFingerprint

      Returns the fingerprint for the OCI API signing key.
      Returns:
      key fingerprint, or null when not set