use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTest method testValidatePModeSecurityNoX509SignatureCertificate.
@Test
@Ignore("The X509 certificate is always null, as it is received from the SMP")
public void testValidatePModeSecurityNoX509SignatureCertificate() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setX509SignatureCertificate(null);
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, PModeLegErrorHandling.createUndefined(), null, aSecurityLeg));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("X509SignatureCertificate is missing")));
}
use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTest method testValidatePModeSecurityPModeAuthorizeTrue.
@Test
public void testValidatePModeSecurityPModeAuthorizeTrue() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setPModeAuthorize(true);
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, aSecurityLeg));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("false")));
}
use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTest method testValidatePModeSecurityWrongX509EncryptionAlgorithm.
@Test
public void testValidatePModeSecurityWrongX509EncryptionAlgorithm() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setX509EncryptionAlgorithm(ECryptoAlgorithmCrypt.AES_192_CBC);
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, aSecurityLeg));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains(ECryptoAlgorithmCrypt.AES_128_GCM.getID())));
}
use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTest method testValidatePModeSecurityWrongX509SignatureHashFunction.
@Test
public void testValidatePModeSecurityWrongX509SignatureHashFunction() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setX509SignatureHashFunction(ECryptoAlgorithmSignDigest.DIGEST_SHA_512);
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, aSecurityLeg));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains(ECryptoAlgorithmSignDigest.DIGEST_SHA_256.getID())));
}
use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTwoWayFuncTest method testValidatePModeSecurityWrongX509EncryptionAlgorithm.
@Test
public void testValidatePModeSecurityWrongX509EncryptionAlgorithm() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg2().getSecurity();
aSecurityLeg.setX509EncryptionAlgorithm(ECryptoAlgorithmCrypt.AES_192_CBC);
m_aPMode.setLeg2(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, aSecurityLeg));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains(ECryptoAlgorithmCrypt.AES_128_GCM.getID())));
}
Aggregations