check issuer only if provided

This commit is contained in:
Xavi Aracil 2024-03-21 18:33:57 +01:00
parent e0ff4598db
commit e1b831d251

View File

@ -259,7 +259,7 @@ public class EmbeddedProofProbe extends Probe<VerifiableCredential> {
return error("Invalid public key: " + e.getMessage(), ctx); return error("Invalid public key: " + e.getMessage(), ctx);
} }
if (controller != null) { if (controller != null && credentialHolder.getCredential().getIssuer() != null) {
if (!controller.equals(credentialHolder.getCredential().getIssuer().toString())) { if (!controller.equals(credentialHolder.getCredential().getIssuer().toString())) {
return error( return error(
"Key controller does not match issuer: " + credentialHolder.getCredential().getIssuer(), "Key controller does not match issuer: " + credentialHolder.getCredential().getIssuer(),