-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #452 from coasys/rust-signatures
Expression signing and verification migrated to Rust
- Loading branch information
Showing
32 changed files
with
627 additions
and
223 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
export interface VerificationMethod { | ||
id: string; | ||
type: string; | ||
controller: string; | ||
publicKeyBase58?: string; | ||
publicKeyMultibase?: string; | ||
publicKeyJwk?: any; // Adjusted to 'any' since the specific structure is not provided | ||
// Add other fields from the did_key::VerificationMethod if they exist | ||
} | ||
|
||
export interface DidDocument { | ||
"@context": string | string[]; | ||
id: string; | ||
alsoKnownAs?: string[]; | ||
controller?: string | string[]; | ||
verificationMethod: VerificationMethod[]; | ||
authentication?: (string | VerificationMethod)[]; | ||
assertionMethod?: (string | VerificationMethod)[]; | ||
keyAgreement?: (string | VerificationMethod)[]; | ||
capabilityInvocation?: (string | VerificationMethod)[]; | ||
capabilityDelegation?: (string | VerificationMethod)[]; | ||
service?: ServiceEndpoint[]; | ||
// Add other fields from the did_key::Document if they exist | ||
} | ||
|
||
export interface ServiceEndpoint { | ||
id: string; | ||
type: string; | ||
serviceEndpoint: string; | ||
// Add other fields from the did_key::ServiceEndpoint if they exist | ||
} | ||
|
||
export interface Expression { | ||
author: string; | ||
timestamp: string; | ||
data: any; | ||
proof: ExpressionProof; | ||
} | ||
|
||
export interface ExpressionProof { | ||
signature: string; | ||
key: string; | ||
} | ||
|
||
declare global { | ||
interface RustAgent { | ||
didDocument: () => DidDocument; | ||
signingKeyId: () => string; | ||
did: () => string; | ||
createSignedExpression: (data: any) => Expression; | ||
sign: (payload: Uint8Array) => Uint8Array; | ||
signStringHex: (payload: string) => string; | ||
} | ||
|
||
const AGENT: RustAgent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.