Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 #ifndef _NSSASN_H_
5 #define _NSSASN_H_
7 #include "nscore.h"
8 #include "nsIX509Cert.h"
9 #include "nsCOMPtr.h"
10 #include "nsString.h"
11 #include "nsIASN1Sequence.h"
12 #include "nsIASN1PrintableItem.h"
13 #include "nsIMutableArray.h"
15 //
16 // Read comments in nsIX509Cert.idl for a description of the desired
17 // purpose for this ASN1 interface implementation.
18 //
20 class nsNSSASN1Sequence : public nsIASN1Sequence
21 {
22 public:
23 NS_DECL_ISUPPORTS
24 NS_DECL_NSIASN1SEQUENCE
25 NS_DECL_NSIASN1OBJECT
27 nsNSSASN1Sequence();
28 virtual ~nsNSSASN1Sequence();
29 /* additional members */
30 private:
31 nsCOMPtr<nsIMutableArray> mASN1Objects;
32 nsString mDisplayName;
33 nsString mDisplayValue;
34 uint32_t mType;
35 uint32_t mTag;
36 bool mIsValidContainer;
37 bool mIsExpanded;
38 };
40 class nsNSSASN1PrintableItem : public nsIASN1PrintableItem
41 {
42 public:
43 NS_DECL_ISUPPORTS
44 NS_DECL_NSIASN1PRINTABLEITEM
45 NS_DECL_NSIASN1OBJECT
47 nsNSSASN1PrintableItem();
48 virtual ~nsNSSASN1PrintableItem();
49 /* additional members */
50 private:
51 nsString mDisplayName;
52 nsString mValue;
53 uint32_t mType;
54 uint32_t mTag;
55 unsigned char *mData;
56 uint32_t mLen;
57 };
59 nsresult CreateFromDER(unsigned char *data,
60 unsigned int len,
61 nsIASN1Object **retval);
62 #endif //_NSSASN_H_