/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This code is made available to you under your choice of the following sets *oflicensingterms:
*/ /* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis *file,Youcanobtainoneathttp://mozilla.org/MPL/2.0/.
*/ /* Copyright 2013 Mozilla Contributors * *LicensedundertheApacheLicense,Version2.0(the"License"); *youmaynotusethisfileexceptincompliancewiththeLicense. *YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
// Verifies the PKCS#1.5 signature on the given data using the given RSA public // key.
Result VerifyRSAPKCS1SignedDataNSS(Input data, DigestAlgorithm digestAlgorithm,
Input signature, Input subjectPublicKeyInfo, void* pkcs11PinArg);
// Verifies the RSA-PSS signature on the given data using the given RSA // public key.
Result VerifyRSAPSSSignedDataNSS(Input data, DigestAlgorithm digestAlgorithm,
Input signature, Input subjectPublicKeyInfo, void* pkcs11PinArg);
// Verifies the ECDSA signature on the given data using the given ECC public // key.
Result VerifyECDSASignedDataNSS(Input data, DigestAlgorithm digestAlgorithm,
Input signature, Input subjectPublicKeyInfo, void* pkcs11PinArg);
// Computes the digest of the given data using the given digest algorithm. // // item contains the data to hash. // digestBuf must point to a buffer to where the digest will be written. // digestBufLen must be the size of the buffer, which must be exactly equal // to the size of the digest output (20 for SHA-1, 32 for SHA-256, // etc.) // // TODO: Taking the output buffer as (uint8_t*, size_t) is counter to our // other, extensive, memory safety efforts in mozilla::pkix, and we should find // a way to provide a more-obviously-safe interface.
Result DigestBufNSS(Input item, DigestAlgorithm digestAlg, /*out*/ uint8_t* digestBuf, size_t digestBufLen);
Result MapPRErrorCodeToResult(PRErrorCode errorCode);
PRErrorCode MapResultToPRErrorCode(Result result);
// The error codes within each module must fit in 16 bits. We want these // errors to fit in the same module as the NSS errors but not overlap with // any of them. Converting an NSS SEC, NSS SSL, or PSM error to an NS error // involves negating the value of the error and then synthesizing an error // in the NS_ERROR_MODULE_SECURITY module. Hence, PSM errors will start at // a negative value that both doesn't overlap with the current value // ranges for NSS errors and that will fit in 16 bits when negated. staticconst PRErrorCode ERROR_BASE = -0x4000; staticconst PRErrorCode ERROR_LIMIT = ERROR_BASE + 1000;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.