Skip to content

Commit

Permalink
migrate web server to sechub server #3648
Browse files Browse the repository at this point in the history
  • Loading branch information
hamidonos committed Dec 3, 2024
1 parent 0771c7b commit 55bc730
Show file tree
Hide file tree
Showing 102 changed files with 1,259 additions and 2,350 deletions.

This file was deleted.

1 change: 1 addition & 0 deletions sechub-commons-security-spring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies {

implementation project(':sechub-commons-core')
implementation project(':sechub-testframework-spring')
implementation library.springboot_starter_web
implementation library.springboot_starter_security
implementation library.springboot_starter_oauth2_client
implementation library.springboot_starter_oauth2_resource_server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;

import com.mercedesbenz.sechub.commons.core.security.CryptoAccess;

// TODO: move to a central place
@Component
@EnableConfigurationProperties(AES256EncryptionProperties.class)
public class AES256Encryption {

private static final String TRANSFORMATION = "AES";
Expand All @@ -27,8 +24,8 @@ public class AES256Encryption {
private final Cipher decrypt;
private final SealedObject sealedSecretKey;

AES256Encryption(AES256EncryptionProperties properties) throws GeneralSecurityException {
SecretKey secretKey = new SecretKeySpec(properties.getSecretKeyBytes(), TRANSFORMATION);
AES256Encryption(SecurityProperties securityProperties) throws GeneralSecurityException {
SecretKey secretKey = new SecretKeySpec(securityProperties.getEncryption().getSecretKey().getBytes(StandardCharsets.UTF_8), TRANSFORMATION);
this.sealedSecretKey = secretKeyCryptoAccess.seal(secretKey);

this.encrypt = Cipher.getInstance(TRANSFORMATION);
Expand Down

This file was deleted.

Loading

0 comments on commit 55bc730

Please sign in to comment.