DTASN1Parser Class Reference
Inherits from | NSObject |
Declared in | DTASN1Parser.h |
Overview
Instances of this class parse ASN1 documents in an event-driven manner. A DTASN1Parser notifies its delegate about the items (elements, collections, and so on) that it encounters as it processes an ASN1 document. It does not itself do anything with those parsed items except report them. It also reports parsing errors. For convenience, a DTASN1Parser object in the following descriptions is sometimes referred to as a parser object.
Tasks
Initializing a Parser Object
Parsing
-
– parse
-
– abortParsing
-
delegate
property -
parserError
property
Properties
delegate
An object that is the parsing delegate. It is not retained. The delegate must conform to the DTASN1ParserDelegate Protocol protocol.
@property (nonatomic, DT_WEAK_PROPERTY) id<DTASN1ParserDelegate> delegate
Declared In
DTASN1Parser.h
parserError
Returns an NSError
object from which you can obtain information about a parsing error.
@property (nonatomic, readonly, strong) NSError *parserError
Discussion
You may invoke this method after a parsing operation abnormally terminates to determine the cause of error.
Declared In
DTASN1Parser.h
Instance Methods
initWithData:
Initializes the receiver with the ASN1 contents encapsulated in a given data object.
- (id)initWithData:(NSData *)data
Parameters
- data
An
NSData
object containing ASN1 encoded data.
Return Value
An initialized DTASN1Parser
object or nil if an error occurs.
Declared In
DTASN1Parser.h
parse
Starts the event-driven parsing operation.
- (BOOL)parse
Return Value
YES
if parsing is successful and NO
in there is an error or if the parsing operation is aborted.
Discussion
If you invoke this method, the delegate, if it implements parser:parseErrorOccurred:, is informed of the cancelled parsing operation.
Declared In
DTASN1Parser.h