security/manager/ssl/src/nsNSSASN1Object.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/manager/ssl/src/nsNSSASN1Object.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +#ifndef _NSSASN_H_
     1.8 +#define _NSSASN_H_
     1.9 +
    1.10 +#include "nscore.h"
    1.11 +#include "nsIX509Cert.h"
    1.12 +#include "nsCOMPtr.h"
    1.13 +#include "nsString.h"
    1.14 +#include "nsIASN1Sequence.h"
    1.15 +#include "nsIASN1PrintableItem.h"
    1.16 +#include "nsIMutableArray.h"
    1.17 +
    1.18 +//
    1.19 +// Read comments in nsIX509Cert.idl for a description of the desired
    1.20 +// purpose for this ASN1 interface implementation.
    1.21 +//
    1.22 +
    1.23 +class nsNSSASN1Sequence : public nsIASN1Sequence
    1.24 +{
    1.25 +public:
    1.26 +  NS_DECL_ISUPPORTS
    1.27 +  NS_DECL_NSIASN1SEQUENCE
    1.28 +  NS_DECL_NSIASN1OBJECT
    1.29 +
    1.30 +  nsNSSASN1Sequence();
    1.31 +  virtual ~nsNSSASN1Sequence();
    1.32 +  /* additional members */
    1.33 +private:
    1.34 +  nsCOMPtr<nsIMutableArray> mASN1Objects;
    1.35 +  nsString mDisplayName;
    1.36 +  nsString mDisplayValue;
    1.37 +  uint32_t mType;
    1.38 +  uint32_t mTag;
    1.39 +  bool     mIsValidContainer;
    1.40 +  bool     mIsExpanded;
    1.41 +};
    1.42 +
    1.43 +class nsNSSASN1PrintableItem : public nsIASN1PrintableItem
    1.44 +{
    1.45 +public:
    1.46 +  NS_DECL_ISUPPORTS
    1.47 +  NS_DECL_NSIASN1PRINTABLEITEM
    1.48 +  NS_DECL_NSIASN1OBJECT
    1.49 +
    1.50 +  nsNSSASN1PrintableItem();
    1.51 +  virtual ~nsNSSASN1PrintableItem();
    1.52 +  /* additional members */
    1.53 +private:
    1.54 +  nsString mDisplayName;
    1.55 +  nsString mValue;
    1.56 +  uint32_t mType;
    1.57 +  uint32_t mTag;
    1.58 +  unsigned char *mData;
    1.59 +  uint32_t       mLen;
    1.60 +};
    1.61 +
    1.62 +nsresult CreateFromDER(unsigned char *data,
    1.63 +                       unsigned int   len,
    1.64 +                       nsIASN1Object **retval);
    1.65 +#endif //_NSSASN_H_

mercurial