com.ibm.portal.portlet.service.credentialvault.spi.secrets
Interface CredentialSecretFactory
-
public interface CredentialSecretFactory
Factory to create the appropriate secret.
This factory is needed to instantiate the appropriate secret class in the getCredential
method of a custom Vault Adapter.
To get the right context use:
- InitialContext ctx = new InitialContext();
- CredentialSecretFactory cSF = (CredentialSecretFactory)ctx.lookup(VaultAdapterDN.VAULT_SECRET_CONTEXT);
After retrieving the correct context the secret can be created:
- cSF.createSecret(secretType);
The type values for the predefined secret types are defined in the CredentialSecret class
- Since:
- 5.1.0.1
- See Also:
- CredentialSecret,
VaultAdapterDN
createSecret
CredentialSecret createSecret(int secretType)
- Utility method.
Returns an instance of a certain credential secret
- Parameters:
- secretType - The credential Secret Type identifier.
- Returns:
- CredentialSecret
An instance of the secret class corresponding to the Secret Type.