(bundleFile io.ReadSeeker, integrityBlockBytes []byte, originalIntegrityBlockOffset int64, signedBundleFile *os.File)
| 15 | ) |
| 16 | |
| 17 | func writeOutput(bundleFile io.ReadSeeker, integrityBlockBytes []byte, originalIntegrityBlockOffset int64, signedBundleFile *os.File) error { |
| 18 | signedBundleFile.Write(integrityBlockBytes) |
| 19 | |
| 20 | // Move the file pointer to the start of the web bundle bytes. |
| 21 | bundleFile.Seek(originalIntegrityBlockOffset, io.SeekStart) |
| 22 | |
| 23 | // io.Copy() will do chunked read/write under the hood |
| 24 | _, err := io.Copy(signedBundleFile, bundleFile) |
| 25 | if err != nil { |
| 26 | return err |
| 27 | } |
| 28 | return nil |
| 29 | } |
| 30 | |
| 31 | func readPublicEd25519KeyFromFile(path string) (ed25519.PublicKey, error) { |
| 32 | pubkeytext, err := ioutil.ReadFile(path) |
no test coverage detected