Gordian Envelope TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Class Envelope

    Implements

    Index

    Properties

    treeFormat shortId summary hex cborBytes diagnostic addAssertionEnvelopes addOptionalAssertionEnvelope addOptionalAssertion addNonemptyStringAssertion addAssertions addAssertionIf addAssertionEnvelopeIf removeAssertion replaceAssertion replaceSubject addAssertionSalted addAssertionEnvelopeSalted addOptionalAssertionEnvelopeSalted elide elideRemovingSetWithAction elideRemovingSet elideRemovingArrayWithAction elideRemovingArray elideRemovingTargetWithAction elideRemovingTarget elideRevealingSetWithAction elideRevealingSet elideRevealingArrayWithAction elideRevealingArray elideRevealingTargetWithAction elideRevealingTarget unelide nodesMatching walkUnelide walkReplace isIdenticalTo tryLeaf extractString extractNumber extractBoolean extractBytes extractNull extractSubject tryObjectForPredicate tryOptionalObjectForPredicate extractObjectForPredicateWithDefault extractObjectsForPredicate tryObjectsForPredicate isFalse isTrue isBool isNumber isSubjectNumber isNaN isSubjectNaN isNull tryByteString asByteString asArray asMap asText asLeaf asKnownValue tryKnownValue isKnownValue isSubjectUnit checkSubjectUnit hasAssertions asAssertion tryAssertion asPredicate tryPredicate asObject tryObject isAssertion isElided isLeaf isNode isWrapped isInternal isObscured assertions assertionsWithPredicate assertionWithPredicate optionalAssertionWithPredicate objectForPredicate optionalObjectForPredicate objectsForPredicate elementsCount isSubjectEncrypted isSubjectCompressed isSubjectElided setPosition position removePosition walk digests shallowDigests deepDigests object predicate elideSetWithAction urString ur taggedCborData fromUrString fromURString fromUR wrap tryUnwrap unwrap addAttachment attachmentPayload attachmentVendor attachmentConformsTo attachments attachmentsWithVendorAndConformsTo attachmentWithVendorAndConformsTo validateAttachment compress decompress compressSubject decompressSubject isCompressed encryptSubject decryptSubject encrypt decrypt isEncrypted proofContainsSet proofContainsTarget confirmContainsSet confirmContainsTarget encryptSubjectToRecipient encryptSubjectToRecipients addRecipient decryptSubjectToRecipient decryptToRecipient encryptToRecipients recipients addSalt addSaltWithLength addSaltWithLen addSaltBytes addSaltInRange addSignature addSignatureWithMetadata addSignatureOpt addSignatures addSignaturesWithMetadata hasSignatureFrom hasSignaturesFrom hasSignaturesFromThreshold hasSignatureFromReturningMetadata verifySignatureFrom verifySignaturesFrom verifySignaturesFromThreshold verifySignatureFromReturningMetadata sign signWithMetadata verify verifyReturningMetadata signatures makeSignedAssertion isVerifiedSignature verifySignature addType types getType hasType checkType newAttachment unit format formatOpt formatFlat mermaidFormat mermaidFormatOpt summaryWithContext lockSubject unlockSubject isLockedWithPassword isLockedWithSshAgent addSecret lock unlock toCbor expectLeaf checkTypeValue

    Methods

    Properties

    treeFormat: (options?: TreeFormatOptions) => string
    shortId: (format?: "short" | "full" | "ur") => string
    summary: (maxLength?: number) => string
    hex: () => string
    cborBytes: () => Uint8Array
    diagnostic: () => string
    addAssertionEnvelopes: (assertions: Envelope[]) => Envelope
    addOptionalAssertionEnvelope: (assertion: Envelope | undefined) => Envelope
    addOptionalAssertion: (
        predicate: EnvelopeEncodableValue,
        object: EnvelopeEncodableValue,
    ) => Envelope
    addNonemptyStringAssertion: (
        predicate: EnvelopeEncodableValue,
        str: string,
    ) => Envelope
    addAssertions: (envelopes: Envelope[]) => Envelope
    addAssertionIf: (
        condition: boolean,
        predicate: EnvelopeEncodableValue,
        object: EnvelopeEncodableValue,
    ) => Envelope
    addAssertionEnvelopeIf: (
        condition: boolean,
        assertionEnvelope: Envelope,
    ) => Envelope
    removeAssertion: (target: Envelope) => Envelope
    replaceAssertion: (assertion: Envelope, newAssertion: Envelope) => Envelope
    replaceSubject: (subject: Envelope) => Envelope
    addAssertionSalted: (
        predicate: EnvelopeEncodableValue,
        object: EnvelopeEncodableValue,
        salted: boolean,
    ) => Envelope
    addAssertionEnvelopeSalted: (
        assertionEnvelope: Envelope,
        salted: boolean,
    ) => Envelope
    addOptionalAssertionEnvelopeSalted: (
        assertionEnvelope: Envelope | undefined,
        salted: boolean,
    ) => Envelope
    elide: () => Envelope
    elideRemovingSetWithAction: (
        target: Set<Digest>,
        action: ObscureAction,
    ) => Envelope
    elideRemovingSet: (target: Set<Digest>) => Envelope
    elideRemovingArrayWithAction: (
        target: DigestProvider[],
        action: ObscureAction,
    ) => Envelope
    elideRemovingArray: (target: DigestProvider[]) => Envelope
    elideRemovingTargetWithAction: (
        target: DigestProvider,
        action: ObscureAction,
    ) => Envelope
    elideRemovingTarget: (target: DigestProvider) => Envelope
    elideRevealingSetWithAction: (
        target: Set<Digest>,
        action: ObscureAction,
    ) => Envelope
    elideRevealingSet: (target: Set<Digest>) => Envelope
    elideRevealingArrayWithAction: (
        target: DigestProvider[],
        action: ObscureAction,
    ) => Envelope
    elideRevealingArray: (target: DigestProvider[]) => Envelope
    elideRevealingTargetWithAction: (
        target: DigestProvider,
        action: ObscureAction,
    ) => Envelope
    elideRevealingTarget: (target: DigestProvider) => Envelope
    unelide: (envelope: Envelope) => Envelope
    nodesMatching: (
        targetDigests: Set<Digest> | undefined,
        obscureTypes: ObscureType[],
    ) => Set<Digest>
    walkUnelide: (envelopes: Envelope[]) => Envelope
    walkReplace: (target: Set<Digest>, replacement: Envelope) => Envelope
    isIdenticalTo: (other: Envelope) => boolean
    tryLeaf: () => Cbor
    extractString: () => string
    extractNumber: () => number
    extractBoolean: () => boolean
    extractBytes: () => Uint8Array
    extractNull: () => null
    extractSubject: <T>(decoder: (cbor: Cbor) => T) => T
    tryObjectForPredicate: <T>(
        predicate: EnvelopeEncodableValue,
        decoder: (cbor: Cbor) => T,
    ) => T
    tryOptionalObjectForPredicate: <T>(
        predicate: EnvelopeEncodableValue,
        decoder: (cbor: Cbor) => T,
    ) => T | undefined
    extractObjectForPredicateWithDefault: <T>(
        predicate: EnvelopeEncodableValue,
        decoder: (cbor: Cbor) => T,
        defaultValue: T,
    ) => T
    extractObjectsForPredicate: <T>(
        predicate: EnvelopeEncodableValue,
        decoder: (cbor: Cbor) => T,
    ) => T[]
    tryObjectsForPredicate: <T>(
        predicate: EnvelopeEncodableValue,
        decoder: (cbor: Cbor) => T,
    ) => T[]
    isFalse: () => boolean
    isTrue: () => boolean
    isBool: () => boolean
    isNumber: () => boolean
    isSubjectNumber: () => boolean
    isNaN: () => boolean
    isSubjectNaN: () => boolean
    isNull: () => boolean
    tryByteString: () => Uint8Array
    asByteString: () => Uint8Array<ArrayBufferLike> | undefined
    asArray: () => readonly Cbor[] | undefined
    asMap: () => CborMap | undefined
    asText: () => string | undefined
    asLeaf: () => Cbor | undefined
    asKnownValue: () => KnownValue | undefined
    tryKnownValue: () => KnownValue
    isKnownValue: () => boolean
    isSubjectUnit: () => boolean
    checkSubjectUnit: () => Envelope
    hasAssertions: () => boolean
    asAssertion: () => Envelope | undefined
    tryAssertion: () => Envelope
    asPredicate: () => Envelope | undefined
    tryPredicate: () => Envelope
    asObject: () => Envelope | undefined
    tryObject: () => Envelope
    isAssertion: () => boolean
    isElided: () => boolean
    isLeaf: () => boolean
    isNode: () => boolean
    isWrapped: () => boolean
    isInternal: () => boolean
    isObscured: () => boolean
    assertions: () => Envelope[]
    assertionsWithPredicate: (predicate: EnvelopeEncodableValue) => Envelope[]
    assertionWithPredicate: (predicate: EnvelopeEncodableValue) => Envelope
    optionalAssertionWithPredicate: (
        predicate: EnvelopeEncodableValue,
    ) => Envelope | undefined
    objectForPredicate: (predicate: EnvelopeEncodableValue) => Envelope
    optionalObjectForPredicate: (
        predicate: EnvelopeEncodableValue,
    ) => Envelope | undefined
    objectsForPredicate: (predicate: EnvelopeEncodableValue) => Envelope[]
    elementsCount: () => number
    isSubjectEncrypted: () => boolean
    isSubjectCompressed: () => boolean
    isSubjectElided: () => boolean
    setPosition: (position: number) => Envelope
    position: () => number
    removePosition: () => Envelope
    walk: <State>(hideNodes: boolean, state: State, visit: Visitor<State>) => void
    digests: (levelLimit: number) => Set<Digest>
    shallowDigests: () => Set<Digest>
    deepDigests: () => Set<Digest>
    object: () => Envelope
    predicate: () => Envelope
    elideSetWithAction: (target: Set<Digest>, action: ObscureAction) => Envelope
    urString: () => string
    ur: () => UR
    taggedCborData: () => Uint8Array
    fromUrString: (urString: string) => Envelope
    fromURString: (urString: string) => Envelope
    fromUR: (ur: UR) => Envelope
    wrap: () => Envelope
    tryUnwrap: () => Envelope
    unwrap: () => Envelope
    addAttachment: (
        payload: EnvelopeEncodableValue,
        vendor: string,
        conformsTo?: string,
    ) => Envelope
    attachmentPayload: () => Envelope
    attachmentVendor: () => string
    attachmentConformsTo: () => string | undefined
    attachments: () => Envelope[]
    attachmentsWithVendorAndConformsTo: (
        vendor?: string,
        conformsTo?: string,
    ) => Envelope[]
    attachmentWithVendorAndConformsTo: (
        vendor?: string,
        conformsTo?: string,
    ) => Envelope
    validateAttachment: () => void
    compress: () => Envelope
    decompress: () => Envelope
    compressSubject: () => Envelope
    decompressSubject: () => Envelope
    isCompressed: () => boolean
    encryptSubject: (key: SymmetricKey) => Envelope
    decryptSubject: (key: SymmetricKey) => Envelope
    encrypt: (key: SymmetricKey) => Envelope
    decrypt: (key: SymmetricKey) => Envelope
    isEncrypted: () => boolean
    proofContainsSet: (target: Set<Digest>) => Envelope | undefined
    proofContainsTarget: (target: Envelope) => Envelope | undefined
    confirmContainsSet: (target: Set<Digest>, proof: Envelope) => boolean
    confirmContainsTarget: (target: Envelope, proof: Envelope) => boolean
    encryptSubjectToRecipient: (recipientPublicKey: PublicKeyBase) => Envelope
    encryptSubjectToRecipients: (recipients: PublicKeyBase[]) => Envelope
    addRecipient: (
        recipientPublicKey: PublicKeyBase,
        contentKey: SymmetricKey,
    ) => Envelope
    decryptSubjectToRecipient: (recipientPrivateKey: PrivateKeyBase) => Envelope
    decryptToRecipient: (recipientPrivateKey: PrivateKeyBase) => Envelope
    encryptToRecipients: (recipients: PublicKeyBase[]) => Envelope
    recipients: () => SealedMessage[]
    addSalt: () => Envelope
    addSaltWithLength: (count: number) => Envelope
    addSaltWithLen: (count: number) => Envelope
    addSaltBytes: (saltBytes: Uint8Array) => Envelope
    addSaltInRange: (min: number, max: number) => Envelope
    addSignature: (signer: Signer) => Envelope
    addSignatureWithMetadata: (
        signer: Signer,
        metadata?: SignatureMetadata,
    ) => Envelope
    addSignatureOpt: (
        signer: Signer,
        options?: unknown,
        metadata?: SignatureMetadata,
    ) => Envelope
    addSignatures: (signers: Signer[]) => Envelope
    addSignaturesWithMetadata: (
        signersWithMetadata: { signer: Signer; metadata?: SignatureMetadata }[],
    ) => Envelope
    hasSignatureFrom: (verifier: Verifier) => boolean
    hasSignaturesFrom: (verifiers: Verifier[]) => boolean
    hasSignaturesFromThreshold: (
        verifiers: Verifier[],
        threshold: number,
    ) => boolean
    hasSignatureFromReturningMetadata: (verifier: Verifier) => Envelope | undefined
    verifySignatureFrom: (verifier: Verifier) => Envelope
    verifySignaturesFrom: (verifiers: Verifier[]) => Envelope
    verifySignaturesFromThreshold: (
        verifiers: Verifier[],
        threshold?: number,
    ) => Envelope
    verifySignatureFromReturningMetadata: (verifier: Verifier) => Envelope
    sign: (signer: Signer) => Envelope
    signWithMetadata: (signer: Signer, metadata?: SignatureMetadata) => Envelope
    verify: (verifier: Verifier) => Envelope
    verifyReturningMetadata: (
        verifier: Verifier,
    ) => { envelope: Envelope; metadata?: SignatureMetadata }
    signatures: () => Envelope[]
    makeSignedAssertion: (signature: Signature, note?: string) => Envelope
    isVerifiedSignature: (signature: Signature, verifier: Verifier) => boolean
    verifySignature: (signature: Signature, verifier: Verifier) => Envelope
    addType: (object: EnvelopeEncodableValue) => Envelope
    types: () => Envelope[]
    getType: () => Envelope
    hasType: (t: EnvelopeEncodableValue) => boolean
    checkType: (t: EnvelopeEncodableValue) => void
    newAttachment: (
        payload: EnvelopeEncodableValue,
        vendor: string,
        conformsTo?: string,
    ) => Envelope
    unit: () => Envelope
    format: () => string
    formatOpt: (opts: EnvelopeFormatOpts) => string
    formatFlat: () => string
    mermaidFormat: () => string
    mermaidFormatOpt: (opts: MermaidFormatOpts) => string
    summaryWithContext: (maxLength: number, context: FormatContext) => string
    lockSubject: (method: KeyDerivationMethod, secret: Uint8Array) => Envelope
    unlockSubject: (secret: Uint8Array) => Envelope
    isLockedWithPassword: () => boolean
    isLockedWithSshAgent: () => boolean
    addSecret: (
        method: KeyDerivationMethod,
        secret: Uint8Array,
        contentKey: SymmetricKey,
    ) => Envelope
    lock: (method: KeyDerivationMethod, secret: Uint8Array) => Envelope
    unlock: (secret: Uint8Array) => Envelope
    toCbor: () => unknown
    expectLeaf: () => unknown
    checkTypeValue: (type: unknown) => void

    Methods