You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really need to provide some better examples on the readme. But hope this can help for now, the peerDID library is straight forward then you just need to convert it to a DID. I took the examples from the tests in the peerdid-swift.
let ed25519_key1_jwk = PeerDIDVerificationMaterial(
format: .jwk,
\\ this is from peer DID tests
value: JWK.testableData(),
type: .authentication(.jsonWebKey2020)
)
let x25519_key_jwk = PeerDIDVerificationMaterial(
format: .jwk,
\\ this is from peer DID tests
value: JWK.testableData(crv: "X25519", x: "BIiFcQEn3dfvB2pjlhOQQour6jXy9d5s2FKEJNTOJik"),
type: .agreement(.jsonWebKey2020)
)
let peerDID = try PeerDIDHelper.createAlgo2(
authenticationKeys: [ed25519_key1_jwk],
agreementKeys: [x25519_key_jwk],
services: [validService]
)
let yourDID = DID(string: peerDID.string)
let otherDID = DID(string: "did:peer:alice")
let didcomm = DIDComm(
didResolver: // ... DID Resolver implementation,
secretResolver: // ... Secret Resolver implementation
)
let basicMessage = Message(
id: // UUID,
type: // protocol id string,
from: yourDID,
to: [otherDID]
)
let packed = try await didcomm.packSigned(params: .init(
message: basicMessage,
signFrom: "peerDID.string\(#key-0)" // Replace with actual signer DID Key ID
))
Hi, can you provide an example for use with peerdid-swift? Thanks!
The text was updated successfully, but these errors were encountered: