Search in sources :

Example 6 with TypedSecrets

use of org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecrets in project open-smart-grid-platform by OSGP.

the class SecretManagementEndpoint method getNewSecrets.

public GetNewSecretsResponse getNewSecrets(final GetNewSecretsRequest request) throws OsgpException {
    final GetNewSecretsResponse response = new GetNewSecretsResponse();
    final SecretTypes soapSecretTypes = request.getSecretTypes();
    final List<SecretType> secretTypeList = this.converter.convertToSecretTypes(soapSecretTypes);
    final List<TypedSecret> typedSecrets = this.secretManagementService.retrieveNewSecrets(request.getDeviceId(), secretTypeList);
    final TypedSecrets soapTypedSecrets = this.converter.convertToSoapTypedSecrets(typedSecrets);
    response.setTypedSecrets(soapTypedSecrets);
    return response;
}
Also used : GetNewSecretsResponse(org.opensmartgridplatform.ws.schema.core.secret.management.GetNewSecretsResponse) SecretType(org.opensmartgridplatform.secretmanagement.application.domain.SecretType) SecretTypes(org.opensmartgridplatform.ws.schema.core.secret.management.SecretTypes) TypedSecrets(org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecrets) TypedSecret(org.opensmartgridplatform.secretmanagement.application.domain.TypedSecret)

Example 7 with TypedSecrets

use of org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecrets in project open-smart-grid-platform by OSGP.

the class SecretManagementEndpoint method getSecrets.

public GetSecretsResponse getSecrets(final GetSecretsRequest request) throws OsgpException {
    final GetSecretsResponse response = new GetSecretsResponse();
    final SecretTypes soapSecretTypes = request.getSecretTypes();
    final List<SecretType> secretTypeList = this.converter.convertToSecretTypes(soapSecretTypes);
    final List<TypedSecret> typedSecrets = this.secretManagementService.retrieveSecrets(request.getDeviceId(), secretTypeList);
    final TypedSecrets soapTypedSecrets = this.converter.convertToSoapTypedSecrets(typedSecrets);
    response.setTypedSecrets(soapTypedSecrets);
    return response;
}
Also used : GetSecretsResponse(org.opensmartgridplatform.ws.schema.core.secret.management.GetSecretsResponse) SecretType(org.opensmartgridplatform.secretmanagement.application.domain.SecretType) SecretTypes(org.opensmartgridplatform.ws.schema.core.secret.management.SecretTypes) TypedSecrets(org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecrets) TypedSecret(org.opensmartgridplatform.secretmanagement.application.domain.TypedSecret)

Example 8 with TypedSecrets

use of org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecrets in project open-smart-grid-platform by OSGP.

the class SoapEndpointDataTypeConverter method convertToSoapTypedSecrets.

public TypedSecrets convertToSoapTypedSecrets(final List<TypedSecret> typedSecrets) {
    final TypedSecrets soapTypedSecrets = new TypedSecrets();
    final List<org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecret> soapTypedSecretList = soapTypedSecrets.getTypedSecret();
    for (final TypedSecret typedSecret : typedSecrets) {
        final org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecret soapTypedSecret = this.encryptAndConvertSoapTypedSecret(typedSecret);
        soapTypedSecretList.add(soapTypedSecret);
    }
    return soapTypedSecrets;
}
Also used : TypedSecrets(org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecrets) TypedSecret(org.opensmartgridplatform.secretmanagement.application.domain.TypedSecret)

Aggregations

TypedSecrets (org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecrets)8 SecurityKeyType (org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.SecurityKeyType)4 TypedSecret (org.opensmartgridplatform.secretmanagement.application.domain.TypedSecret)4 GenerateAndStoreSecretsResponse (org.opensmartgridplatform.ws.schema.core.secret.management.GenerateAndStoreSecretsResponse)4 SecretTypes (org.opensmartgridplatform.ws.schema.core.secret.management.SecretTypes)3 Test (org.junit.jupiter.api.Test)2 SecretType (org.opensmartgridplatform.secretmanagement.application.domain.SecretType)2 GenerateAndStoreSecretsRequest (org.opensmartgridplatform.ws.schema.core.secret.management.GenerateAndStoreSecretsRequest)2 GetSecretsResponse (org.opensmartgridplatform.ws.schema.core.secret.management.GetSecretsResponse)2 StoreSecretsResponse (org.opensmartgridplatform.ws.schema.core.secret.management.StoreSecretsResponse)2 TypedSecret (org.opensmartgridplatform.ws.schema.core.secret.management.TypedSecret)2 EnumMap (java.util.EnumMap)1 Map (java.util.Map)1 GetNewSecretsResponse (org.opensmartgridplatform.ws.schema.core.secret.management.GetNewSecretsResponse)1 GetSecretsRequest (org.opensmartgridplatform.ws.schema.core.secret.management.GetSecretsRequest)1 StoreSecretsRequest (org.opensmartgridplatform.ws.schema.core.secret.management.StoreSecretsRequest)1