How to use the @aws-crypto/serialize.serializeSignatureInfo function in @aws-crypto/serialize

To help you get started, we’ve selected a few @aws-crypto/serialize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-encryption-sdk-javascript / modules / encrypt-node / src / signature_stream.ts View on Github external
_flush (callback: Function) {
    if (this._signer) {
      const signature = this._signer.awsCryptoSign()
      this.push(serializeSignatureInfo(signature))
    }
    callback()
  }
}
github aws / aws-encryption-sdk-javascript / modules / encrypt-browser / src / encrypt.ts View on Github external
bodyContent.push(frameHeader, cipherBufferAndAuthTag)
  }

  const result = concatBuffers(
    header,
    headerAuthIv,
    headerAuthTag,
    ...bodyContent
  )

  dispose()

  if (typeof subtleSign === 'function') {
    const signatureArrayBuffer = await subtleSign(result)
    const derSignature = raw2der(new Uint8Array(signatureArrayBuffer), material.suite)
    const signatureInfo = serializeSignatureInfo(derSignature)
    return { result: concatBuffers(result, signatureInfo), messageHeader }
  } else {
    return { result: result, messageHeader }
  }
}