danubetech / key-formats-java Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
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?
I created unit tests to check if a payload signed by a private key can be verified with the corresponding public key:
https://github.com/danubetech/key-formats-java/tree/main/src/test/java/com/danubetech/keyformats/keytypes
But if I enable the same tests for ES256KCC, the verification fails:
#9
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 i create new context for my project, if so how to create it?
and also how to create id in credential subject
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!
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));
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)
it a open source library??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.