use of org.opensmartgridplatform.secretmanagement.application.domain.TypedSecret in project open-smart-grid-platform by OSGP.
the class SecretManagementEndpoint method storeSecrets.
public StoreSecretsResponse storeSecrets(final StoreSecretsRequest request) throws OsgpException {
final TypedSecrets soapTypedSecrets = request.getTypedSecrets();
final List<TypedSecret> typedSecretList = this.converter.convertToTypedSecrets(soapTypedSecrets);
this.secretManagementService.storeSecrets(request.getDeviceId(), typedSecretList);
return new StoreSecretsResponse();
}
use of org.opensmartgridplatform.secretmanagement.application.domain.TypedSecret in project open-smart-grid-platform by OSGP.
the class SecretManagementService method storeSecrets.
public synchronized void storeSecrets(final String deviceIdentification, final List<TypedSecret> typedSecrets) {
for (final TypedSecret typedSecret : typedSecrets) {
this.withdrawExistingKeysWithStatusNew(deviceIdentification, typedSecret.getSecretType());
}
final List<EncryptedTypedSecret> aesSecrets = typedSecrets.stream().map(ts -> new EncryptedTypedSecret(ts.getSecret(), ts.getSecretType())).map(this::reencryptRsa2Aes).collect(toList());
this.storeAesSecrets(deviceIdentification, aesSecrets);
}
use of org.opensmartgridplatform.secretmanagement.application.domain.TypedSecret in project open-smart-grid-platform by OSGP.
the class SecretManagementEndpoint method generateAndStoreSecrets.
public GenerateAndStoreSecretsResponse generateAndStoreSecrets(final GenerateAndStoreSecretsRequest request) throws OsgpException {
final GenerateAndStoreSecretsResponse response = new GenerateAndStoreSecretsResponse();
final SecretTypes soapSecretTypes = request.getSecretTypes();
final List<SecretType> secretTypeList = this.converter.convertToSecretTypes(soapSecretTypes);
final List<TypedSecret> typedSecretList = this.secretManagementService.generateAndStoreSecrets(request.getDeviceId(), secretTypeList);
response.setTypedSecrets(this.converter.convertToSoapTypedSecrets(typedSecretList));
return response;
}
use of org.opensmartgridplatform.secretmanagement.application.domain.TypedSecret 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;
}
use of org.opensmartgridplatform.secretmanagement.application.domain.TypedSecret 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;
}
Aggregations