CN103546785A - Electronic equipment CA function realizing system and method based on USB (universal serial bus) - Google Patents
Electronic equipment CA function realizing system and method based on USB (universal serial bus) Download PDFInfo
- Publication number
- CN103546785A CN103546785A CN201310414366.9A CN201310414366A CN103546785A CN 103546785 A CN103546785 A CN 103546785A CN 201310414366 A CN201310414366 A CN 201310414366A CN 103546785 A CN103546785 A CN 103546785A
- Authority
- CN
- China
- Prior art keywords
- smart card
- module
- card
- usb
- reader
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The invention discloses an electronic equipment CA function realizing system and method based on USB (universal serial bus). The system comprises electronic equipment and a USB smart card reader connected to the electronic equipment through a USB interface. The electronic equipment comprises a smart card drive module, a CA module and an application module. The USB smart card reader comprises a USB controller, a card reader drive module and a smart card controller. The smart card drive module is used for generating an operation message in data interaction with a smart card, transmitting the operation message to the card reader drive module, and receiving the operation response message returned by the card reader drive module. The card reader drive module is used for reading the operation message transmitted by the smart card drive module and verifying and analyzing the same, when the verification is passed and the analyzing is successful, corresponding data interaction operation to the smart card is executed through the smart card controller, the response returned by the smart card can be obtained, and the operation response message can be generated according to the returned response, and the operation response message is transmitted to the smart card drive module.
Description
Technical field
The present invention relates to electronic equipment encryption technology field, relate in particular to a kind of electronic equipment CA function based on USB and realize system and method.
Background technology
At present, the encryption system of Digital Television is generally used CA(Conditional Access, Conditional Access) system, CA system needs receiving equipment to have an intelligent card reader, utilize intelligent card reader to read CA smart card, but the television set great majority of existing storage are there is no this device, even the TV newly going out, also have above-mentioned intelligent card reader is not much provided, this make these TVs cannot by upgrade software only by smart card fetch equipment integrated setting on television equipment, and TV cannot not realized CA function when there is no intelligent card reader.
Therefore, prior art has yet to be improved and developed.
Summary of the invention
In view of above-mentioned the deficiencies in the prior art, the object of the present invention is to provide a kind of electronic equipment CA function based on USB to realize system and method, be intended to solve the electronic equipments such as existing Digital Television and cannot do not realize the problem of CA function when there is no intelligent card reader.
Technical scheme of the present invention is as follows:
The electronic equipment CA function of USB realizes a system, wherein, comprises electronic equipment and is connected to the USB smart card reader on electronic equipment by USB interface; Described electronic equipment comprises smart card driver module, CA module, application module; Described USB smart card reader comprises: USB controller, card-reader driver program module, smart card controller;
Smart card driver module, for generating the operation information that carries out data interaction with smart card, is sent to card-reader driver program module by operation information, and receives the operation response message that card-reader driver program module is returned;
CA module, for realizing CA function according to operation response message;
Application module, for carrying out the application of supporting that CA encrypts according to user's instruction;
Card-reader driver program module, the operation information sending for reading smart card driver module, and carry out verification and parsing, when verification is passed through and successfully resolved, by smart card controller, smart card is carried out to corresponding data exchange operation, and getting the response that smart card returns, the response generating run response message according to returning, is sent to smart card driver module;
USB controller, for transmitting operation information and operation response message between smart card driver module and card-reader driver program module by usb protocol;
Smart card controller, for carrying out corresponding data exchange operation to smart card;
Described smart card driver module, application module are connected in CA module, and described USB controller, smart card controller are connected in card-reader driver program module, and described smart card driver module is also connected in described USB controller.
The described electronic equipment CA function based on USB realizes system, wherein, is provided with one for inserting the smart card draw-in groove of smart card on described USB smart card reader.
The described electronic equipment CA function based on USB realizes system, and wherein, described smart card drive module setting has at least 3 USB end points, is respectively used to reading and writing and the state notifying of data.
The described electronic equipment CA function based on USB realizes system, wherein, is also provided with descrambler module and descrambling demultiplexing module in described electronic equipment, and described descrambler module and descrambling demultiplexing module are all connected in CA module.
An electronic equipment CA function realizing method of USB, wherein, comprises step:
A, when needs carry out data interaction with smart card, smart card driver module generates the operation information that carries out data interaction with smart card, and operation information is sent to card-reader driver program module;
B, card-reader driver program module read the operation information that smart card driver module sends, and carry out verification and parsing;
C, upcheck and successfully resolved after, card-reader driver program module is carried out corresponding data exchange operation by smart card controller to smart card, and gets the response that smart card returns;
The response generating run response message that D, card-reader driver program module basis are returned, and operation response message is sent to smart card driver module;
E, smart card driver module are tested and resolve operation response message, obtain the response that smart card returns, and the response that smart card is returned is sent to CA module and realizes CA function.
The described electronic equipment CA function realizing method based on USB, wherein, also comprises before described steps A:
A0, smart card driver module is carried out to process initialization processing: detect USB smart card reader and whether insert electronic equipment, when inserting, open USB smart card reader, and inquire about the plug state of smart card.
The described electronic equipment CA function realizing method based on USB, wherein, the querying method of the plug state of described smart card comprises step:
A01, smart card driver module are sent to card-reader driver program module by intelligent card state query messages;
A02, card-reader driver program module are carried out verification and parsing to intelligent card state query messages;
A03, verification by and successfully resolved after, by smart card controller, inquire about smart card and whether be inserted into the plug state that obtains smart card in USB smart card reader;
A04, card-reader driver program module generate intelligent card state query response message according to the plug state of the smart card inquiring, and are sent to smart card driver module;
A05, smart card driver module read intelligent card state query response message, carry out verification and resolve, and obtain the plug state of smart card.
The described electronic equipment CA function realizing method based on USB, wherein, also comprises after described steps A 0:
A1, when the plug state that inquires smart card is insertion state, smart card driver module is insertion state by the plug status indication of smart card, and opens the monitoring to smart card plug state.
The described electronic equipment CA function realizing method based on USB, wherein, the described step to the monitoring of smart card plug state specifically comprises:
When A11, smart card are extracted or inserted, smart card controller obtains the plug state of smart card by hardware interrupts;
A12, smart card controller by the plug state notifying of the smart card getting to card-reader driver program module;
A13, card-reader driver program module generate intelligent card state according to the plug state of the smart card receiving and change message, and intelligent card state is changed to message are sent to smart card driver module;
A14, smart card driver module change message to the intelligent card state getting and carry out verification and parsing, obtain the plug state of smart card, and notice are to CA module.
The described electronic equipment CA function realizing method based on USB, wherein, described data interaction comprises: reset smart card, according to smart card protocol swap data, toward writing initial data in smart card, read initial data from smart card.
Beneficial effect: the present invention is by being arranged at the smart card driver module in electronic equipment and being arranged at the card-reader driver program module of USB smart card reader, carry out exchanges data with smart card, realize reset smart card, by smart card protocol swap data, toward writing initial data in smart card, read the operations such as initial data from smart card, by the present invention, can on the electronic equipment without smart card reader equipment, realize CA function.
Accompanying drawing explanation
Fig. 1 is the structured flowchart that a kind of electronic equipment CA function based on USB of the present invention realizes system preferred embodiment.
Fig. 2 is the flow chart of a kind of electronic equipment CA function realizing method preferred embodiment based on USB of the present invention.
Embodiment
The invention provides a kind of electronic equipment CA function based on USB and realize system and method, for making object of the present invention, technical scheme and effect clearer, clear and definite, below the present invention is described in more detail.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Refer to Fig. 1, Fig. 1 is the structured flowchart that a kind of electronic equipment CA function based on USB of the present invention realizes system preferred embodiment, as shown in the figure, it comprises electronic equipment (the present embodiment take electronic equipment describe as TV 100) and USB smart card reader 200;
Wherein, described TV 100 comprises that smart card driver module 103, CA module 102, application module (the present embodiment be take application module as DVB(digital video broadcasting) playing module 101 are example), descrambler module 105, Demux(descrambling demultiplexing) module 104; Described USB smart card reader 200 comprises: USB controller 201, card-reader driver program module 204, smart card controller 202, smart card draw-in groove 203;
Smart card driver module 103, for generating the operation information that carries out data interaction with smart card 301, is sent to card-reader driver program module 204 by operation information, and receives the operation response message that card-reader driver program module 204 is returned;
Application module, for carrying out the application of supporting that CA encrypts according to user's instruction; When described application module is DVB playing module 101, this DVB playing module 101 is for playing the program of supporting that CA encrypts.
Card-reader driver program module 204, the operation information sending for reading smart card driver module 103, and carry out verification and parsing, when verification is passed through and successfully resolved, by 202 pairs of smart cards of smart card controller 301, carry out corresponding data exchange operation, and getting the response that smart card 301 returns, the response generating run response message according to returning, is sent to smart card driver module 103;
Smart card draw-in groove 203, for inserting smart card 301;
Described smart card driver module 103, DVB playing module 101, descrambler module 105, Demux module 104 are connected in CA module 102, described USB controller 201, smart card controller 202 are connected in card-reader driver program module 204, described smart card driver module 103 is also connected in described USB controller 201, and described smart card draw-in groove 203 is connected in described smart card controller 202.
Even the present invention is the USB interface of utilizing existing TV, realizes the communication of TV and smart card, so in the situation that there is no intelligent card reading device, also can realize CA function, as for the process realizing, describes in detail below.
Based on said system, the invention provides a kind of electronic equipment CA function realizing method based on USB, as shown in Figure 2, it comprises step:
S101, when needs carry out data interaction with smart card, smart card driver module generates the operation information that carries out data interaction with smart card, and operation information is sent to card-reader driver program module;
S102, card-reader driver program module read the operation information that smart card driver module sends, and carry out verification and parsing;
S103, upcheck and successfully resolved after, card-reader driver program module is carried out corresponding data exchange operation by smart card controller to smart card, and gets the response that smart card returns;
The response generating run response message that S104, card-reader driver program module basis are returned, and operation response message is sent to smart card driver module;
S105, smart card driver module are tested and resolve operation response message, obtain the response that smart card returns, and the response that smart card is returned is sent to CA module and realizes CA function.
Below in conjunction with Fig. 1, TV CA function implementation procedure is described.
When the use a teleswitch DVB playing module 101 that starts TV of user is play while supporting program that CA encrypt, before playing first, to smart card driver module 103 process initialization, this initialization step comprises: check whether USB smart card reader 200 is inserted in TV 100; For judging whether USB device is inserted in electronic equipment, belong to prior art, repeat no more.
Detect USB smart card reader 200 be inserted into TV 100 in time, open USB smart card reader 200, smart card driver module 103 described in the present invention is used for carrying out the mutual of data, at least 3 USB end points (endpoint) in smart card driver module 103, have been created, be used for respectively the reading of data, write and state notifying, be that these three end points are called and read end points, write end points, state notifying end points, it is all arranged on TV end, correspondingly, at USB smart card reader end, corresponding USB is set and writes end points, USB reads end points, USB state notifying end points, the transfer of data of USB smart card reader end and TV end is carried out according to usb protocol herein, by existing USB device reading and writing data mode (software and hardware combining), carry out transfer of data.
After opening USB smart card reader 200, inquiry smart card inserts state, inquires about smart card 301 and whether is inserted into USB smart card reader 200(and is inserted into smart card draw-in groove 203) in, the querying method that the present embodiment provides comprises step:
S301, smart card driver module 103 are write end points by intelligent card state query messages (Smartcard status query message) by it and are write, wherein, smart card query messages is as shown in Table 1: wherein, Syntax is grammer, Number of bits is byte long, Identifier is identifier, and Note is remarks, lower same.
Table one
Syntax | Number of bits | Identifier | Note |
Smc_status_query_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x1 |
length | 16 | uimsbf | In order, the length of remaining data, is fixed as 2 |
Reserved | 8 | uimsbf | Reserved field, is fixed as 0 |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
In upper table, " Smc_status_query_msg () " represents intelligent card state query messages, " magci_number " represents debug symbol, " cmd " represents CMD, " length " representative data length, " Reserved " represents reserved field, " check sum " represent verification and; " bslbf " represents Bit String, and the bit of left position is front, and " uimsbf " represents signless integer, and high-order bit is front, and " rpchof " represents Remainder polynomial coefficients, and high-order bit is front.In remarks, magci_number is fixed value, represents for example password of intelligent card state query messages of operation information; When cmd is 0x1, represent intelligent card state query messages, cmd is 0x2 interval scale intelligent card state query response message, specifically referring to following each table; Length is the length of remaining data, is fixed as 2, and when writing initial data or reading initial data, its length is not fixed value; Reserved field Reserved length is fixed as 0.
S302, intelligent card state query messages, through USB controller 201, arrive card-reader driver program module 204 according to usb protocol;
S303,204 pairs of intelligent card state query messages of card-reader driver program module carry out verification and parsing, when verification by and successfully resolved, by smart card controller 202 inquiry smart cards 301, whether be inserted in smart card draw-in groove 203;
S304, card-reader driver program module 204 inserts state according to the smart card inquiring, and generates intelligent card state query response message, this intelligent card state query response message as shown in Table 2:
Table two
Syntax | Number of bits | Identifier | Note |
Smc_status_query_rep_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x2 |
length | 16 | uimsbf | In order, the length of remaining data, is fixed as 2 |
card_status | 8 | uimsbf | If card is that insertion state is 1, otherwise is 0 |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Different from table one, cmd is wherein fixed as 0x2, represents intelligent card state query response message; Card_status represents plug state, and 1 represents that smart card is insertion state, and 0 represents that smart card is for extracting state.
S305, card-reader driver program module 204 are written to intelligent card state query response message described to read end points (in the situation of not refering in particular in the present invention, read end points, write end points and state notifying end points and be and be arranged on TV end, correspondingly, for USB smart card reader for USB writes end points, USB reads end points and USB state notifying end points).
S306, smart card driver module 103 read intelligent card state query response message from the above-mentioned end points of reading, and carry out verification and parsing, obtain intelligent card state information.
Smart card driver module 103 can be labeled as the intelligent card state inquiring by smart card current state.
Meanwhile, smart card driver module 103 is opened the monitoring of smart card plug message, the invention provides a kind of monitoring smart card plug message approach, and it comprises step:
S401, smart card driver module 103 start a new thread, and the mode reading state notice end points to stop up;
S402, when smart card 301 is inserted into while extracting in smart card draw-in groove 203 or from smart card draw-in groove 203, smart card controller 202 gets the plug state of smart card by hardware interrupts;
S403, smart card controller 202 plug state notifying to card-reader driver program module 204 by the smart card getting;
S404, card-reader driver program module 204, according to the smart card plug state receiving, generate intelligent card state and change message, and this intelligent card state changes message as shown in Table 3:
Table three
Syntax | Number of bits | Identifier | Note |
Smc_status_changed_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x3 |
length | 16 | uimsbf | In order, the length of remaining data, is fixed as 2 |
card_status | 8 | uimsbf | If card is that insertion state is 1, otherwise is 0 |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Different from table two, cmd is fixed as 0x3, represents that intelligent card state changes message.
S405, card-reader driver program module 204 change message by smart card and are written to state notifying end points;
S406, due to the writing of data, smart card driver module 103 reads intelligent card state by the position of the obstruction of state notifying end points and changes message, and gets intelligent card state and change message;
S407, process change message verification and parsing to intelligent card state, and smart card driver module 103 plugs state notifying to CA module 102 by smart card.
When smart card 301 is pulled out, smart card driver module 103 is labeled as smart card by intelligent card state and extracts state, and new intelligent card state is notified to CA module 102, when smart card 301 is inserted into, smart card driver module 103 will obtain intelligent card state again, and intelligent card state is labeled as to smart card insertion state, new intelligent card state is notified to CA module 102.
User, start DVB playing module in TV 101 and play while supporting program that CA encrypt, if smart card is insertion state herein, CA module 102 can be called smart card driver module 103 and carries out data interaction with smart card 301.
Data interaction mainly comprises:
1, reset smart card; 2, by smart card protocol (as T0, T1, T14 etc.) swap data; 3, in smart card, write initial data; 4, from smart card, read initial data.
The step of swap data is described respectively below by embodiment:
When needs reset smart card 301:
S501, smart card driver module 103 generate smart card reset message, and write by writing end points; Smart card reset message is as shown in Table 4:
Table four
Syntax | Number of bits | Identifier | Note |
Smc_reset_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x4 |
length | 16 | uimsbf | In order, the length of remaining data, is fixed as 2 |
Reserved | 8 | uimsbf | Reserved field, is fixed as 0 |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Different from table one, cmd is fixed as 0x4, represents smart card reset message.
S502, card-reader driver program module 204 read smart card reset message from writing end points, and carry out verification and parsing;
S503, verification by and successfully resolved after, card-reader driver program module 204 resets smart card 301 by smart card controller 202, and gets the response (ATR) that smart card returns;
S504, card-reader driver program module 204 generate smart card reset response message by the response of returning (ATR), this smart card reset response message as shown in Table 5:
Table five
Syntax | Number of bits | Identifier | Note |
Smc_reset_rep_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x5 |
length | 16 | uimsbf | The length of remaining data in order is 1+N |
for(i=0;i<N;i++){ | ? | uimsbf | ? |
ATR data | 8 | bslbf | ATR data |
} | ? | ? | ? |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Respectively show differently from above-mentioned, cmd is fixed as 0x5, represents smart card reset response message; ATR data represents ATR data, and its length is N.
S505, card-reader driver program module 204 write the smart card response message that resets to study in end points;
S506, smart card driver module 103 read smart card reset response message from the above-mentioned end points of reading, and carry out verification and parse ATR and return to CA module 102.
When needs are when writing initial data in smart card 301:
S601, smart card driver module 103 generate smart card initial data and write message, and write by writing end points, and smart card initial data writes message as shown in Table 6:
Table six
Syntax | Number of bits | Identifier | Note |
Smc_raw_write_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x6 |
length | 16 | uimsbf | The length of remaining data in order is 1+N |
for(i=0;i<N;i++){ | ? | uimsbf | ? |
Raw data | 8 | bslbf | The data that need write |
} | ? | ? | ? |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Respectively show differently from above-mentioned, cmd is fixed as 0x6, represents that smart card initial data writes message; The initial data that Raw data representative need write, its length is N.
S602, card-reader driver program module 204 read smart card initial data and write message from writing end points, and carry out verification and parsing, obtain initial data to be written (Raw data);
S603, card-reader driver program module 204 write smart card 301 by smart card controller 202 by initial data to be written, and return and write result;
S604, card-reader driver program module 204 write response message by the result generation smart card initial data that writes of returning, and this smart card initial data writes response message as shown in Table 7:
Table seven
Syntax | Number of bits | Identifier | Note |
Smc_raw_write_rep_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x7 |
length | 16 | uimsbf | In order, the length of remaining data, is fixed as 2 |
Write Result | 8 | bslbf | Be successfully 0, otherwise be 1 |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Respectively show differently from above-mentioned, cmd is fixed as 0x7, represents that smart card initial data writes response message; Write Result representative writes result, and 0 representative writes successfully, and 1 representative writes failure.
S605, card-reader driver program module 204 write response message by smart card initial data and are written to and read end points;
S606, smart card driver module 103 read smart card initial data and write response message from reading end points, and carry out verification and parsing, obtain and write result, return to CA module 102.
When needs read initial data from smart card 301:
S701, smart card driver module 103 generate smart card initial data and read message, and write by writing end points, and this smart card initial data reads message as shown in Table 8:
Table eight
Syntax | Number of bits | Identifier | Note |
Smc_raw_read_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x8 |
length | 16 | uimsbf | In order, the length of remaining data, is fixed as 5 |
Data Length | 32 | uimsbf | Wish the byte number reading |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Respectively show differently from above-mentioned, cmd is fixed as 0x8, represents that smart card initial data reads message; The byte number that Data Length representative need to be read, wherein the length of remaining data is fixed as 5.
S702, card-reader driver program module 204 read smart card initial data and read message by reading end points, and carry out verification and parsing, obtain the byte number that need read;
S703, card-reader driver program module 204 read the initial data of designated length (being above-mentioned byte number) from smart card 301 by smart card controller 202, if smart card 301 can not return to sufficiently long data, return to the data of smart card 301 current lengths;
S704, card-reader driver program module 204 generate smart card initial data by the data of returning and read response message, and this smart card initial data reads response message as shown in Table 9:
Table nine
Syntax | Number of bits | Identifier | Note |
Smc_raw_read_rep_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x9 |
length | 16 | uimsbf | The length of remaining data in order is 1+N |
for(i=0;i<N;i++){ | ? | uimsbf | ? |
data | 8 | bslbf | The data of reading |
} | ? | ? | ? |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Respectively show differently from above-mentioned, cmd is fixed as 0x9, represents that smart card initial data reads response message; The data that data representative reads, length is N.
S705, card-reader driver program module 204 read response message by smart card initial data and are written to and read end points;
S706, smart card driver module 103 read initial data and read response message from reading end points, and carry out verification and parsing, obtain initial data, return to CA module 102.
When needs are during according to smart card protocol (such as T0, T1 or T14 etc.) and smart card 301 swap data, swap data can adopt in said method toward writing initial data and obtain initial data from smart card in smart card and combine, the present embodiment also provides a kind of swap data method, and it comprises step:
S801, smart card driver module 103 generating intelligent card datas exchange messages, and write card-reader driver program module 204 by writing end points, and intelligent card data exchanges messages as shown in Table 10:
Table ten
Syntax | Number of bits | Identifier | Note |
Smc_transfer_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0xa |
length | 16 | uimsbf | The length of remaining data in order is 1+N |
for(i=0;i<N;i++){ | ? | uimsbf | ? |
data | 8 | bslbf | Input data |
} | ? | ? | ? |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Respectively show differently from above-mentioned, cmd is fixed as 0xa, represents that intelligent card data exchanges messages; The data of data representative input, length is N.
S802, card-reader driver program module 204 read intelligent card data and exchange messages from writing end points, and carry out verification and parsing, in verification, obtain the agreement of appointment and need input data when with successfully resolved;
S803, card-reader driver program module 204 be by smart card controller 202, by the agreement of appointment and need input data, completes mutual with smart card 301, and this reciprocal process may comprise repeatedly read-write operation, and finally obtains exporting data.
S804, card-reader driver program module 204 will be exported data generating intelligent card data exchange response message, and this intelligent card data exchange response message is as shown in table ten one:
Table ten one
Syntax | Number of bits | Identifier | Note |
Smc_transfer_rep_msg () { | ? | ? | ? |
magci_number | 32 | bslbf | For fixed value, as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0xb |
length | 16 | uimsbf | The length of remaining data in order is 1+N |
for(i=0;i<N;i++){ | ? | uimsbf | ? |
data | 8 | bslbf | Output data |
} | ? | ? | ? |
check sum | 8 | rpchof | Check value (optional) |
} | ? | ? | ? |
Respectively show differently from above-mentioned, cmd is fixed as 0xb, represents intelligent card data exchange response message; The data of data representative output, length is N.
S805, card-reader driver program module 204 exchange response message by intelligent card data and write and study in end points;
S806, smart card driver module 103 read intelligent card data exchange response message from reading end points, and carry out verification and parsing and obtain output data and return to CA module 102.
In the various embodiments described above, CA module 102 gets after the message that smart card driver module 103 returns, can obtain the needed control word of current playing program, CA module 102 arranges control word to descrambler module 105 and DVB playing module 101 and can complete deciphering and play.
In sum, the present invention is by being arranged at the smart card driver module in electronic equipment and being arranged at the card-reader driver program module of USB smart card reader, carry out exchanges data with smart card, realize reset smart card, by smart card protocol swap data, toward writing initial data in smart card, read the operations such as initial data from smart card, by the present invention, can on the electronic equipment without smart card reader equipment, realize CA function.
Should be understood that, application of the present invention is not limited to above-mentioned giving an example, and for those of ordinary skills, can be improved according to the above description or convert, and all these improvement and conversion all should belong to the protection range of claims of the present invention.
Claims (10)
1. the electronic equipment CA function based on USB realizes a system, it is characterized in that, comprises electronic equipment and is connected to the USB smart card reader on electronic equipment by USB interface; Described electronic equipment comprises smart card driver module, CA module, application module; Described USB smart card reader comprises: USB controller, card-reader driver program module, smart card controller;
Smart card driver module, for generating the operation information that carries out data interaction with smart card, is sent to card-reader driver program module by operation information, and receives the operation response message that card-reader driver program module is returned;
CA module, for realizing CA function according to operation response message;
Application module, for carrying out the application of supporting that CA encrypts according to user's instruction;
Card-reader driver program module, the operation information sending for reading smart card driver module, and carry out verification and parsing, when verification is passed through and successfully resolved, by smart card controller, smart card is carried out to corresponding data exchange operation, and getting the response that smart card returns, the response generating run response message according to returning, is sent to smart card driver module;
USB controller, for transmitting operation information and operation response message between smart card driver module and card-reader driver program module by usb protocol;
Smart card controller, for carrying out corresponding data exchange operation to smart card;
Described smart card driver module, application module are connected in CA module, and described USB controller, smart card controller are connected in card-reader driver program module, and described smart card driver module is also connected in described USB controller.
2. the electronic equipment CA function based on USB according to claim 1 realizes system, it is characterized in that, is provided with one for inserting the smart card draw-in groove of smart card on described USB smart card reader.
3. the electronic equipment CA function based on USB according to claim 1 realizes system, it is characterized in that, described smart card drive module setting has at least 3 USB end points, is respectively used to reading and writing and the state notifying of data.
4. the electronic equipment CA function based on USB according to claim 1 realizes system, it is characterized in that, in described electronic equipment, be also provided with descrambler module and descrambling demultiplexing module, described descrambler module and descrambling demultiplexing module are all connected in CA module.
5. the electronic equipment CA function realizing method based on USB, is characterized in that, comprises step:
A, when needs carry out data interaction with smart card, smart card driver module generates the operation information that carries out data interaction with smart card, and operation information is sent to card-reader driver program module;
B, card-reader driver program module read the operation information that smart card driver module sends, and carry out verification and parsing;
C, upcheck and successfully resolved after, card-reader driver program module is carried out corresponding data exchange operation by smart card controller to smart card, and gets the response that smart card returns;
The response generating run response message that D, card-reader driver program module basis are returned, and operation response message is sent to smart card driver module;
E, smart card driver module are tested and resolve operation response message, obtain the response that smart card returns, and the response that smart card is returned is sent to CA module and realizes CA function.
6. the electronic equipment CA function realizing method based on USB according to claim 5, is characterized in that, before described steps A, also comprises:
A0, smart card driver module is carried out to process initialization processing: detect USB smart card reader and whether insert electronic equipment, when inserting, open USB smart card reader, and inquire about the plug state of smart card.
7. the electronic equipment CA function realizing method based on USB according to claim 6, is characterized in that, the querying method of the plug state of described smart card comprises step:
A01, smart card driver module are sent to card-reader driver program module by intelligent card state query messages;
A02, card-reader driver program module are carried out verification and parsing to intelligent card state query messages;
A03, verification by and successfully resolved after, by smart card controller, inquire about smart card and whether be inserted into the plug state that obtains smart card in USB smart card reader;
A04, card-reader driver program module generate intelligent card state query response message according to the plug state of the smart card inquiring, and are sent to smart card driver module;
A05, smart card driver module read intelligent card state query response message, carry out verification and resolve, and obtain the plug state of smart card.
8. the electronic equipment CA function realizing method based on USB according to claim 6, is characterized in that, after described steps A 0, also comprises:
A1, when the plug state that inquires smart card is insertion state, smart card driver module is insertion state by the plug status indication of smart card, and opens the monitoring to smart card plug state.
9. the electronic equipment CA function realizing method based on USB according to claim 8, is characterized in that, the described step to the monitoring of smart card plug state specifically comprises:
When A11, smart card are extracted or inserted, smart card controller obtains the plug state of smart card by hardware interrupts;
A12, smart card controller by the plug state notifying of the smart card getting to card-reader driver program module;
A13, card-reader driver program module generate intelligent card state according to the plug state of the smart card receiving and change message, and intelligent card state is changed to message are sent to smart card driver module;
A14, smart card driver module change message to the intelligent card state getting and carry out verification and parsing, obtain the plug state of smart card, and notice are to CA module.
10. the electronic equipment CA function realizing method based on USB according to claim 5, it is characterized in that, described data interaction comprises: reset smart card, according to smart card protocol swap data, toward writing initial data in smart card, read initial data from smart card.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310414366.9A CN103546785B (en) | 2013-09-12 | 2013-09-12 | A kind of electronic equipment CA functions based on USB realize system and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310414366.9A CN103546785B (en) | 2013-09-12 | 2013-09-12 | A kind of electronic equipment CA functions based on USB realize system and method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103546785A true CN103546785A (en) | 2014-01-29 |
CN103546785B CN103546785B (en) | 2017-12-19 |
Family
ID=49969776
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310414366.9A Expired - Fee Related CN103546785B (en) | 2013-09-12 | 2013-09-12 | A kind of electronic equipment CA functions based on USB realize system and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103546785B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2722532Y (en) * | 2004-09-06 | 2005-08-31 | 成都天奥电子有限公司 | Machine and card separated top box of digital TV-set |
CN1738415A (en) * | 2005-08-25 | 2006-02-22 | 上海交通大学 | Digital television with separate device and card conditional receiving method based on smart card |
CN1835552A (en) * | 2005-12-31 | 2006-09-20 | 北京东方广视科技有限责任公司 | Device and method of realizing expendable machine card separation in digital television system |
US20080279375A1 (en) * | 2007-05-09 | 2008-11-13 | Candelore Brant L | Service card adapter |
CN101370076A (en) * | 2008-10-21 | 2009-02-18 | 北京数码视讯科技股份有限公司 | Method for implementing set-card separation based on USB interface |
CN201750507U (en) * | 2010-06-01 | 2011-02-16 | 四川长虹电器股份有限公司 | Conditional access (CA) equipment based on USB interface |
CN203301674U (en) * | 2013-05-24 | 2013-11-20 | Tcl商用信息科技(惠州)股份有限公司 | Digital television and smart card reader |
-
2013
- 2013-09-12 CN CN201310414366.9A patent/CN103546785B/en not_active Expired - Fee Related
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2722532Y (en) * | 2004-09-06 | 2005-08-31 | 成都天奥电子有限公司 | Machine and card separated top box of digital TV-set |
CN1738415A (en) * | 2005-08-25 | 2006-02-22 | 上海交通大学 | Digital television with separate device and card conditional receiving method based on smart card |
CN1835552A (en) * | 2005-12-31 | 2006-09-20 | 北京东方广视科技有限责任公司 | Device and method of realizing expendable machine card separation in digital television system |
US20080279375A1 (en) * | 2007-05-09 | 2008-11-13 | Candelore Brant L | Service card adapter |
CN101370076A (en) * | 2008-10-21 | 2009-02-18 | 北京数码视讯科技股份有限公司 | Method for implementing set-card separation based on USB interface |
CN201750507U (en) * | 2010-06-01 | 2011-02-16 | 四川长虹电器股份有限公司 | Conditional access (CA) equipment based on USB interface |
CN203301674U (en) * | 2013-05-24 | 2013-11-20 | Tcl商用信息科技(惠州)股份有限公司 | Digital television and smart card reader |
Also Published As
Publication number | Publication date |
---|---|
CN103546785B (en) | 2017-12-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11830243B2 (en) | Bus translator | |
US10180922B2 (en) | Methods and systems for devices with self-selecting bus decoder | |
KR20130129910A (en) | Mechanism for partial encryption of data streams | |
CN108227613A (en) | Electronic device and its operating method | |
KR100334359B1 (en) | Smart card message transfer without microprocessor intervention | |
JP2007233960A (en) | Authentication processing device and authentication processing method | |
US9021169B2 (en) | Bus system including ID converter and converting method thereof | |
TW200627929A (en) | Information receiver, DTV system and method for sharing pins of cryptocard module and external memory in DTV system | |
KR20160050296A (en) | Electronic apparatus and controlling method thereof | |
CN101247500A (en) | General software descrambling method for different scrambling systems of digital television | |
CN110377534B (en) | Data processing method and device | |
US20210019140A1 (en) | Method for updating IC firmware | |
CN103455462A (en) | Usb host controller and scheduling methods thereof | |
CN103546785A (en) | Electronic equipment CA function realizing system and method based on USB (universal serial bus) | |
CN105117353A (en) | FPGA with general data interaction module and information processing system using same | |
CN104850872A (en) | Method of transferring data, computer program product and tag | |
TWI529537B (en) | Display with mobile high-definition link port and signal processing method thereof | |
CN105187899B (en) | Data transmission system | |
CN104615271A (en) | Processing method for KVM (Kernel-based Virtual Machine) and processing device for KVM | |
US20160291987A1 (en) | Programmable cable and programming method thereof | |
CN103065068B (en) | A kind of encryption method of imprinting file and device | |
CN101919203A (en) | Cipher independent interface for cryptographic hardware service | |
CN202190365U (en) | Condition access system and digital television all-in-one machine | |
CN105653477A (en) | Double-port RAM-based method for communication of hard core and soft core in FPGA | |
CN105261397B (en) | programmable transmission cable and programming method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20171219 Termination date: 20210912 |
|
CF01 | Termination of patent right due to non-payment of annual fee |