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]
pub fn coerce<T: nsIContentSignatureVerifierCoerce>(&self) -> &T
[src]
Cast this nsIContentSignatureVerifier
to one of its base interfaces.
impl nsIContentSignatureVerifier
[src]
pub unsafe fn VerifyContentSignature(
&self,
aData: &nsACString,
aContentSignatureHeader: &nsACString,
aCertificateChain: &nsACString,
aName: &nsACString,
_retval: *mut bool
) -> nsresult
[src]
&self,
aData: &nsACString,
aContentSignatureHeader: &nsACString,
aCertificateChain: &nsACString,
aName: &nsACString,
_retval: *mut bool
) -> nsresult
/**
* 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);
pub unsafe fn CreateContext(
&self,
aData: &nsACString,
aContentSignatureHeader: &nsACString,
aCertificateChain: &nsACString,
aName: &nsACString
) -> nsresult
[src]
&self,
aData: &nsACString,
aContentSignatureHeader: &nsACString,
aCertificateChain: &nsACString,
aName: &nsACString
) -> nsresult
/**
* 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);
pub unsafe fn CreateContextWithoutCertChain(
&self,
aCallback: *const nsIContentSignatureReceiverCallback,
aContentSignatureHeader: &nsACString,
aName: &nsACString
) -> nsresult
[src]
&self,
aCallback: *const nsIContentSignatureReceiverCallback,
aContentSignatureHeader: &nsACString,
aName: &nsACString
) -> nsresult
/**
* 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);
pub unsafe fn Update(&self, aData: &nsACString) -> nsresult
[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);
pub unsafe fn End(&self, _retval: *mut bool) -> nsresult
[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>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIContentSignatureVerifier
[src]
const IID: nsIID
IID: nsIID = nsID(1168506415, 50000, 19334, [150, 45, 2, 213, 170, 170, 149, 90])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[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]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIContentSignatureVerifier
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.