nsNSSASN1Object.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_
  6. #include "nscore.h"
  7. #include "nsIX509Cert.h"
  8. #include "nsCOMPtr.h"
  9. #include "nsString.h"
  10. #include "nsIASN1Sequence.h"
  11. #include "nsIASN1PrintableItem.h"
  12. #include "nsIMutableArray.h"
  13. //
  14. // Read comments in nsIX509Cert.idl for a description of the desired
  15. // purpose for this ASN1 interface implementation.
  16. //
  17. class nsNSSASN1Sequence : public nsIASN1Sequence
  18. {
  19. public:
  20. NS_DECL_ISUPPORTS
  21. NS_DECL_NSIASN1SEQUENCE
  22. NS_DECL_NSIASN1OBJECT
  23. nsNSSASN1Sequence();
  24. protected:
  25. virtual ~nsNSSASN1Sequence();
  26. /* additional members */
  27. private:
  28. nsCOMPtr<nsIMutableArray> mASN1Objects;
  29. nsString mDisplayName;
  30. nsString mDisplayValue;
  31. uint32_t mType;
  32. uint32_t mTag;
  33. bool mIsValidContainer;
  34. bool mIsExpanded;
  35. };
  36. class nsNSSASN1PrintableItem : public nsIASN1PrintableItem
  37. {
  38. public:
  39. NS_DECL_ISUPPORTS
  40. NS_DECL_NSIASN1PRINTABLEITEM
  41. NS_DECL_NSIASN1OBJECT
  42. nsNSSASN1PrintableItem();
  43. protected:
  44. virtual ~nsNSSASN1PrintableItem();
  45. /* additional members */
  46. private:
  47. nsString mDisplayName;
  48. nsString mValue;
  49. uint32_t mType;
  50. uint32_t mTag;
  51. unsigned char *mData;
  52. uint32_t mLen;
  53. };
  54. nsresult CreateFromDER(unsigned char *data,
  55. unsigned int len,
  56. nsIASN1Object **retval);
  57. #endif //_NSSASN_H_