Giter Club home page Giter Club logo

key-formats-java's People

Contributors

azuzi avatar bernhardfuchs avatar dependabot[bot] avatar peacekeeper avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

key-formats-java's Issues

Conflicts with Android's builtin apache commons codec library

There seems to be a conflict with Android's internal org.apache.commons.codec. So when verifying a JsonLD i will get an exception like below

NoSuchMethodError: No static method decodeBase64(Ljava/lang/String;)[B in class Lorg/apache/commons/codec/binary/Base64; or its super classes (declaration of 'org.apache.commons.codec.binary.Base64' appears in /system/framework/org.apache.http.legacy.jar)

Is it possible to use a shaded org.apache.commons.codec jar or include a class that uses a different base64 implementaton other than apache commons?

Interop issue with ES256 signature format

Java JCA expects ES256 signature value to be R and S values encoded as a ASN.1/DER object.
JWS expects ES256 signature value to be R and S values concatenated.
For JWS interop there needs to be conversion between the two formats.

For more details see

https://www.rfc-editor.org/rfc/rfc7518#section-3.4
https://www.rfc-editor.org/rfc/rfc7515#appendix-A.3.1

Other implementations

https://bitbucket.org/b_c/jose4j/src/master/src/main/java/org/jose4j/jws/EcdsaUsingShaAlgorithm.java
https://bitbucket.org/connect2id/nimbus-jose-jwt/src/master/src/main/java/com/nimbusds/jose/crypto/impl/ECDSA.java

Can create context?

Can i create new context for my project, if so how to create it?

and also how to create id in credential subject

Release last version

Hi @peacekeeper. First of all, thanks for all these digital credentials java libraries. Great work!

I wanted to know if it is possible to release the latest changes of the key-formats-java library to your nexus repository, and also update ld-signatures-java, and verifiable-credentials-java libraries with the new references. I can help you with the PR.

Thanks a lot!

java.lang.NoClassDefFoundError: Could not initialize class com.danubetech.keyformats.crypto.provider.impl.NaClSodiumEd25519Provider #13

Hi , I am getting this exception while generating the sign could you pls guide me on this.

for the below sample, i am getting this exception (Bold line)

Map<String, Object> claims = new LinkedHashMap<>();
Map<String, Object> degree = new LinkedHashMap<>();
degree.put("name", "Bachelor of Science and Arts");
degree.put("type", "BachelorDegree");
claims.put("college", "Test University");
claims.put("degree", degree);

CredentialSubject credentialSubject = CredentialSubject.builder()
.id(URI.create("did:example:ebfeb1f712ebc6f1c276e12ec21"))
.claims(claims)
.build();

VerifiableCredential verifiableCredential = VerifiableCredential.builder()
.context(VerifiableCredentialContexts.JSONLD_CONTEXT_W3C_2018_CREDENTIALS_EXAMPLES_V1)
.type("UniversityDegreeCredential")
.id(URI.create("http://example.edu/credentials/3732"))
.issuer(URI.create("did:example:76e12ec712ebc6f1c221ebfeb1f"))
.issuanceDate(JsonLDUtils.stringToDate("2019-06-16T18:56:59Z"))
.expirationDate(JsonLDUtils.stringToDate("2019-06-17T18:56:59Z"))
.credentialSubject(credentialSubject)
.build();

byte[] testEd25519PrivateKey = Hex.decodeHex("984b589e121040156838303f107e13150be4a80fc5088ccba0b0bdc9b1d89090de8777a28f8da1a74e7a13090ed974d879bf692d001cddee16e4cc9f84b60580".toCharArray());

Ed25519Signature2018LdSigner signer = new Ed25519Signature2018LdSigner(testEd25519PrivateKey);
signer.setCreated(new Date());
signer.setProofPurpose(LDSecurityKeywords.JSONLD_TERM_ASSERTIONMETHOD);
signer.setVerificationMethod(URI.create("did:example:76e12ec712ebc6f1c221ebfeb1f#keys-1"));
LdProof ldProof = signer.sign(verifiableCredential);

System.out.println(verifiableCredential.toJson(true));

Ldproof Error

Hallo,

When I try touse ldproof to sign a VC i get the following error. I have included the dependancy of keyformats in my pom file. But still it does come. How to resolve it? Any ideas?

java.util.ServiceConfigurationError: com.danubetech.keyformats.crypto.provider.Ed25519Provider: Provider com.danubetech.keyformats.crypto.provider.impl.NaClSodiumEd25519Provider could not be instantiated
at com.danubetech.verifiablecredentials.VerifyCredentialTest.testcredential(VerifyCredentialTest.java:93)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.