Class Gateway<PeerAddress>Abstract

Type Parameters

  • PeerAddress extends PeerInternetAddress

Hierarchy (view full)

Constructors

Properties

cryptoOptions: Partial<NodeCryptoOptions>
id: string
identityKeyPair: CryptoKeyPair
keyStores: KeyStoreSet

Methods

  • Generate and store a new session key.

    Parameters

    • Optional peerId: string

      The peer to bind the key to, unless it's an initial key

    Returns Promise<SessionKey>

  • Type Parameters

    • S extends Signer<S>

    Parameters

    • peerId: string
    • signerClass: (new (certificate, privateKey) => S)
        • new (certificate, privateKey): S
        • Parameters

          Returns S

    Returns Promise<null | S>

  • Type Parameters

    • V extends Verifier<V>

    Parameters

    • peerId: string
    • verifierClass: (new (trustedCertificates) => V)
        • new (trustedCertificates): V
        • Parameters

          Returns V

    Returns Promise<V>

  • Decrypt and return the payload in the message.

    Also store the session key from the sender.

    Type Parameters

    • P extends GatewayPayload

    Parameters

    Returns Promise<P>

  • Validate the message and report whether it's correctly bound for this node.

    Parameters

    • message: RAMFMessage<GatewayPayload>

      The message to validate

    • Optional trustedCertificates: readonly Certificate[]

      If authorisation should be verified

    Returns Promise<void>

    Throws

    If the message is invalid

Generated using TypeDoc