Interface ContentVerifier


public interface ContentVerifier
A streaming verifier of a signature over to-be-signed content.

Callers write the exact to-be-signed DER to contentStream() and then call verify(byte[]) with the signature to check. Verification is performed against a public key that was fixed when the verifier was created (see the zeroecho.pkix factory methods).

Lifecycle

An instance is single-use and need not be thread-safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the stream into which the to-be-signed bytes are written.
    boolean
    verify(byte[] signature)
    Verifies the given signature against the content written to contentStream().
  • Method Details

    • contentStream

      OutputStream contentStream()
      Returns the stream into which the to-be-signed bytes are written.
      Returns:
      the to-be-signed content output stream
    • verify

      boolean verify(byte[] signature)
      Verifies the given signature against the content written to contentStream().
      Parameters:
      signature - the signature bytes to verify
      Returns:
      true if the signature is valid, false otherwise