Skip to content

Commit

Permalink
Fix: fixing code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
koptan committed Apr 8, 2024
1 parent 5570428 commit 66dc967
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
13 changes: 13 additions & 0 deletions src/main/java/org/eclipse/tractusx/ssi/lib/crypt/IKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,21 @@ public interface IKey {
*/
int getKeyLength();

/**
* As string for storing purpose.
*
* @return the string
* @throws KeyTransformationException the key transformation exception
*/
String asStringForStoring() throws KeyTransformationException;

/**
* As string for exchange purpose.
*
* @param encodeType the encode type
* @return the string
* @throws KeyTransformationException the key transformation exception
*/
String asStringForExchange(EncodeType encodeType) throws KeyTransformationException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,25 @@ public class DidWebParser {
private static final String WELL_KNOWN_DID_JSON = "/.well-known/did.json";
private static final String PATH_DID_JSON = "/did.json";

/**
* Parse uri.
*
* @param did the did
* @return the uri
* @throws DidParseException the did parse exception
*/
public URI parse(Did did) throws DidParseException {
return parse(did, true);
}

/**
* Parse uri.
*
* @param did the did
* @param enforceHttps the enforce https
* @return the uri
* @throws DidParseException the did parse exception
*/
public URI parse(Did did, boolean enforceHttps) throws DidParseException {
if (!did.getMethod().equals(Constants.DID_WEB_METHOD)) {
throw new DidParseException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ private static SignedJWT createSignedES256Jwt(
var algorithm = JWSAlgorithm.EdDSA;
var type = JOSEObjectType.JWT;

JWSHeader.Builder jwsHeaderBuilder = new JWSHeader.Builder(algorithm);
jwsHeaderBuilder.type(type);
jwsHeaderBuilder.keyID(issuer);
jwsHeaderBuilder.base64URLEncodePayload(true);
JWSHeader.Builder jwsHeaderBuilder =
new JWSHeader.Builder(algorithm).type(type).keyID(issuer).base64URLEncodePayload(true);

var header = jwsHeaderBuilder.build();
var vc = new SignedJWT(header, claimsSet);
Expand Down

0 comments on commit 66dc967

Please sign in to comment.