15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* ***** BEGIN LICENSE BLOCK ***** 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Version: MPL 1.1/GPL 2.0/LGPL 2.1 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The contents of this file are subject to the Mozilla Public License Version 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1.1 (the "License"); you may not use this file except in compliance with 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the License. You may obtain a copy of the License at 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * http://www.mozilla.org/MPL/ 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Software distributed under the License is distributed on an "AS IS" basis, 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * for the specific language governing rights and limitations under the 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * License. 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The Original Code is the Netscape security libraries. 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The Initial Developer of the Original Code is 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Netscape Communications Corporation. 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Portions created by the Initial Developer are Copyright (C) 2000 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the Initial Developer. All Rights Reserved. 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Contributor(s): 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Ian McGreer <mcgreer@netscape.com> 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Javier Delgadillo <javi@netscape.com> 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * John Gardiner Myers <jgmyers@speakeasy.net> 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Martin v. Loewis <martin@v.loewis.de> 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Alternatively, the contents of this file may be used under the terms of 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * either the GNU General Public License Version 2 or later (the "GPL"), or 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * in which case the provisions of the GPL or the LGPL are applicable instead 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * of those above. If you wish to allow use of your version of this file only 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * under the terms of either the GPL or the LGPL, and not to allow others to 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * use your version of this file under the terms of the MPL, indicate your 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * decision by deleting the provisions above and replace them with the notice 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * and other provisions required by the GPL or the LGPL. If you do not delete 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the provisions above, a recipient may use your version of this file under 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the terms of any one of the MPL, the GPL or the LGPL. 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * ***** END LICENSE BLOCK ***** */ 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSNSSCERTHELPER_H_ 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSNSSCERTHELPER_H_ 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <cert.h> 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string> 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h" 49c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "net/cert/cert_database.h" 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace mozilla_security_manager { 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string DumpOidString(SECItem* oid); 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string GetOIDText(SECItem* oid); 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessRDN(CERTRDN* rdn); 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessName(CERTName* name); 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessBasicConstraints(SECItem* extension_data); 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessGeneralName(PRArenaPool* arena, 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) CERTGeneralName* current); 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessGeneralNames(PRArenaPool* arena, 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) CERTGeneralName* name_list); 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessAltName(SECItem* extension_data); 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessSubjectKeyId(SECItem* extension_data); 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessAuthKeyId(SECItem* extension_data); 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessCrlDistPoints(SECItem* extension_data); 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessAuthInfoAccess(SECItem* extension_data); 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessIA5String(SECItem* extension_data); 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessBMPString(SECItem* extension_data); 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessNSCertTypeExtension(SECItem* extension_data); 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessKeyUsageBitString(SECItem* bitstring, char sep); 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessKeyUsageExtension(SECItem* extension_data); 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessExtKeyUsage(SECItem* extension_data); 74cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)std::string ProcessExtensionData(CERTCertExtension* extension); 755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)std::string ProcessSubjectPublicKeyInfo(CERTSubjectPublicKeyInfo* spki); 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)net::CertType GetCertType(CERTCertificate *cert); 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace mozilla_security_manager 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif // CHROME_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSNSSCERTHELPER_H_ 82