diff --git a/powerauth-tpp-engine-model/src/main/java/io/getlime/security/powerauth/app/tppengine/model/certificate/ICACertificateParser.java b/powerauth-tpp-engine-model/src/main/java/io/getlime/security/powerauth/app/tppengine/model/certificate/ICACertificateParser.java index b31c2adfb..adac14b11 100644 --- a/powerauth-tpp-engine-model/src/main/java/io/getlime/security/powerauth/app/tppengine/model/certificate/ICACertificateParser.java +++ b/powerauth-tpp-engine-model/src/main/java/io/getlime/security/powerauth/app/tppengine/model/certificate/ICACertificateParser.java @@ -88,6 +88,10 @@ public CertInfo parse(String certificatePem) throws CertificateException { } final ASN1Primitive qcStatementAsn1Primitive = JcaX509ExtensionUtils.parseExtensionValue(qcStatement); + if (qcStatementAsn1Primitive == null) { + throw new CertificateException("Unable to extract PSD2 mandates from extension value."); + } + final DLSequence it = ((DLSequence) qcStatementAsn1Primitive); Set psd2Mandates = new HashSet<>();