@veramo/core
Advanced tools
Comparing version 1.2.3-unstable.26 to 1.2.3-unstable.41
@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard. | ||
"packageName": "@microsoft/api-extractor", | ||
"packageVersion": "7.15.2" | ||
"packageVersion": "7.17.1" | ||
} | ||
] | ||
} |
@@ -100,2 +100,18 @@ import { IPluginMethodMap } from './IAgent'; | ||
/** | ||
* Input arguments for {@link IKeyManager.keyManagerSharedSecret | keyManagerSharedSecret} | ||
* @public | ||
*/ | ||
export interface IKeyManagerSharedSecretArgs { | ||
/** | ||
* The secret key handle (`kid`) | ||
* as returned by {@link IKeyManager.keyManagerCreate | keyManagerCreate} | ||
*/ | ||
secretKeyRef: string; | ||
/** | ||
* The public key of the other party. | ||
* The `type` of key MUST be compatible with the type referenced by `secretKeyRef` | ||
*/ | ||
publicKey: Pick<IKey, 'publicKeyHex' | 'type'>; | ||
} | ||
/** | ||
* Input arguments for {@link IKeyManager.keyManagerSignJWT | keyManagerSignJWT} | ||
@@ -160,2 +176,12 @@ * @public | ||
/** | ||
* Compute a shared secret with the public key of another party. | ||
* | ||
* This computes the raw shared secret (the result of a Diffie-Hellman computation) | ||
* To use this for symmetric encryption you MUST apply a KDF on the result. | ||
* | ||
* @param args {@link IKeyManagerSharedKeyArgs} | ||
* @returns a `Promise` that resolves to a hex encoded shared secret | ||
*/ | ||
keyManagerSharedSecret(args: IKeyManagerSharedSecretArgs): Promise<string>; | ||
/** | ||
* Encrypts data | ||
@@ -162,0 +188,0 @@ * @beta |
@@ -1,2 +0,2 @@ | ||
import { DIDResolutionOptions, DIDResolutionResult } from 'did-resolver'; | ||
import { DIDDocument, DIDResolutionOptions, DIDResolutionResult, ServiceEndpoint, VerificationMethod } from 'did-resolver'; | ||
export { DIDDocument, DIDResolutionOptions, DIDResolutionResult } from 'did-resolver'; | ||
@@ -29,3 +29,3 @@ import { IPluginMethodMap } from './IAgent'; | ||
/** | ||
* Resolves DID and returns DID Document | ||
* Resolves DID and returns DID Resolution Result | ||
* | ||
@@ -60,3 +60,50 @@ * @example | ||
resolveDid(args: ResolveDidArgs): Promise<DIDResolutionResult>; | ||
/** | ||
* Dereferences a DID URL fragment and returns the corresponding DID document entry. | ||
* | ||
* @example | ||
* ```typescript | ||
* const did = 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190' | ||
* const didFragment = `${did}#controller` | ||
* const fragment = await agent.getDIDComponentById({ | ||
* didDocument: (await agent.resolveDid({didUrl: did}))?.didDocument, | ||
* didUrl: didFragment, | ||
* section: 'authentication' | ||
* }) | ||
* expect(fragment).toEqual({ | ||
* id: 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190#controller', | ||
* type: 'EcdsaSecp256k1RecoveryMethod2020', | ||
* controller: 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190', | ||
* blockchainAccountId: '0xb09B66026bA5909A7CFE99b76875431D2b8D5190@eip155:4', | ||
* }) | ||
* ``` | ||
* | ||
* @param args.didDocument - the DID document from which to extract the fragment. | ||
* This MUST be the document resolved by {@link resolveDid} | ||
* @param args.didUrl - the DID URI that needs to be dereferenced | ||
* @param args.section - Optional - the section of the DID Document to be used for dereferencing | ||
* | ||
* @returns a `Promise` containing the {@link did-resolver#VerificationMethod | VerificationMethod} or | ||
* {@link did-resolver#ServiceEndpoint | ServiceEndpoint} | ||
* | ||
* @throws `not_found:...` in case the fragment is not displayed in the DID document | ||
* | ||
* @beta | ||
*/ | ||
getDIDComponentById(args: { | ||
/** | ||
* the DID document from which to extract the fragment. This MUST be the document resolved by {@link resolveDid} | ||
*/ | ||
didDocument: DIDDocument; | ||
/** | ||
* The DID URI that refers to the subsection by #fragment. Example: did:example:identifier#controller | ||
*/ | ||
didUrl: string; | ||
/** | ||
* The section of the DID document where to search for the fragment. Example 'keyAgreement' | ||
*/ | ||
section?: DIDDocumentSection; | ||
}): Promise<VerificationMethod | ServiceEndpoint>; | ||
} | ||
export declare type DIDDocumentSection = 'verificationMethod' | 'publicKey' | 'service' | 'authentication' | 'assertionMethod' | 'keyAgreement' | 'capabilityInvocation' | 'capabilityDelegation'; | ||
//# sourceMappingURL=IResolver.d.ts.map |
{ | ||
"name": "@veramo/core", | ||
"description": "Veramo Core Logic & Interfaces.", | ||
"version": "1.2.3-unstable.26+32893d2f", | ||
"version": "1.2.3-unstable.41+eebe32c0", | ||
"main": "build/index.js", | ||
@@ -22,3 +22,3 @@ "types": "build/index.d.ts", | ||
"debug": "^4.1.1", | ||
"did-jwt-vc": "2.1.2", | ||
"did-jwt-vc": "2.1.3", | ||
"events": "^3.2.0", | ||
@@ -28,5 +28,5 @@ "z-schema": "^5.0.0" | ||
"devDependencies": { | ||
"@types/debug": "4.1.5", | ||
"@types/debug": "4.1.6", | ||
"did-resolver": "3.1.0", | ||
"typescript": "4.3.2" | ||
"typescript": "4.3.5" | ||
}, | ||
@@ -53,3 +53,3 @@ "files": [ | ||
"keywords": [], | ||
"gitHead": "32893d2f8877ac3f432ee0f7e9974260ce6634bb" | ||
"gitHead": "eebe32c03b5826ca9cde6bf86fd4acb1bc025968" | ||
} |
@@ -526,2 +526,34 @@ { | ||
}, | ||
"IKeyManagerSharedSecretArgs": { | ||
"type": "object", | ||
"properties": { | ||
"secretKeyRef": { | ||
"type": "string", | ||
"description": "The secret key handle (`kid`) as returned by {@link IKeyManager.keyManagerCreate | keyManagerCreate }" | ||
}, | ||
"publicKey": { | ||
"type": "object", | ||
"properties": { | ||
"publicKeyHex": { | ||
"type": "string", | ||
"description": "Public key" | ||
}, | ||
"type": { | ||
"$ref": "#/components/schemas/TKeyType", | ||
"description": "Key type" | ||
} | ||
}, | ||
"required": [ | ||
"publicKeyHex", | ||
"type" | ||
], | ||
"description": "The public key of the other party. The `type` of key MUST be compatible with the type referenced by `secretKeyRef`" | ||
} | ||
}, | ||
"required": [ | ||
"secretKeyRef", | ||
"publicKey" | ||
], | ||
"description": "Input arguments for {@link IKeyManager.keyManagerSharedSecret | keyManagerSharedSecret }" | ||
}, | ||
"IKeyManagerSignArgs": { | ||
@@ -710,2 +742,11 @@ "type": "object", | ||
}, | ||
"keyManagerSharedSecret": { | ||
"description": "Compute a shared secret with the public key of another party.", | ||
"arguments": { | ||
"$ref": "#/components/schemas/IKeyManagerSharedSecretArgs" | ||
}, | ||
"returnType": { | ||
"type": "string" | ||
} | ||
}, | ||
"keyManagerSign": { | ||
@@ -712,0 +753,0 @@ "description": "Generates a signature according to the algorithm specified.", |
@@ -97,3 +97,3 @@ import { IPluginMethodMap } from './IAgent' | ||
* This must be one of the algorithms supported by the KMS for this key type. | ||
* | ||
* | ||
* The algorithm used here should match one of the names listed in `IKey.meta.algorithms` | ||
@@ -117,2 +117,20 @@ */ | ||
/** | ||
* Input arguments for {@link IKeyManager.keyManagerSharedSecret | keyManagerSharedSecret} | ||
* @public | ||
*/ | ||
export interface IKeyManagerSharedSecretArgs { | ||
/** | ||
* The secret key handle (`kid`) | ||
* as returned by {@link IKeyManager.keyManagerCreate | keyManagerCreate} | ||
*/ | ||
secretKeyRef: string | ||
/** | ||
* The public key of the other party. | ||
* The `type` of key MUST be compatible with the type referenced by `secretKeyRef` | ||
*/ | ||
publicKey: Pick<IKey, 'publicKeyHex' | 'type'> | ||
} | ||
/** | ||
* Input arguments for {@link IKeyManager.keyManagerSignJWT | keyManagerSignJWT} | ||
@@ -187,2 +205,13 @@ * @public | ||
/** | ||
* Compute a shared secret with the public key of another party. | ||
* | ||
* This computes the raw shared secret (the result of a Diffie-Hellman computation) | ||
* To use this for symmetric encryption you MUST apply a KDF on the result. | ||
* | ||
* @param args {@link IKeyManagerSharedKeyArgs} | ||
* @returns a `Promise` that resolves to a hex encoded shared secret | ||
*/ | ||
keyManagerSharedSecret(args: IKeyManagerSharedSecretArgs): Promise<string> | ||
/** | ||
* Encrypts data | ||
@@ -189,0 +218,0 @@ * @beta |
@@ -1,2 +0,8 @@ | ||
import { DIDResolutionOptions, DIDResolutionResult } from 'did-resolver' | ||
import { | ||
DIDDocument, | ||
DIDResolutionOptions, | ||
DIDResolutionResult, | ||
ServiceEndpoint, | ||
VerificationMethod, | ||
} from 'did-resolver' | ||
export { DIDDocument, DIDResolutionOptions, DIDResolutionResult } from 'did-resolver' | ||
@@ -32,3 +38,3 @@ import { IPluginMethodMap } from './IAgent' | ||
/** | ||
* Resolves DID and returns DID Document | ||
* Resolves DID and returns DID Resolution Result | ||
* | ||
@@ -63,2 +69,59 @@ * @example | ||
resolveDid(args: ResolveDidArgs): Promise<DIDResolutionResult> | ||
/** | ||
* Dereferences a DID URL fragment and returns the corresponding DID document entry. | ||
* | ||
* @example | ||
* ```typescript | ||
* const did = 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190' | ||
* const didFragment = `${did}#controller` | ||
* const fragment = await agent.getDIDComponentById({ | ||
* didDocument: (await agent.resolveDid({didUrl: did}))?.didDocument, | ||
* didUrl: didFragment, | ||
* section: 'authentication' | ||
* }) | ||
* expect(fragment).toEqual({ | ||
* id: 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190#controller', | ||
* type: 'EcdsaSecp256k1RecoveryMethod2020', | ||
* controller: 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190', | ||
* blockchainAccountId: '0xb09B66026bA5909A7CFE99b76875431D2b8D5190@eip155:4', | ||
* }) | ||
* ``` | ||
* | ||
* @param args.didDocument - the DID document from which to extract the fragment. | ||
* This MUST be the document resolved by {@link resolveDid} | ||
* @param args.didUrl - the DID URI that needs to be dereferenced | ||
* @param args.section - Optional - the section of the DID Document to be used for dereferencing | ||
* | ||
* @returns a `Promise` containing the {@link did-resolver#VerificationMethod | VerificationMethod} or | ||
* {@link did-resolver#ServiceEndpoint | ServiceEndpoint} | ||
* | ||
* @throws `not_found:...` in case the fragment is not displayed in the DID document | ||
* | ||
* @beta | ||
*/ | ||
getDIDComponentById(args: { | ||
/** | ||
* the DID document from which to extract the fragment. This MUST be the document resolved by {@link resolveDid} | ||
*/ | ||
didDocument: DIDDocument | ||
/** | ||
* The DID URI that refers to the subsection by #fragment. Example: did:example:identifier#controller | ||
*/ | ||
didUrl: string | ||
/** | ||
* The section of the DID document where to search for the fragment. Example 'keyAgreement' | ||
*/ | ||
section?: DIDDocumentSection | ||
}): Promise<VerificationMethod | ServiceEndpoint> | ||
} | ||
export type DIDDocumentSection = | ||
| 'verificationMethod' | ||
| 'publicKey' //used for backward compatibility | ||
| 'service' | ||
| 'authentication' | ||
| 'assertionMethod' | ||
| 'keyAgreement' | ||
| 'capabilityInvocation' | ||
| 'capabilityDelegation' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
203806
5531
+ Addeddid-jwt-vc@2.1.3(transitive)
- Removeddid-jwt-vc@2.1.2(transitive)
Updateddid-jwt-vc@2.1.3