Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added new method addVerificationMethod and some changes related to ke… #100

Merged
merged 4 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/libs/w3cache/v1/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions build/libs/w3cache/v1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const jsonld_1 = __importDefault(require("jsonld"));
const vc_data_integrety_json_1 = __importDefault(require("./vc-data-integrety.json"));
const lds_ecdsa_secp256k1_recovery2020_json_1 = __importDefault(require("./lds-ecdsa-secp256k1-recovery2020.json"));
const schema_org_json_1 = __importDefault(require("./schema_org.json"));
const x25519_key_agreement_2020_v1_json_1 = __importDefault(require("./x25519-key-agreement-2020-v1.json"));
// Ref: https://github.com/digitalbazaar/jsonld.js/#custom-document-loader
let nodeDocumentLoader;
if (typeof window === 'undefined') {
Expand All @@ -37,6 +38,7 @@ const CONTEXTS = Object.freeze({
"https://w3c.github.io/vc-data-integrity/vocab/security/vocabulary.jsonld": Object.assign({}, vc_data_integrety_json_1.default),
"https://w3id.org/security/suites/secp256k1recovery-2020/v2": Object.assign({}, lds_ecdsa_secp256k1_recovery2020_json_1.default),
"https://schema.org": Object.assign({}, schema_org_json_1.default),
"https://digitalbazaar.github.io/x25519-key-agreement-2020-context/contexts/x25519-key-agreement-2020-v1.jsonld": Object.assign({}, x25519_key_agreement_2020_v1_json_1.default),
"https://identity.foundation/.well-known/did-configuration/v1": Object.assign({}, did_wellknown_json_1.default)
});
exports.default = (url, options) => __awaiter(void 0, void 0, void 0, function* () {
Expand Down
28 changes: 28 additions & 0 deletions build/libs/w3cache/v1/x25519-key-agreement-2020-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"@context": {
"id": "@id",
"type": "@type",
"@protected": true,
"X25519KeyAgreementKey2020": {
"@id": "https://w3id.org/security#X25519KeyAgreementKey2020",
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",
"controller": {
"@id": "https://w3id.org/security#controller",
"@type": "@id"
},
"revoked": {
"@id": "https://w3id.org/security#revoked",
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
},
"publicKeyMultibase": {
"@id": "https://w3id.org/security#publicKeyMultibase",
"@type": "https://w3id.org/security#multibase"
},
"blockchainAccountId": "https://w3id.org/security#blockchainAccountId"
}
}
}
}
2 changes: 2 additions & 0 deletions build/src/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export declare const DID_Ed25519VerificationKey2020: {
METHOD: string;
NAMESPACE: string;
DID_BASE_CONTEXT: string;
DID_KEYAGREEMENT_CONTEXT: string;
VERIFICATION_METHOD_TYPE: string;
BLOCKCHAINACCOUNTID_CONTEXT: string;
};
Expand All @@ -40,6 +41,7 @@ export declare const DID_EcdsaSecp256k1RecoveryMethod2020: {
METHOD: string;
NAMESPACE: string;
DID_BASE_CONTEXT: string;
DID_KEYAGREEMENT_CONTEXT: string;
BLOCKCHAINACCOUNTID_CONTEXT: string;
VERIFICATION_METHOD_TYPE: string;
};
Expand Down
2 changes: 1 addition & 1 deletion build/src/constants.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions build/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ exports.DID_Ed25519VerificationKey2020 = {
METHOD: 'hid',
NAMESPACE: 'testnet',
DID_BASE_CONTEXT: 'https://www.w3.org/ns/did/v1',
DID_KEYAGREEMENT_CONTEXT: "https://digitalbazaar.github.io/x25519-key-agreement-2020-context/contexts/x25519-key-agreement-2020-v1.jsonld",
VERIFICATION_METHOD_TYPE: 'Ed25519VerificationKey2020',
BLOCKCHAINACCOUNTID_CONTEXT: 'https://w3c.github.io/vc-data-integrity/vocab/security/vocabulary.jsonld',
};
Expand All @@ -47,6 +48,7 @@ exports.DID_EcdsaSecp256k1RecoveryMethod2020 = {
METHOD: 'hid',
NAMESPACE: 'testnet',
DID_BASE_CONTEXT: 'https://www.w3.org/ns/did/v1',
DID_KEYAGREEMENT_CONTEXT: "https://github.com/hypersign-protocol/hid-ssi-js-sdk/blob/develop/libs/w3cache/v1/X25519KeyAgreementKeyEIP5630.json",
BLOCKCHAINACCOUNTID_CONTEXT: 'https://w3c.github.io/vc-data-integrity/vocab/security/vocabulary.jsonld',
VERIFICATION_METHOD_TYPE: 'EcdsaSecp256k1RecoveryMethod2020',
};
Expand Down
4 changes: 3 additions & 1 deletion build/src/did/IDID.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export declare enum IVerificationRelationships {
export declare enum IKeyType {
Ed25519VerificationKey2020 = "Ed25519VerificationKey2020",
EcdsaSecp256k1VerificationKey2019 = "EcdsaSecp256k1VerificationKey2019",
EcdsaSecp256k1RecoveryMethod2020 = "EcdsaSecp256k1RecoveryMethod2020"
EcdsaSecp256k1RecoveryMethod2020 = "EcdsaSecp256k1RecoveryMethod2020",
X25519KeyAgreementKey2020 = "X25519KeyAgreementKey2020",
X25519KeyAgreementKeyEIP5630 = "X25519KeyAgreementKeyEIP5630"
}
export declare enum IClientSpec {
'eth-personalSign' = "eth-personalSign",
Expand Down
2 changes: 1 addition & 1 deletion build/src/did/IDID.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions build/src/did/IDID.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ var IKeyType;
IKeyType["Ed25519VerificationKey2020"] = "Ed25519VerificationKey2020";
IKeyType["EcdsaSecp256k1VerificationKey2019"] = "EcdsaSecp256k1VerificationKey2019";
IKeyType["EcdsaSecp256k1RecoveryMethod2020"] = "EcdsaSecp256k1RecoveryMethod2020";
IKeyType["X25519KeyAgreementKey2020"] = "X25519KeyAgreementKey2020";
IKeyType["X25519KeyAgreementKeyEIP5630"] = "X25519KeyAgreementKeyEIP5630";
})(IKeyType = exports.IKeyType || (exports.IKeyType = {}));
var IClientSpec;
(function (IClientSpec) {
Expand Down
11 changes: 10 additions & 1 deletion build/src/did/did.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Did, SignInfo } from '../../libs/generated/ssi/did';
import Web3 from 'web3';
import { IDID, IDIDResolve, ISignedDIDDocument, IClientSpec, IVerificationRelationships } from './IDID';
import { IDID, IDIDResolve, ISignedDIDDocument, IKeyType, IClientSpec, IVerificationRelationships } from './IDID';
import { OfflineSigner } from '@cosmjs/proto-signing';
/** Class representing HypersignDID */
export default class HypersignDID implements IDID {
Expand Down Expand Up @@ -189,5 +189,14 @@ export default class HypersignDID implements IDID {
didDocument: Did;
signature: string;
}>;
addVerificationMethod(params: {
did?: string;
didDocument?: Did;
type: IKeyType;
id?: string;
controller?: string;
publicKeyMultibase?: string;
blockchainAccountId?: string;
}): Promise<Did>;
}
//# sourceMappingURL=did.d.ts.map
Loading
Loading