ExtendLib/xLib/asn1_node.cpp File Reference

#include "asn1_node.h"
Include dependency graph for asn1_node.cpp:

Go to the source code of this file.

Functions

void asn1_node_type (int node, int *cnst, int *type, int *name)
void asn1_print_node (FILE *fp, int node)
void asn1_print_node_value (FILE *fp, int node, Buffer buf)

Variables

const char * _ASN1_NODE_CONST []
const char * _ASN1_NODE_TYPE []
const char * _ASN1_NODE_NAME []

Function Documentation

void asn1_node_type ( int  node,
int *  cnst,
int *  type,
int *  name 
)

Definition at line 65 of file asn1_node.cpp.

References JBXL_ASN1_CNSTRCTD.

Referenced by asn1_print_node().

00066 {
00067     if (cnst!=NULL) {
00068         if (node & JBXL_ASN1_CNSTRCTD) *cnst = 1;
00069         else *cnst = 0;
00070     }
00071     if (type!=NULL) *type = (node & 0xc0) >> 6;
00072     if (name!=NULL) *name = node & 0x1f;
00073 
00074     return;
00075 }

Here is the caller graph for this function:

void asn1_print_node ( FILE *  fp,
int  node 
)

Definition at line 78 of file asn1_node.cpp.

References _ASN1_NODE_CONST, _ASN1_NODE_NAME, _ASN1_NODE_TYPE, and asn1_node_type().

Referenced by print_tDER().

00079 {
00080     int cnst, type, name;
00081 
00082     asn1_node_type(node, &cnst, &type, &name);
00083 
00084     if (cnst==1) fprintf(fp, "%s ", _ASN1_NODE_CONST[cnst]);
00085     fprintf(fp, "%s ", _ASN1_NODE_TYPE[type]);
00086     if (type==0x00) fprintf(fp, "%s ", _ASN1_NODE_NAME[name]);
00087     else fprintf(fp, "%d ", name);
00088     fprintf(fp, "(%02x) ", node);
00089 
00090     return;
00091 }

Here is the call graph for this function:

Here is the caller graph for this function:

void asn1_print_node_value ( FILE *  fp,
int  node,
Buffer  buf 
)

Definition at line 95 of file asn1_node.cpp.

References bin2int_DER(), Buffer::buf, JBXL_ASN1_INT, and JBXL_ASN1_OCT.

Referenced by print_tDER().

00096 {
00097     fprintf(fp, ": ");
00098 
00099     if (node==JBXL_ASN1_INT) {
00100         long int n = bin2int_DER(buf);
00101         fprintf(fp, "INT = %ld ", n);
00102     }
00103     else if (node==JBXL_ASN1_OCT) {
00104         if (buf.buf!=NULL) fprintf(fp, "\"%s\" ", buf.buf);
00105         else               fprintf(fp, "\"\" ");
00106     }
00107     else if (buf.buf!=NULL) {               // その他
00108         fprintf(fp, "....... ");
00109     }
00110 
00111     return;
00112 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char* _ASN1_NODE_CONST[]
Initial value:
 
{
    "PRIMITIVE",            
    "CONSTRUCTED"           
}

Definition at line 11 of file asn1_node.cpp.

Referenced by asn1_print_node().

const char* _ASN1_NODE_NAME[]

Definition at line 27 of file asn1_node.cpp.

Referenced by asn1_print_node().

const char* _ASN1_NODE_TYPE[]
Initial value:
 
{
    "UNIVERSAL",            
    "APPLICATION",          
    "CONTEXT-DEFINED",      
    "PRIVATE"               
}

Definition at line 18 of file asn1_node.cpp.

Referenced by asn1_print_node().


Generated on 15 Nov 2023 for JunkBox_Lib++ (for Windows) by  doxygen 1.6.1