Hierarchy

  • CCF

Properties

consensus: CCFConsensus
crypto: CCFCrypto
historical: CCFHistorical
historicalState?: HistoricalState

State associated with a specific historic transaction. Only defined for endpoints with "mode" set to "historical".

kv: KvMaps

An object that provides access to the maps of the Key-Value Store of CCF. Fields are map names and values are KvMap objects.

rpc: CCFRpc

Methods

  • Parse JSON from an ArrayBuffer.

    Equivalent to JSON.parse(ccf.bufToStr(v)).

    Type Parameters

    • T extends unknown

    Parameters

    • v: ArrayBuffer

    Returns T

  • Convert an ArrayBuffer into a string.

    Parameters

    • v: ArrayBuffer

    Returns string

  • Generate a digest (hash) of the given data.

    Parameters

    • algorithm: "SHA-256"
    • data: ArrayBuffer

    Returns ArrayBuffer

  • Generate an AES key.

    Parameters

    • size: number

      The length in bits of the key to generate. 128, 192, or 256.

    Returns ArrayBuffer

  • Generate an RSA key pair.

    Parameters

    • size: number

      The length in bits of the RSA modulus. Minimum: 2048.

    • Optional exponent: number

      The public exponent. Default: 65537.

    Returns CryptoKeyPair

  • Returns whether a string is a PEM-encoded bundle of X.509 certificates.

    A bundle consists of one or more certificates. Certificates in the bundle do not have to be related to each other. Validation is only syntactical, properties like validity dates are not evaluated.

    Parameters

    • pem: string

    Returns boolean

  • Returns whether a certificate chain is valid given a set of trusted certificates. The chain and trusted certificates are PEM-encoded bundles of X.509 certificates.

    Parameters

    • chain: string
    • trusted: string

    Returns boolean

  • Serialize a value to JSON and convert it to an ArrayBuffer.

    Equivalent to ccf.strToBuf(JSON.stringify(v)).

    Type Parameters

    • T extends unknown

    Parameters

    • v: T

    Returns ArrayBuffer

  • Convert a string into an ArrayBuffer.

    Parameters

    • v: string

    Returns ArrayBuffer

  • Wraps a key using a wrapping key.

    Constraints on the key and wrappingKey parameters depend on the wrapping algorithm that is used (wrapAlgo).

    Parameters

    Returns ArrayBuffer

Generated using TypeDoc