Trust levels:

  • Inner circle (just me): -- Only local keys of main identity -- Local and remote keys of main identity -- Only local keys of me someone -- Local and remote keys of me someone
  • Others -- TrustKeysCertificate by inner circle and persons that have the right to issue trusted keys

Constructors

Methods

  • Type Parameters

    • CertT extends OneObjectTypeNames

    Parameters

    • hash: SHA256Hash | SHA256IdHash
    • certType: CertT

    Returns Promise<SHA256IdHash<Person>[]>

  • Create certificate by writing it as object to the one db.

    Note: Automatic derivation of T does not work with Omit on a one object. That's why you have to specify the type separately.

    Type Parameters

    • T extends keyof OneCertificateInterfaces

    Parameters

    • type: T
    • certData: Omit<OneCertificateInterfaces[T], "$type$" | "license">
    • Optionalissuer: SHA256IdHash<Person>

    Returns Promise<{
        certificate: UnversionedObjectResult<OneCertificateInterfaces[T]>;
        license: UnversionedObjectResult<License>;
        signature: UnversionedObjectResult<Signature>;
    }>

  • Finds the key that verifies the signature.

    Attention! This might also return keys that are not trusted. You have to check the trusted value of the returned KeyTrustInfo.

    Parameters

    Returns Promise<undefined | KeyTrustInfo>

  • Check if data has a certificate of specified type issued by a specific person.

    Type Parameters

    • CertT extends OneObjectTypeNames

    Parameters

    • data: SHA256Hash | SHA256IdHash

      The data for which certificates should be checked.

    • certType: CertT

      Type of certificate to check

    • issuer: SHA256IdHash<Person>

      Check if certified by this person

    Returns Promise<boolean>

  • Check if data has a certificate of specified type issued by specific person.

    Type Parameters

    • CertT extends OneObjectTypeNames

    Parameters

    • data: SHA256Hash | SHA256IdHash

      The data for which certificates should be checked.

    • type: CertT

      Type of certificate to check

    Returns Promise<boolean>

  • Verify a signature.

    This also includes, that the key belongs to the mentioned issuer.

    Parameters

    • data: SHA256Hash
    • issuer: SHA256IdHash<Person>

    Returns Promise<boolean>

  • Return the persons who signed this object (only valid signatures - the rest is dropped)

    Parameters

    • data: SHA256Hash

    Returns Promise<SHA256IdHash<Person>[]>