Skip to content

Commit

Permalink
[INJICERT-657] update SQL template scripts & fix VC key bug (#162)
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh <[email protected]>
Signed-off-by: Vishwa <[email protected]>
  • Loading branch information
vharsh authored Dec 19, 2024
1 parent abec8b2 commit 87097b5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public LdProof generateProof(LdProof vcLdProof, String vcEncodedHash, Map<String
payload.setDataToSign(vcEncodedHash);
payload.setApplicationId(keyID.get(Constants.APPLICATION_ID));
payload.setReferenceId(keyID.get(Constants.REFERENCE_ID));
payload.setApplicationId(Constants.CERTIFY_VC_SIGN_ED25519);
payload.setReferenceId(Constants.ED25519_REF_ID); // alg, empty = RSA
payload.setIncludePayload(false);
payload.setIncludeCertificate(false);
payload.setIncludeCertHash(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public LdProof generateProof(LdProof vcLdProof, String vcEncodedHash, Map<String
SignRequestDtoV2 srd = new SignRequestDtoV2();
srd.setApplicationId(keyID.get(Constants.APPLICATION_ID));
srd.setReferenceId(keyID.get(Constants.REFERENCE_ID));
srd.setApplicationId(Constants.CERTIFY_VC_SIGN_ED25519);
srd.setReferenceId(Constants.ED25519_REF_ID);
srd.setDataToSign(vcEncodedHash);
srd.setResponseEncodingFormat("base58btc");
srd.setSignAlgorithm(JWSAlgorithm.EdDSA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class VelocityTemplatingEngineImpl implements VCFormatter {
@Value("${mosip.certify.data-provider-plugin.vc-expiry-duration:P730d}")
String defaultExpiryDuration;

@Value("${mosip.certify.issuer.id.field.prefix.url:}")
@Value("${mosip.certify.data-provider-plugin.id-field-prefix-uri:}")
String idPrefix;

@PostConstruct
Expand Down
61 changes: 30 additions & 31 deletions docker-compose/docker-compose-injistack/certify_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -113,37 +113,36 @@ INSERT INTO certify.credential_template (context, credential_type, template, cr_
}
', '2024-10-24 12:32:38.065994', NULL);

INSERT INTO certify.template_data (context, credential_type, template, cr_dtimes, upd_dtimes) VALUES ('https://www.w3.org/ns/credentials/v2', 'FarmerCredential,VerifiableCredential', '{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://vharsh.github.io/DID/farmer.json",
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"issuer": "${_issuer}",
"type": [
"VerifiableCredential",
"FarmerCredential"
],
"validFrom": "${validFrom}",
"validUntil": "${validUntil}",
"credentialSubject": {
"name": "${name}",
"dateOfBirth": "${dateOfBirth}",
"highestEducation": "${highestEducation}",
"maritalStatus": "${maritalStatus}",
"typeOfHouse": "${typeOfHouse}",
"numberOfDependents": "${numberOfDependents}",
"phoneNumber": "${phoneNumber}",
"works": "${works}",
"landArea": "${landArea}",
"landOwnershipType": "${landOwnershipType}",
"primaryCropType": "${primaryCropType}",
"secondaryCropType": "${secondaryCropType}",
"face": "${face}",
"farmerID": "${farmerID}"
}
}
', '2024-10-24 12:32:38.065994', NULL);
INSERT INTO certify.credential_template (context, credential_type, template, cr_dtimes, upd_dtimes) VALUES ('https://www.w3.org/ns/credentials/v2', 'FarmerCredential,VerifiableCredential', '{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://piyush7034.github.io/my-files/farmer.json",
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"issuer": "${_issuer}",
"type": [
"VerifiableCredential",
"FarmerCredential"
],
"validFrom": "${validFrom}",
"validUntil": "${validUntil}",
"credentialSubject": {
"fullName": "${fullName}",
"mobileNumber": "${mobileNumber}",
"dateOfBirth": "${dateOfBirth}",
"gender": "${gender}",
"state": "${state}",
"district": "${district}",
"villageOrTown": "${villageOrTown}",
"postalCode": "${postalCode}",
"landArea": "${landArea}",
"landOwnershipType": "${landOwnershipType}",
"primaryCropType": "${primaryCropType}",
"secondaryCropType": "${secondaryCropType}",
"face": "${face}",
"farmerID": "${farmerID}"
}
}', '2024-10-24 12:32:38.065994', NULL);

INSERT INTO certify.key_policy_def(APP_ID,KEY_VALIDITY_DURATION,PRE_EXPIRE_DAYS,ACCESS_ALLOWED,IS_ACTIVE,CR_BY,CR_DTIMES) VALUES('ROOT', 2920, 1125, 'NA', true, 'mosipadmin', now());
INSERT INTO certify.key_policy_def(APP_ID,KEY_VALIDITY_DURATION,PRE_EXPIRE_DAYS,ACCESS_ALLOWED,IS_ACTIVE,CR_BY,CR_DTIMES) VALUES('CERTIFY_SERVICE', 1095, 60, 'NA', true, 'mosipadmin', now());
Expand Down

0 comments on commit 87097b5

Please sign in to comment.