Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.android.identity.mdoc.util.MdocUtil;
import com.android.identity.util.Timestamp;
import io.mosip.certify.util.*;
import org.springframework.stereotype.Component;

import java.io.ByteArrayOutputStream;
import java.security.KeyPair;
Expand All @@ -20,6 +21,7 @@
import java.time.temporal.ChronoUnit;
import java.util.*;

@Component
public class MdocGenerator {

public static final String NAMESPACE = "org.iso.18013.5.1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ public VCResult<JsonLDObject> getVerifiableCredentialWithLinkedDataProof(VCReque
throw new VCIExchangeException(ErrorConstants.VCI_EXCHANGE_FAILED);
}
List<String> types = vcRequestDto.getType();
if (types.isEmpty() || !types.get(0).equals("VerifiableCredential")) {
log.error("Invalid request: first item in type is not VerifiableCredential");
if (types.isEmpty() || !types.contains("VerifiableCredential")) {
log.error("Invalid request: VerifiableCredential not present in types");
throw new VCIExchangeException(ErrorConstants.VCI_EXCHANGE_FAILED);
}
types.remove(0);
types.remove("VerifiableCredential");
String requestedCredentialType = String.join("-", types);
//Check if the key is in the supported-credential-types
if (!supportedCredentialTypes.contains(requestedCredentialType)) {
Expand Down