diff --git a/src/main/scala/it/pagopa/interop/partyprocess/service/impl/SignatureValidationServiceImpl.scala b/src/main/scala/it/pagopa/interop/partyprocess/service/impl/SignatureValidationServiceImpl.scala index 608713de..6011c936 100644 --- a/src/main/scala/it/pagopa/interop/partyprocess/service/impl/SignatureValidationServiceImpl.scala +++ b/src/main/scala/it/pagopa/interop/partyprocess/service/impl/SignatureValidationServiceImpl.scala @@ -120,7 +120,8 @@ case object SignatureValidationServiceImpl extends SignatureValidationService { val subjectSerialNumbers: Either[SignatureValidationError, List[String]] = { val subjectSNs: List[String] = reports.getDiagnosticData.getUsedCertificates.asScala.toList.flatMap(c => Option(c.getSubjectSerialNumber)) - if (subjectSNs.nonEmpty) Right(subjectSNs) else Left(TaxCodeNotFoundInSignature) + val subjectSNCFs: List[String] = subjectSNs.filter(signatureRegex.matches) + if (subjectSNCFs.nonEmpty) Right(subjectSNCFs) else Left(TaxCodeNotFoundInSignature) } for {