diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/crypt/IKey.java b/src/main/java/org/eclipse/tractusx/ssi/lib/crypt/IKey.java index b2909e29..d67cd5c9 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/crypt/IKey.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/crypt/IKey.java @@ -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; /** diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/did/web/util/DidWebParser.java b/src/main/java/org/eclipse/tractusx/ssi/lib/did/web/util/DidWebParser.java index 763b9465..73aecce2 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/did/web/util/DidWebParser.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/did/web/util/DidWebParser.java @@ -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( diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtFactory.java b/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtFactory.java index 3199db16..e2ad9e64 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtFactory.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtFactory.java @@ -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);