eid-viewer
eid-viewer library
oslayer-objc.h
Go to the documentation of this file.
1 #include <BeidView/oslayer.h>
2 
11 @import Foundation;
12 @import AppKit;
13 
14 typedef NS_ENUM(NSInteger, eIDSource) {
15  eIDSourceNone = EID_VWR_SRC_NONE,
16  eIDSourceFile = EID_VWR_SRC_FILE,
17  eIDSourceCard = EID_VWR_SRC_CARD,
18  eIDSourceUnknown = EID_VWR_SRC_UNKNOWN,
19 };
20 
21 typedef NS_ENUM(NSInteger, eIDLogLevel) {
22  eIDLogLevelDetail = EID_VWR_LOG_DETAIL,
23  eIDLogLevelNormal = EID_VWR_LOG_NORMAL,
24  eIDLogLevelCoarse = EID_VWR_LOG_COARSE,
25  eIDLogLevelError = EID_VWR_LOG_ERROR,
26 };
27 
28 typedef NS_ENUM(NSInteger, eIDPinOp) {
29  eIDPinOpTest = EID_VWR_PINOP_TEST,
30  eIDPinOpChange = EID_VWR_PINOP_CHG,
31 };
32 
33 typedef NS_ENUM(NSInteger, eIDState) {
34  eIDStateLibOpen = STATE_LIBOPEN,
35  eIDStateCallbacks = STATE_CALLBACKS,
36  eIDStateReady = STATE_READY,
37  eIDStateToken = STATE_TOKEN,
38  eIDStateTokenWait = STATE_TOKEN_WAIT,
39  eIDStateTokenID = STATE_TOKEN_ID,
40  eIDStateTokenCerts = STATE_TOKEN_CERTS,
41  eIDStateTokenPinop = STATE_TOKEN_PINOP,
42  eIDStateTokenSerialize = STATE_TOKEN_SERIALIZE,
43  eIDStateTokenError = STATE_TOKEN_ERROR,
44  eIDStateFile = STATE_FILE,
45  eIDStateFileReading = STATE_FILE_READING,
46  eIDStateFileWait = STATE_FILE_WAIT,
47  eIDStateCardInvalid = STATE_CARD_INVALID,
48  eIDStateNoToken = STATE_NO_TOKEN,
49  eIDStateNoReader = STATE_NO_READER,
50 };
51 
52 typedef NS_ENUM(NSInteger, eIDLanguage) {
53  eIDLanguageNone = EID_VWR_LANG_NONE,
54  eIDLanguageDe = EID_VWR_LANG_DE,
55  eIDLanguageEn = EID_VWR_LANG_EN,
56  eIDLanguageFr = EID_VWR_LANG_FR,
57  eIDLanguageNl = EID_VWR_LANG_NL,
58 };
59 
60 typedef NS_ENUM(NSInteger, eIDResult) {
61  eIDResultFailed = EID_VWR_RES_FAILED,
62  eIDResultSuccess = EID_VWR_RES_SUCCESS,
63  eIDResultUnknown = EID_VWR_RES_UNKNOWN,
64 };
65 
69 @protocol eIDOSLayerUI<NSObject>
70 @optional
71 -(void)newsrc:(eIDSource)which;
72 -(void)newstringdata:(NSString*)data withLabel:(NSString*)label;
73 -(void)newbindata:(NSData*)data withLabel:(NSString*)label;
74 -(void)log:(NSString*)line withLevel:(eIDLogLevel)level;
75 -(void)newstate:(eIDState)state;
76 -(void)pinop_result:(eIDResult)result forOperation:(eIDPinOp)operation;
77 -(void)readersFound:(NSArray*)readers withSlotNumbers:(NSArray*)slots;
78 @end
79 
82 @interface eIDOSLayerBackend : NSObject
83 +(void)pinop:(eIDPinOp)which;
84 +(NSInteger)setUi:(id<eIDOSLayerUI>)ui;
85 +(NSImage*)getPreview:(NSURL*)from;
86 +(void)setLang:(eIDLanguage)language;
87 +(eIDLanguage)lang;
88 +(void)poll;
89 +(void)mainloop;
90 +(void)mainloopThread;
91 +(void)deserialize:(NSURL*)from;
92 +(void)serialize:(NSURL*)to;
93 +(NSData*)xmlform;
94 +(void)closeFile;
95 +(void)setInvalid;
96 +(eIDResult)validateCert:(NSData*)certificate withCa:(NSData*)ca;
97 +(eIDResult)validateRrnCert:(NSData*)certificate;
98 +(void)selectReader:(NSInteger)readerNumber;
99 +(void)setReaderAuto:(BOOL)automatic;
100 +(NSString*)getCertDetail:(NSData*)certificate;
101 @end
102 
Reading certificates.
Definition: oslayer.h:70
The card has been read, we&#39;re now waiting for events to do something else.
Definition: oslayer.h:68
void closeFile()
calls eid_vwr_close_file()
Definition: oslayer-objc.m:139
Performing a PIN operation.
Definition: oslayer.h:71
Definition: oslayer.h:41
the operation did not finish
Definition: oslayer.h:56
We don&#39;t have a reader (yet?)
Definition: oslayer.h:79
Definition: oslayer-objc.h:82
eIDLanguage lang()
calls eid_vwr_convert_get_lang()
Definition: oslayer-objc.m:162
NSData * xmlform()
calls eid_vwr_be_get_xmlform(), and converts the result to an NSData*
Definition: oslayer-objc.m:145
Saving data to a file.
Definition: oslayer.h:72
void poll()
calls eid_vwr_poll()
Definition: oslayer-objc.m:121
The callbacks have been defined.
Definition: oslayer.h:65
French.
Definition: oslayer.h:89
Card source. Close should not be allowed, everything else should be.
Definition: oslayer.h:31
perform a login and return whether the login was successful
Definition: oslayer.h:48
The data was determined to be invalid. That is, the card could be read, but signature validation fail...
Definition: oslayer.h:77
void mainloop()
calls eid_vwr_be_mainloop(), which does not return
Definition: oslayer-objc.m:118
Definition: oslayer.h:42
Unknown. Used as initializer.
Definition: oslayer.h:32
Definition: oslayer.h:43
Reading identity data.
Definition: oslayer.h:69
Dutch.
Definition: oslayer.h:90
change the PIN code of the card
Definition: oslayer.h:49
Ready to receive a token (eID card)
Definition: oslayer.h:66
An error occurred while dealing with the card.
Definition: oslayer.h:73
The library has been opened. Used as an initializer.
Definition: oslayer.h:64
Definition: oslayer.h:40
English.
Definition: oslayer.h:88
We finished parsing the file.
Definition: oslayer.h:76
void setInvalid()
calls eid_vwr_be_set_invalid()
Definition: oslayer-objc.m:142
No language has yet been selected. Used as initializer.
Definition: oslayer.h:86
Protocol for implementing a UI.
Definition: oslayer-objc.h:69
No source. UI should be cleared.
Definition: oslayer.h:29
File source. "Print", "Validate" and "Close" operations should be allowed, PIN-related operations are...
Definition: oslayer.h:30
A token (eID card) has been found.
Definition: oslayer.h:67
We&#39;re reading from the file currently.
Definition: oslayer.h:75
the operation returned successfully
Definition: oslayer.h:55
void mainloopThread()
calls mainloop in a background thread.
Definition: oslayer-objc.m:124
German.
Definition: oslayer.h:87
We don&#39;t have a card, and we also don&#39;t have a file.
Definition: oslayer.h:78
operation failed
Definition: oslayer.h:54
We&#39;re dealing with files.
Definition: oslayer.h:74