Options
All
  • Public
  • Public/Protected
  • All
Menu

@metaio/meta-signature-util

Index

Type aliases

AuthorMediaSignatureMetadata: { @context: "https://metanetwork.online/ns/cms"; @type: "author-media-sign"; @version: string; categories: string; claim: string; contentType: string; cover: string; license: string; nonce: string; platform: string; platformHash: string; publicKey: string; signature: string; signatureAlgorithm: "curve25519"; tags: string; title: string; ts: number }

Type declaration

  • @context: "https://metanetwork.online/ns/cms"
  • @type: "author-media-sign"
  • @version: string
  • categories: string
  • claim: string
  • contentType: string
  • cover: string
  • license: string
  • nonce: string
  • platform: string
  • platformHash: string
  • publicKey: string
  • signature: string
  • signatureAlgorithm: "curve25519"
  • tags: string
  • title: string
  • ts: number
AuthorPostDigestMetadata: { @context: "https://metanetwork.online/ns/cms"; @type: "author-post-digest"; @version: string; algorithm: "sha256" | "sha512"; categories: string; content: string; cover: string; digest: string; license: string; summary: string; tags: string; title: string; ts: number }

Type declaration

  • @context: "https://metanetwork.online/ns/cms"
  • @type: "author-post-digest"
  • @version: string
  • algorithm: "sha256" | "sha512"
  • categories: string
  • content: string
  • cover: string
  • digest: string
  • license: string
  • summary: string
  • tags: string
  • title: string
  • ts: number
AuthorPostSignatureMetadata: BaseSignatureMetadata & { claim: string; digest: string; nonce: string }
BaseSignatureMetadata: { @context: "https://metanetwork.online/ns/cms"; @type: string; @version: string; claim: string; nonce: string; publicKey: string; reference: { body: any; refer: string; rel: string }[]; signature: string; signatureAlgorithm: "curve25519"; ts: number }

Type declaration

  • @context: "https://metanetwork.online/ns/cms"
  • @type: string
  • @version: string
  • claim: string
  • nonce: string
  • publicKey: string
  • reference: { body: any; refer: string; rel: string }[]
  • signature: string
  • signatureAlgorithm: "curve25519"
  • ts: number
GridMaintenanceRequestMetadata: Partial<GridProperties> & { previousTx?: string }
KeyPair: { private: string; public: string }

Type declaration

  • private: string
  • public: string
KeyValuePair: [string, string]
MediaMetadata: { categories: string; contentType: string; cover: string; license: string; platform: string; platformHash: string; tags: string; title: string }

Type declaration

  • categories: string
  • contentType: string
  • cover: string
  • license: string
  • platform: string
  • platformHash: string
  • tags: string
  • title: string
MediaMetadataInPayload: { claim: string; contentType: string; nonce: string; platform: string; platformHash: string }

Type declaration

  • claim: string
  • contentType: string
  • nonce: string
  • platform: string
  • platformHash: string
MetadataInPayload: { claim: string; nonce: string }

Type declaration

  • claim: string
  • nonce: string
MetadataInPayloadWithDigest: MetadataInPayload & { digest: string }
MetadataInPayloadWithSignature: MetadataInPayload & { signature: string }
PostMetadata: { categories: string; content: string; cover: string; license: string; summary: string; tags: string; title: string }

Type declaration

  • categories: string
  • content: string
  • cover: string
  • license: string
  • summary: string
  • tags: string
  • title: string

Properties

authorMediaSign: { generate: (authorKeys: KeyPair, serverDomain: string, mediaMetadata: MediaMetadata) => AuthorMediaSignatureMetadata; verify: (metadata: AuthorMediaSignatureMetadata) => boolean }

Type declaration

authorPostDigest: { generate: (postMetadata: PostMetadata) => AuthorPostDigestMetadata; verify: (metadata: AuthorPostDigestMetadata) => boolean }

Type declaration

