1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/manager/ssl/public/nsIDataSignatureVerifier.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +/** 1.12 + * An interface for verifying that a given string of data was signed by the 1.13 + * private key matching the given public key. 1.14 + */ 1.15 +[scriptable, uuid(0a84b3d5-6ba9-432d-89da-4fbd0b0f2aec)] 1.16 +interface nsIDataSignatureVerifier : nsISupports 1.17 +{ 1.18 + /** 1.19 + * Verifies that the data matches the data that was used to generate the 1.20 + * signature. 1.21 + * 1.22 + * @param aData The data to be tested. 1.23 + * @param aSignature The signature of the data, base64 encoded. 1.24 + * @param aPublicKey The public part of the key used for signing, DER encoded 1.25 + * then base64 encoded. 1.26 + * @returns true if the signature matches the data, false if not. 1.27 + */ 1.28 + boolean verifyData(in ACString aData, in ACString aSignature, in ACString aPublicKey); 1.29 +};