Class SecretReferenceUtil

java.lang.Object
com.pingidentity.sdk.secretmanager.SecretReferenceUtil

public class SecretReferenceUtil extends Object
Utility class for secret references used by SecretManager.
Since:
11.0
  • Method Details

    • getSecretManagerId

      public static String getSecretManagerId(String secretReference)
      Parses out secretManagerId from secretReference.
      Parameters:
      secretReference - String in expected format OBF:MGR:{secretManagerId}:{secretId}
      Returns:
      String of the secretManagerId from the secretReference, otherwise null if secretReference is not valid.
    • getSecretId

      public static String getSecretId(String secretReference)
      Parses out secretId from secretReference.
      Parameters:
      secretReference - String in expected format OBF:MGR:{secretManagerId}:{secretId}
      Returns:
      String of the secretId from the secretReference, otherwise null if secretReference is not valid.
    • isSecretReference

      public static boolean isSecretReference(String secretReference)
      Checks whether the secretReference has the SecretManager.SECRET_REFERENCE_PREFIX.
      Parameters:
      secretReference - String in expected format OBF:MGR:{secretManagerId}:{secretId}
      Returns:
      true if secretReference has the SecretManager.SECRET_REFERENCE_PREFIX, otherwise false.
    • validateSecretManagerId

      public static boolean validateSecretManagerId(String secretReference)
      Validates the secretManagerId defined in the secretReference.
      Parameters:
      secretReference - String in expected format OBF:MGR:{secretManagerId}:{secretId}
      Returns:
      true if secretManagerId is a valid secret manager, otherwise false.