Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsNSSASN1Object.h File Reference
#include "nscore.h"
#include "nsIX509Cert.h"
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsIASN1Sequence.h"
#include "nsIASN1PrintableItem.h"
#include "nsIArray.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  nsNSSASN1Sequence
class  nsNSSASN1PrintableItem


nsresult CreateFromDER (unsigned char *data, unsigned int len, nsIASN1Object **retval)

Function Documentation

nsresult CreateFromDER ( unsigned char *  data,
unsigned int  len,
nsIASN1Object **  retval 

Definition at line 218 of file nsNSSASN1Object.cpp.

  nsCOMPtr<nsIASN1Sequence> sequence = new nsNSSASN1Sequence;
  *retval = nsnull;
  nsresult rv =  buildASN1ObjectFromDER(data, data+len, sequence);

  if (NS_SUCCEEDED(rv)) {
    // The actual object will be the first element inserted
    // into the sequence of the sequence variable we created.
    nsCOMPtr<nsIMutableArray> elements;

    nsCOMPtr<nsIASN1Object> asn1Obj = do_QueryElementAt(elements, 0);
    *retval = asn1Obj;
    if (*retval == nsnull)
      return NS_ERROR_FAILURE;

  return rv; 

Here is the call graph for this function: