]> git.saurik.com Git - apple/security.git/blob - CertTool/cdsaUtils/oidParser.h
Security-54.tar.gz
[apple/security.git] / CertTool / cdsaUtils / oidParser.h
1 /*
2 * oidParser.cpp - parse an Intel-style OID, with the assistance of dumpasn1.cfg.
3 * The config file islooked dfor int e following locations:
4 *
5 * current working directory (.)
6 * parent directory (..)
7 * The directory specified by the environment variable LOCAL_BUILD_DIR
8 *
9 * OidParser will still work if the config file is not found, but OIDs will be
10 * dispayed in raw hex format.
11 */
12
13 #ifndef _OID_PARSER_H_
14 #define _OID_PARSER_H_
15
16 #include <Security/cssmtype.h>
17
18 /*
19 * Generated strings go into a client-allocated char array of
20 * this size.
21 */
22 #define OID_PARSER_STRING_SIZE 120
23
24 class OidParser
25 {
26 private:
27 CSSM_DATA_PTR configData; // contents of dumpasn1.cfg
28 public:
29 /* costruct with noConfig true - skip reading config file */
30 OidParser(bool noConfig=false);
31 ~OidParser();
32
33 /*
34 * Parse an Intel-style OID, generating a C string in
35 * caller-supplied buffer.
36 */
37 void oidParse(
38 const unsigned char *oidp,
39 unsigned oidLen,
40 char *strBuf);
41
42 };
43
44 #endif /* _OID_PARSER_H_ */