authorPostDigestSign: { generate: (authorKeys: KeyPair, serverDomain: string, digest: string) => AuthorPostSignatureMetadata; verify: (metadata: AuthorPostSignatureMetadata) => boolean }

Type declaration

authorPublishMetaSpaceRequest: { generate: (authorKeys: KeyPair, serverDomain: string) => BaseSignatureMetadata; verify: (metadata: BaseSignatureMetadata) => boolean }

Type declaration

authorPublishMetaSpaceServerVerificationSign: { generate: (serverKeys: KeyPair, serverDomain: string, authorPublishMetaSpaceRequestMetadata: BaseSignatureMetadata, authorPublishMetaSpaceRequestMetadataRefer: string) => BaseSignatureMetadata; verify: (metadata: BaseSignatureMetadata) => boolean }

Type declaration

  • generate: (serverKeys: KeyPair, serverDomain: string, authorPublishMetaSpaceRequestMetadata: BaseSignatureMetadata, authorPublishMetaSpaceRequestMetadataRefer: string) => BaseSignatureMetadata
      • Generate the server's verification signature metadata for the author's request to publish their Meta Space to this server.

        Parameters

        • serverKeys: KeyPair

          The server keys to use for signing.

        • serverDomain: string

          The server domain to use in the claim.

        • authorPublishMetaSpaceRequestMetadata: BaseSignatureMetadata

          The author's publish request metadata object.

        • authorPublishMetaSpaceRequestMetadataRefer: string

          URI reference to the author's publish request metadata.

        Returns BaseSignatureMetadata

        The server's signed verification metadata.

  • verify: (metadata: BaseSignatureMetadata) => boolean
metaNetworkGridsServerSign: { generate: (serverKeys: KeyPair, serverDomain: string, items: GridMaintenanceRequestMetadata[]) => BatchGridActionsMetadata; verify: (metadata: BatchGridActionsMetadata) => boolean }

Type declaration

serverVerificationSign: { generate: (serverKeys: KeyPair, serverDomain: string, authorDigestSignatureMetadata: BaseSignatureMetadata, authorDigestSignatureMetadataRefer: string) => BaseSignatureMetadata; verify: (metadata: BaseSignatureMetadata) => boolean }

Type declaration

  • generate: (serverKeys: KeyPair, serverDomain: string, authorDigestSignatureMetadata: BaseSignatureMetadata, authorDigestSignatureMetadataRefer: string) => BaseSignatureMetadata
      • Generate the server's verification signature metadata for the author's signature metadata of their post digest.

        Parameters

        • serverKeys: KeyPair

          the server's private and public key pair

        • serverDomain: string

          The server domain to use in the claim.

        • authorDigestSignatureMetadata: BaseSignatureMetadata

          the author's signature metadata of their post digest or media

        • authorDigestSignatureMetadataRefer: string

          URI reference to the author's signature metadata of their post digest or media

        Returns BaseSignatureMetadata

        server's signed verification metadata

  • verify: (metadata: BaseSignatureMetadata) => boolean
serverVerificationSignWithContent: { generate: (authorPostDigestMetadata: AuthorPostDigestMetadata, authorPostDigestMetadataRefer: string, serverVerificationSignatureMetadata: BaseSignatureMetadata) => BaseSignatureMetadata; verify: (metadata: BaseSignatureMetadata) => boolean }

Type declaration

Functions

  • generateKeys(passphrase: string[]): { private: string; public: string }
  • Generates a new key pair from the given seed and returns it as object. Each word of the passphrase array should be in the 'niceware' wordlist. see: https://www.npmjs.com/package/niceware

    Parameters

    • passphrase: string[]

    Returns { private: string; public: string }

    key pair

    • private: string
    • public: string
  • generateSeed(): string[]
  • Generate a random 16 words (32bits length) passphrase as seed by niceware. You can pass the seed to generateKey function.

    Returns string[]

    passphrase array

Generated using TypeDoc