security/manager/ssl/src/nsKeygenHandler.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/manager/ssl/src/nsKeygenHandler.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef _NSKEYGENHANDLER_H_
    1.11 +#define _NSKEYGENHANDLER_H_
    1.12 +// Form Processor 
    1.13 +#include "nsIFormProcessor.h" 
    1.14 +#include "nsTArray.h" 
    1.15 +
    1.16 +nsresult GetSlotWithMechanism(uint32_t mechanism,
    1.17 +                              nsIInterfaceRequestor *ctx,
    1.18 +                              PK11SlotInfo **retSlot);
    1.19 +
    1.20 +#define DEFAULT_RSA_KEYGEN_PE 65537L
    1.21 +#define DEFAULT_RSA_KEYGEN_ALG SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION
    1.22 +
    1.23 +SECKEYECParams *decode_ec_params(const char *curve);
    1.24 +
    1.25 +class nsKeygenFormProcessor : public nsIFormProcessor { 
    1.26 +public: 
    1.27 +  nsKeygenFormProcessor(); 
    1.28 +  virtual ~nsKeygenFormProcessor();
    1.29 +  nsresult Init();
    1.30 +
    1.31 +  NS_IMETHOD ProcessValue(nsIDOMHTMLElement *aElement, 
    1.32 +                          const nsAString& aName, 
    1.33 +                          nsAString& aValue); 
    1.34 +
    1.35 +  NS_IMETHOD ProvideContent(const nsAString& aFormType, 
    1.36 +                            nsTArray<nsString>& aContent, 
    1.37 +                            nsAString& aAttribute); 
    1.38 +  NS_DECL_THREADSAFE_ISUPPORTS
    1.39 +
    1.40 +  static nsresult Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult);
    1.41 +
    1.42 +protected:
    1.43 +  nsresult GetPublicKey(nsAString& aValue, nsAString& aChallenge, 
    1.44 +			nsAFlatString& akeyType, nsAString& aOutPublicKey,
    1.45 +			nsAString& aPqg);
    1.46 +  nsresult GetSlot(uint32_t aMechanism, PK11SlotInfo** aSlot);
    1.47 +private:
    1.48 +  nsCOMPtr<nsIInterfaceRequestor> m_ctx;
    1.49 +
    1.50 +  typedef struct SECKeySizeChoiceInfoStr {
    1.51 +      nsString name;
    1.52 +      int size;
    1.53 +  } SECKeySizeChoiceInfo;
    1.54 +
    1.55 +  enum { number_of_key_size_choices = 2 };
    1.56 +
    1.57 +  SECKeySizeChoiceInfo mSECKeySizeChoiceList[number_of_key_size_choices];
    1.58 +};
    1.59 +
    1.60 +#endif //_NSKEYGENHANDLER_H_

mercurial