Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
⚠️ Deprecated API Notice
This API is deprecated and will be removed in a future release.
⚠️ Deprecated API Notice
This API is deprecated and will be removed in a future release.
⚠️ Deprecated API Notice
This API is deprecated and will be removed in a future release.
new ZkPassApiKey(apiKey
, secretApiKey
): ZkPassApiKey
Parameters
Returns
Readonly
apiKey: string
Readonly
secretApiKey: string
▸ getApiToken(): string
Returns
string
⚠️ Deprecated API Notice
This API is deprecated and will be removed in a future release.
Ƭ KeysetEndpoint: Object
Type declaration
Name | Type | Description |
---|---|---|
apiKey
string
secretApiKey
string
jku
string
The url of the end point
kid
string
The key to locate the public key
⚠️ Deprecated API Notice
This API is deprecated and will be removed in a future release.
|
|
|
|
Primitive data types
⚠️ Deprecated API Notice
This API is deprecated and will be removed in a future release.
Ƭ Primitive: boolean
| number
| string
| object
⚠️ Deprecated API Notice
This API is deprecated and will be removed in a future release.
▸ decryptJweToken(key
, jweToken
): Promise
<string
>
Decrypts a JWT token
Parameters
Returns
Promise
<string
>
▸ encryptDataToJweToken(key
, data
): Promise
<string
>
Encrypts data into a JWE token
Parameters
Returns
Promise
<string
>
▸ signDataToJwsToken(signingKey
, data
, verifyingKeyJwks?
): Promise
<string
>
Signs data into a JWS token
Parameters
Returns
Promise
<string
>
▸ verifyJwsToken(key
, jwsToken
): Promise
<string
>
Verifies the signature of a JWS token
Parameters
Returns
Promise
<string
>
▸ getEncryptionKey(): Promise
<string
>
Returns
Promise
<string
>
▸ getVerifyingKey(): Promise
<string
>
Returns
Promise
<string
>
The main class which implements all of the traits defined in this module
⚠️ Deprecated API Notice
This API is deprecated and will be removed in a future release.
new ZkPassClient(zkpassServiceUrl
, zkpassApiKey?
): ZkPassClient
Parameters
Returns
Private
Readonly
zkpassServiceUrl: string
Containing the URL address of the ZkPass service
Representing a pair of keys (apiKey and secretApiKey) used for accessing ZkPass services securely.
▸ encryptDataToJweToken(key
, value
): Promise
<string
>
Encrypts data to JWE token.
Parameters
Returns
Promise
<string
>
Decrypts a JWT token.
Parameters
Returns
▸ signDataToJwsToken(key
, value
, verifyingKeyJWKS?
): Promise
<string
>
Signs data to JWS token.
Parameters
Returns
Promise
<string
>
Verifies the JWT format (to be a JWS Compact format), verifies the JWS signature, validates the JWT Claims Set.
Parameters
Returns
▸ generateZkPassProof(userDataToken
, dvrToken
): Promise
<string
>
Generates a ZkPass proof.
This function calls the corresponding RESTful API provided by the zkPass Service, where the query in the DVR is processed and the proof is generated. It encrypts both the signed user data token and the signed DVR token prior to sending it to the zkPass Service.
This function is asynchronous and must be awaited. It’s designed to be used in asynchronous contexts, for example within async functions or blocks.
Parameters
Returns
Promise
<string
>
Asynchronously fetches and verifies public keys for service signing and encryption from a remote JWKS endpoint.
Returns
▸ getEncryptionKey(): Promise
<string
>
Returns
Promise
<string
>
▸ getVerifyingKey(): Promise
<string
>
Returns
Promise
<string
>
Name | Type |
---|
Name | Type |
---|
Name | Type |
---|
Name | Type |
---|
Asynchronously retrieves the service encryption public key from the function
Asynchronously retrieves the service verifying public key from the function
Name | Type |
---|
Private
Optional
Readonly
zkpassApiKey:
Name | Type |
---|
▸ decryptJweToken(key
, jwe
): Promise
<>
Name | Type |
---|
Promise
<>
Name | Type |
---|
▸ verifyJwsToken(key
, jwt
): Promise
<>
Name | Type |
---|
Promise
<>
Name | Type |
---|
▸ getKeys(): Promise
<>
Promise
<>
Asynchronously retrieves the service encryption public key from the function
Asynchronously retrieves the service verifying public key from the function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?
VerifyingKeyJWKS
⚠️ Deprecated API Notice
This API is deprecated and will be removed in a future release.