use of org.wso2.carbon.identity.secret.mgt.core.model.ResolvedSecret in project carbon-identity-framework by wso2.
the class SecretResolveManagerImpl method getResolvedSecret.
private ResolvedSecret getResolvedSecret(Secret secret) throws SecretManagementServerException {
ResolvedSecret resolvedSecret = new ResolvedSecret();
resolvedSecret.setSecretId(secret.getSecretId());
resolvedSecret.setSecretName(secret.getSecretName());
resolvedSecret.setCreatedTime(secret.getCreatedTime());
resolvedSecret.setLastModified(secret.getLastModified());
resolvedSecret.setTenantDomain(secret.getTenantDomain());
resolvedSecret.setResolvedSecretValue(getDecryptedSecretValue(secret.getSecretValue(), secret.getSecretName()));
return resolvedSecret;
}
use of org.wso2.carbon.identity.secret.mgt.core.model.ResolvedSecret in project carbon-identity-framework by wso2.
the class SecretManagerTest method testGetExistingSecretResolved.
@Test(priority = 24)
public void testGetExistingSecretResolved() throws Exception {
SecretType secretType = secretManager.addSecretType(getSampleSecretTypeAdd(SAMPLE_SECRET_TYPE_NAME1, SAMPLE_SECRET_TYPE_DESCRIPTION1));
Secret secretAdd = getSampleSecretAdd(SAMPLE_SECRET_NAME1, SAMPLE_SECRET_VALUE1);
encryptSecret(secretAdd.getSecretValue());
Secret secretCreated = secretManager.addSecret(secretType.getName(), secretAdd);
decryptSecret(ENCRYPTED_VALUE1);
ResolvedSecret secretRetrieved = secretResolveManager.getResolvedSecret(secretType.getName(), SAMPLE_SECRET_NAME1);
assertEquals(secretCreated.getSecretId(), secretRetrieved.getSecretId(), "Existing id should be equal " + "to the retrieved id");
assertEquals(SAMPLE_SECRET_VALUE1, secretRetrieved.getResolvedSecretValue(), "Existing id should be equal " + "to the retrieved id");
}
Aggregations