Struct xpcom::interfaces::nsIContentSignatureVerifier [] [src]

#[repr(C)]
pub struct nsIContentSignatureVerifier { /* fields omitted */ }

interface nsIContentSignatureVerifier : nsISupports

/**
 * An interface for verifying content-signatures, inspired by
 * https://tools.ietf.org/html/draft-thomson-http-content-signature-00
 * described here https://github.com/franziskuskiefer/content-signature/tree/pki
 *
 * A new signature verifier instance should be created for each signature
 * verification - you can create these instances with do_CreateInstance.
 *
 * There are two ways to use this functionality:
 * The first allows a signature to be verified all at once by simply calling
 * verifyContentSignature.
 * The second allows for streaming; call createContext with the signature
 * information (and initial data), call update with more data as it becomes
 * available then, finally, call end to verify the signature.
 */

Methods

impl nsIContentSignatureVerifier
[src]

[src]

Cast this nsIContentSignatureVerifier to one of its base interfaces.

impl nsIContentSignatureVerifier
[src]

[src]

/**
   * Verifies that the data matches the data that was used to generate the
   * signature.
   *
   * @param aData                   The data to be tested.
   * @param aContentSignatureHeader The content-signature header,
   *                                url-safe base64 encoded.
   * @param aCertificateChain       The certificate chain to use for verification.
   *                                PEM encoded string.
   * @param aName                   The (host)name for which the end entity must
                                    be valid.
   * @returns true if the signature matches the data and aCertificateChain is
   *          valid within aContext, false if not.
   */

[must_use] boolean verifyContentSignature (in ACString aData, in ACString aContentSignatureHeader, in ACString aCertificateChain, in ACString aName);

[src]

/**
   * Creates a context to verify a content signature against data that is added
   * later with update calls.
   *
   * @param aData                   The first chunk of data to be tested.
   * @param aContentSignatureHeader The signature of the data, url-safe base64
   *                                encoded.
   * @param aCertificateChain       The certificate chain to use for
   *                                verification. PEM encoded string.
   * @param aName                   The (host)name for which the end entity must
                                    be valid.
   */

[must_use] void createContext (in ACString aData, in ACString aContentSignatureHeader, in ACString aCertificateChain, in ACString aName);

[src]

/**
   * Creates a context to verify a content signature against data that is added
   * later with update calls.
   * This does not require the caller to download the certificate chain. It's
   * done internally.
   * It requires the x5u parameter to be present in aContentSignatureHeader
   *
   * NOTE: Callers have to wait for aCallback to return before invoking anything
   *       else. Otherwise the ContentSignatureVerifier will fail.
   *
   * @param aCallback               Callback that's invoked when the cert chain
   *                                got fetched.
   * @param aContentSignatureHeader The signature of the data, url-safe base64
   *                                encoded, and the x5u value.
   * @param aName                   The (host)name for which the end entity must
                                    be valid.
   */

[must_use] void createContextWithoutCertChain (in nsIContentSignatureReceiverCallback aCallback, in ACString aContentSignatureHeader, in ACString aName);

[src]

/**
   * Adds data to the context that was used to generate the signature.
   *
   * @param aData        More data to be tested.
   */

[must_use] void update (in ACString aData);

[src]

/**
   * Finalises the signature and returns the result of the signature
   * verification.
   *
   * @returns true if the signature matches the data added with createContext
   *          and update, false if not.
   */

[must_use] boolean end ();

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsIContentSignatureVerifier
[src]

IID: nsIID = nsID(1168506415, 50000, 19334, [150, 45, 2, 213, 170, 170, 149, 90])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsIContentSignatureVerifier
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIContentSignatureVerifier
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.