@hyperledger/identus-edge-agent-sdk / Exports / Pollux
Class: Pollux
Implementation of Pollux
Export
Pollux
Hierarchy
-
↳
Pollux
Implements
Table of contents
Constructors
Properties
Accessors
Methods
- _start
- _stop
- createAnoncredsPresentationSubmission
- createJWTPresentationSubmission
- createPresentationDefinitionRequest
- createPresentationProof
- createPresentationSubmission
- encode
- extractEncodedList
- extractVerificationStatusFromCredential
- extractVerificationStatusFromResponse
- fetchCredentialDefinition
- fetchRevocationRegistry
- fetchSchema
- getDescriptorItems
- getSigningKid
- isCredentialRevoked
- isOfferPayload
- isPresentationDefinitionRequestType
- parseCredential
- parsePresentationSubmission
- processCredentialOffer
- revealCredentialFields
- start
- stop
- validPresentationSubmissionOptions
- validateInputDescriptor
- validatePresentationDefinitionOptions
- verifyPresentationSubmission
- verifyPresentationSubmissionAnoncreds
- verifyPresentationSubmissionJWT
- verifyRevocationProof
Constructors
constructor
• new Pollux(apollo
, castor
, api?
, JWT?
, SDJWT?
): Pollux
Parameters
Name | Type |
---|---|
apollo | Apollo |
castor | Castor |
api | Api |
JWT | JWT |
SDJWT | SDJWT |
Returns
Overrides
Defined in
Properties
JWT
• Private
JWT: JWT
Defined in
SDJWT
• Private
SDJWT: SDJWT
Defined in
_anoncreds
• Private
_anoncreds: undefined
| AnoncredsLoader
Defined in
_jwe
• Private
_jwe: undefined
| __module
Defined in
_pako
• Private
_pako: typeof Pako
= pako
Defined in
api
• Private
api: Api
Defined in
apollo
• Private
apollo: Apollo
Defined in
castor
• Private
castor: Castor
Defined in
state
• state: State
= State.STOPPED
current status of the entity
Inherited from
Defined in
src/domain/protocols/Startable.ts:42
Accessors
anoncreds
• get
anoncreds(): AnoncredsLoader
Returns
AnoncredsLoader
Defined in
jwe
• get
jwe(): __module
Returns
__module
Defined in
Methods
_start
▸ _start(): Promise
<void
>
internal method to define specific startup routine
used by start()
internally
implement with protected
to keep hidden from class interface
Returns
Promise
<void
>
Overrides
Defined in
_stop
▸ _stop(): Promise
<void
>
internal method to define teardown routine
used by stop()
internally
implement with protected
to keep hidden from class interface
Returns
Promise
<void
>
Overrides
Defined in
createAnoncredsPresentationSubmission
▸ createAnoncredsPresentationSubmission(presentationDefinitionRequest
, credential
, linkSecret
): Promise
<PresentationType
>
Parameters
Name | Type |
---|---|
presentationDefinitionRequest | PresentationRequestType |
credential | AnonCredsCredential |
linkSecret | LinkSecret |
Returns
Promise
<PresentationType
>
Defined in
createJWTPresentationSubmission
▸ createJWTPresentationSubmission(presentationDefinitionRequest
, credential
, privateKey
, options?
): Promise
<JWTPresentationSubmission
>
Parameters
Name | Type |
---|---|
presentationDefinitionRequest | any |
credential | Credential |
privateKey | PrivateKey |
options? | Object |
options.challenge? | string |
options.domain? | string |
options.presentationFrame? | boolean | Record <number , boolean > | |
Returns
Promise
<JWTPresentationSubmission
>
Defined in
createPresentationDefinitionRequest
▸ createPresentationDefinitionRequest<Type
>(type
, presentationClaims
, presentationOptions
): Promise
<PresentationDefinitionRequest
<Type
>>
Creates a PresentationDefinitionRequest object for oob Verifications
Type parameters
Name | Type |
---|---|
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
type | Type |
presentationClaims | PresentationClaims <Type > |
presentationOptions | PresentationOptions |
Returns
Promise
<PresentationDefinitionRequest
<Type
>>
Implementation of
Pollux.createPresentationDefinitionRequest
Defined in
createPresentationProof
▸ createPresentationProof(presentationRequest
, credential
, options
): Promise
<string
>
Process a PresentationRequest with Credential to create a Presentation.
Parameters
Name | Type | Description |
---|---|---|
presentationRequest | PresentationRequest <any , unknown > | |
credential | Credential | |
options | options | object containing necessary metadata |
Returns
Promise
<string
>
dependent on the CredentialType
Throws
Implementation of
Pollux.createPresentationProof
Defined in
createPresentationSubmission
▸ createPresentationSubmission<Type
>(presentationDefinitionRequest
, credential
, privateKey?
, options?
): Promise
<PresentationSubmission
<Type
>>
Type parameters
Name | Type |
---|---|
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
presentationDefinitionRequest | PresentationDefinitionRequest <Type > |
credential | Credential |
privateKey? | PrivateKey | LinkSecret |
options? | Object |
options.challenge? | string |
options.domain? | string |
options.presentationFrame? | boolean | Record <number , boolean > | |
Returns
Promise
<PresentationSubmission
<Type
>>
Implementation of
Pollux.createPresentationSubmission
Defined in
encode
▸ encode(data
): Promise
<Buffer
>
Parameters
Name | Type |
---|---|
data | any |
Returns
Promise
<Buffer
>
Defined in
extractEncodedList
▸ extractEncodedList(body
): Uint8Array
Parameters
Name | Type |
---|---|
body | JWTStatusListResponse |
Returns
Uint8Array
Defined in
extractVerificationStatusFromCredential
▸ extractVerificationStatusFromCredential(credentialStatus
): credentialStatus is JWTRevocationStatus
Parameters
Name | Type |
---|---|
credentialStatus | any |
Returns
credentialStatus is JWTRevocationStatus
Defined in
extractVerificationStatusFromResponse
▸ extractVerificationStatusFromResponse(credentialStatus
): boolean
Parameters
Name | Type |
---|---|
credentialStatus | any |
Returns
boolean
Defined in
fetchCredentialDefinition
▸ fetchCredentialDefinition(credentialDefinitionId
): Promise
<CredentialDefinitionType
>
handle the retrieval of a Credential Definition
Parameters
Name | Type |
---|---|
credentialDefinitionId | string |
Returns
Promise
<CredentialDefinitionType
>
Defined in
fetchRevocationRegistry
▸ fetchRevocationRegistry(revocationStatus
): Promise
<JWTStatusListResponse
>
Parameters
Name | Type |
---|---|
revocationStatus | JWTRevocationStatus |
Returns
Promise
<JWTStatusListResponse
>
Defined in
fetchSchema
▸ fetchSchema(schemaURI
): Promise
<CredentialSchemaType
>
handle the retrieval of a Schema definition
Parameters
Name | Type | Description |
---|---|---|
schemaURI | string | URI used to retrieve the Schema definition |
Returns
Promise
<CredentialSchemaType
>
Defined in
getDescriptorItems
▸ getDescriptorItems(inputDescriptors
, credential
): DescriptorItem
[]
Parameters
Name | Type |
---|---|
inputDescriptors | InputDescriptor [] |
credential | Credential |
Returns
Defined in
getSigningKid
▸ getSigningKid(did
, privateKey
): Promise
<undefined
| string
>
try to match the privateKey with a dids verificationMethod returning the relevant key id
Parameters
Name | Type |
---|---|
did | DID |
privateKey | PrivateKey |
Returns
Promise
<undefined
| string
>
kid (key identifier) // ??? replaced by CreateJWT task
Defined in
isCredentialRevoked
▸ isCredentialRevoked(credential
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
credential | Credential |
Returns
Promise
<boolean
>
Implementation of
Defined in
isOfferPayload
▸ isOfferPayload<Type
>(offer
, type
): offer is CredentialOfferJWTBasePayload
Type parameters
Name | Type |
---|---|
Type | extends CredentialType |
Parameters
Name | Type |
---|---|
offer | any |
type | Type |
Returns
offer is CredentialOfferJWTBasePayload
Defined in
isPresentationDefinitionRequestType
▸ isPresentationDefinitionRequestType<Type
>(request
, type
): request is PresentationDefinitionRequest<Type>
Type parameters
Name | Type |
---|---|
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
request | PresentationDefinitionRequest <Type > |
type | Type |
Returns
request is PresentationDefinitionRequest<Type>
Defined in
parseCredential
▸ parseCredential(credentialBuffer
, options?
): Promise
<AnonCredsCredential
| JWTCredential
| SDJWTCredential
>
Parameters
Name | Type |
---|---|
credentialBuffer | Uint8Array |
options? | Object |
options.credentialMetadata? | CredentialRequestMetadataType |
options.linkSecret? | string |
options.type | CredentialType |
Returns
Promise
<AnonCredsCredential
| JWTCredential
| SDJWTCredential
>
Implementation of
Defined in
parsePresentationSubmission
▸ parsePresentationSubmission<Type
>(data
, type
): data is PresentationSubmission<Type>
Type parameters
Name | Type |
---|---|
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
data | any |
type | Type |
Returns
data is PresentationSubmission<Type>
Defined in
processCredentialOffer
▸ processCredentialOffer<Types
>(offer
, options
): Promise
<ProcessedCredentialOfferPayloads
[Types
]>
Type parameters
Name | Type |
---|---|
Types | extends CredentialOfferTypes |
Parameters
Name | Type |
---|---|
offer | CredentialOfferPayloads [Types ] |
options | CredentialRequestOptions |
Returns
Promise
<ProcessedCredentialOfferPayloads
[Types
]>
Implementation of
Defined in
revealCredentialFields
▸ revealCredentialFields(credential
, fields
, linkSecret?
): Promise
<Record
<string
, any
>>
Parameters
Name | Type |
---|---|
credential | Credential |
fields | string [] |
linkSecret? | string |
Returns
Promise
<Record
<string
, any
>>
Implementation of
Defined in
start
▸ start(): Promise
<State
>
handle the startup of an entity
updates state
according to lifecycle
Returns
Promise
<State
>
Inherited from
Defined in
src/domain/protocols/Startable.ts:62
stop
▸ stop(): Promise
<State
>
handle the teardown of an entity
updates state
according to lifecycle
Returns
Promise
<State
>
Inherited from
Defined in
src/domain/protocols/Startable.ts:72
validPresentationSubmissionOptions
▸ validPresentationSubmissionOptions<Response
, Type
>(options
, type
): options is Response
Type parameters
Name | Type |
---|---|
Response | extends options |
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
options | any |
type | Type |
Returns
options is Response
Defined in
validateInputDescriptor
▸ validateInputDescriptor(vc
, descriptorMapper
, inputDescriptor
): void
Parameters
Name | Type |
---|---|
vc | any |
descriptorMapper | DescriptorPath |
inputDescriptor | undefined | InputDescriptor |
Returns
void
Defined in
validatePresentationDefinitionOptions
▸ validatePresentationDefinitionOptions(type
, options
): PresentationJWTOptions
Parameters
Name | Type |
---|---|
type | CredentialType |
options | AnoncredsPresentationOptions | JWTPresentationOptions | SDJWPresentationOptions |
Returns
Defined in
verifyPresentationSubmission
▸ verifyPresentationSubmission(presentationSubmission
, options
): Promise
<boolean
>
Process a PresentationSubmission, resolve the issuer did and verify the credential and the holder signature
Parameters
Name | Type | Description |
---|---|---|
presentationSubmission | PresentationType | - |
options | Anoncreds | object containing necessary metadata |
Returns
Promise
<boolean
>
true if the submission is valid or false if it is not
Implementation of
Pollux.verifyPresentationSubmission
Defined in
▸ verifyPresentationSubmission(presentationSubmission
, options
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
presentationSubmission | JWTPresentationSubmission |
options | JWT |
Returns
Promise
<boolean
>
Implementation of
Pollux.verifyPresentationSubmission
Defined in
▸ verifyPresentationSubmission(presentationSubmission
, options
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
presentationSubmission | JWTPresentationSubmission |
options | SDJWT |
Returns
Promise
<boolean
>
Implementation of
Pollux.verifyPresentationSubmission
Defined in
verifyPresentationSubmissionAnoncreds
▸ verifyPresentationSubmissionAnoncreds(presentationSubmission
, options
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
presentationSubmission | PresentationType |
options | Anoncreds |
Returns
Promise
<boolean
>
Defined in
verifyPresentationSubmissionJWT
▸ verifyPresentationSubmissionJWT(presentationSubmission
, options
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
presentationSubmission | JWTPresentationSubmission |
options | JWT |
Returns
Promise
<boolean
>
Defined in
▸ verifyPresentationSubmissionJWT(presentationSubmission
, options
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
presentationSubmission | JWTPresentationSubmission |
options | SDJWT |
Returns
Promise
<boolean
>
Defined in
verifyRevocationProof
▸ verifyRevocationProof(revocation
, statusListIndex
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
revocation | JWTStatusListResponse |
statusListIndex | number |
Returns
Promise
<boolean
>