77import com .danubetech .keyformats .PublicKeyBytes ;
88import com .danubetech .keyformats .crypto .ByteSigner ;
99import com .danubetech .keyformats .crypto .ByteVerifier ;
10+ import com .danubetech .keyformats .crypto .impl .secp256k1_ES256KS_PrivateKeySigner ;
1011import com .danubetech .keyformats .crypto .impl .secp256k1_ES256KS_PublicKeyVerifier ;
1112import com .danubetech .keyformats .crypto .impl .secp256k1_ES256K_PrivateKeySigner ;
1213import com .danubetech .keyformats .crypto .provider .*;
@@ -41,11 +42,11 @@ public class DataIntegrityProofSignTest {
4142
4243 try {
4344
44- privateKeyCredential1 = TestUtil .removeMulticodec (Multibase .decode ("z3u2en7t5LR2WtQH5PfFqMqwVHBeXouLzo6haApm8XHqvjxq " ));
45- privateKeyCredential2 = TestUtil .removeMulticodec (Multibase .decode ("z3u2en7t5LR2WtQH5PfFqMqwVHBeXouLzo6haApm8XHqvjxq " ));
45+ privateKeyCredential1 = TestUtil .removeMulticodec (Multibase .decode ("z3vLhXkdoZmXj6TwZoG5D8CXvDQ4AzYeZHLusAR5RU5K56zk " ));
46+ privateKeyCredential2 = TestUtil .removeMulticodec (Multibase .decode ("z3vLhXkdoZmXj6TwZoG5D8CXvDQ4AzYeZHLusAR5RU5K56zk " ));
4647
47- publicKeyCredential1 = TestUtil .removeMulticodec (Multibase .decode ("z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2 " ));
48- publicKeyCredential2 = TestUtil .removeMulticodec (Multibase .decode ("z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2 " ));
48+ publicKeyCredential1 = TestUtil .removeMulticodec (Multibase .decode ("zQ3shcJDnkBjY3XqD4WVKktWQZqgQSrYzhaTo6gxcs6GXjUuM " ));
49+ publicKeyCredential2 = TestUtil .removeMulticodec (Multibase .decode ("zQ3shcJDnkBjY3XqD4WVKktWQZqgQSrYzhaTo6gxcs6GXjUuM " ));
4950
5051 verifiableCredentialGood1 = VerifiableCredentialV2 .fromJson (new InputStreamReader (Objects .requireNonNull (DataIntegrityProofSignTest .class .getResourceAsStream ("unsigned.good.DataIntegrityProof.1.jsonld" ))));
5152 verifiableCredentialGood2 = VerifiableCredentialV2 .fromJson (new InputStreamReader (Objects .requireNonNull (DataIntegrityProofSignTest .class .getResourceAsStream ("unsigned.good.DataIntegrityProof.2.jsonld" ))));
@@ -80,25 +81,25 @@ void testValidity() {
8081 void testSignCredential1 () throws Exception {
8182 DataIntegrityProofLdSigner signer = new DataIntegrityProofLdSigner (byteSignerSecp256k1 (privateKeyCredential1 ));
8283 DataIntegrityProofLdVerifier verifier = new DataIntegrityProofLdVerifier (byteVerifierSecp256k1 (publicKeyCredential1 ));
83- signer .setCryptosuite ("eddsa -rdfc-2022 " );
84+ signer .setCryptosuite ("bip340 -rdfc-2025 " );
8485 signer .setCreated (JsonLDUtils .stringToDate ("2023-02-24T23:36:38Z" ));
8586 signer .setProofPurpose ("assertionMethod" );
86- signer .setVerificationMethod (URI .create ("did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2#z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2 " ));
87+ signer .setVerificationMethod (URI .create ("did:key:z6DtcgBo65Ms1qzug5JAgVZH3sEpH7vp4q6D2T3cdHnyBFGj#z6DtcgBo65Ms1qzug5JAgVZH3sEpH7vp4q6D2T3cdHnyBFGj " ));
8788 DataIntegrityProof dataIntegrityProof = signer .sign (verifiableCredentialGood1 );
88- assertEquals ("z2YwC8z3ap7yx1nZYCg4L3j3ApHsF8kgPdSb5xoS1VR7vPG3F561B52hYnQF9iseabecm3ijx4K1FBTQsCZahKZme " , dataIntegrityProof .getProofValue ());
89+ assertEquals ("z4csLXc5E3KGSTBYwC5D4WzixkFWeMcWbjPnC6AHzWrLDrpZsqZoj4JXJEBRx4JShCL8RbDb8NwqhbuPfYU7muFyY " , dataIntegrityProof .getProofValue ());
8990 assertTrue (verifier .verify (verifiableCredentialGood1 ));
9091 }
9192
9293 //@Test
9394 void testSignCredential2 () throws Exception {
9495 DataIntegrityProofLdSigner signer = new DataIntegrityProofLdSigner (byteSignerSecp256k1 (privateKeyCredential2 ));
9596 DataIntegrityProofLdVerifier verifier = new DataIntegrityProofLdVerifier (byteVerifierSecp256k1 (publicKeyCredential2 ));
96- signer .setCryptosuite ("eddsa-rdfc-2022 " );
97+ signer .setCryptosuite ("bip340-jcs-2025 " );
9798 signer .setCreated (JsonLDUtils .stringToDate ("2023-02-24T23:36:38Z" ));
9899 signer .setProofPurpose ("assertionMethod" );
99100 signer .setVerificationMethod (URI .create ("did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2#z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2" ));
100101 DataIntegrityProof dataIntegrityProof = signer .sign (verifiableCredentialGood2 );
101- assertEquals ("zeuuS9pi2ZR8Q41bFFJKS9weSWkwa7pRcxHTHzxjDEHtVSZp3D9Rm3JdzT82EQpmXMb9wvfFJLuDPeSXZaRX1q1c " , dataIntegrityProof .getProofValue ());
102+ assertEquals ("z3P1WFufkFdaA9HM9jd4SYrGFbYYKzymhoYoqLHSG2zVfhjaTXFtdiQ1EwBt8X11x6rPccMdQxmhcYTfd6btY2nWt " , dataIntegrityProof .getProofValue ());
102103 assertTrue (verifier .verify (verifiableCredentialGood2 ));
103104 }
104105
@@ -107,7 +108,7 @@ void testSignCredential2() throws Exception {
107108 */
108109
109110 private static ByteSigner byteSignerSecp256k1 (byte [] privateKeyBytes ) {
110- return new secp256k1_ES256K_PrivateKeySigner (PrivateKeyBytes .bytes_to_secp256k1PrivateKey (privateKeyBytes ));
111+ return new secp256k1_ES256KS_PrivateKeySigner (PrivateKeyBytes .bytes_to_secp256k1PrivateKey (privateKeyBytes ));
111112 }
112113
113114 private static ByteVerifier byteVerifierSecp256k1 (byte [] publicKeyBytes ) {
0 commit comments