Class SecurityDataService
- java.lang.Object
-
- de.adorsys.psd2.consent.service.security.SecurityDataService
-
@Service public class SecurityDataService extends Object
-
-
Constructor Summary
Constructors Constructor Description SecurityDataService(org.springframework.core.env.Environment environment, CryptoProviderHolder cryptoProviderHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<DecryptedData>decryptConsentData(String encryptedId, byte[] aspspConsentData)Decrypt ASPSP consent dataOptional<String>decryptId(String encryptedId)Decrypts encrypted external IDOptional<EncryptedData>encryptConsentData(String encryptedId, byte[] aspspConsentData)Encrypts ASPSP consent dataOptional<String>encryptId(String originalId)Encrypts external consent ID with secret consent key via configuration server keybooleanisConsentIdEncrypted(String consentId)Checks whether paymentId is encrypted or not
-
-
-
Constructor Detail
-
SecurityDataService
@Autowired public SecurityDataService(org.springframework.core.env.Environment environment, CryptoProviderHolder cryptoProviderHolder)
-
-
Method Detail
-
encryptId
public Optional<String> encryptId(String originalId)
Encrypts external consent ID with secret consent key via configuration server key- Parameters:
originalId- external consent ID to encrypt- Returns:
- String encrypted external consent ID
-
decryptId
public Optional<String> decryptId(String encryptedId)
Decrypts encrypted external ID- Parameters:
encryptedId- encrypted ID for the input- Returns:
- String original ID
-
encryptConsentData
public Optional<EncryptedData> encryptConsentData(String encryptedId, byte[] aspspConsentData)
Encrypts ASPSP consent data- Parameters:
encryptedId- encrypted consent IDaspspConsentData- original data to be encrypted- Returns:
- response contains encrypted data
-
decryptConsentData
public Optional<DecryptedData> decryptConsentData(String encryptedId, byte[] aspspConsentData)
Decrypt ASPSP consent data- Parameters:
encryptedId- encrypted consent IDaspspConsentData- encrypted data to be decrypted- Returns:
- response contains decrypted data
-
isConsentIdEncrypted
public boolean isConsentIdEncrypted(String consentId)
Checks whether paymentId is encrypted or not- Parameters:
consentId- id of consent- Returns:
trueif paymentId is encrypted.falseotherwise.
-
-