CN103546785B - A kind of electronic equipment CA functions based on USB realize system and method - Google Patents
A kind of electronic equipment CA functions based on USB realize system and method Download PDFInfo
- Publication number
- CN103546785B CN103546785B CN201310414366.9A CN201310414366A CN103546785B CN 103546785 B CN103546785 B CN 103546785B CN 201310414366 A CN201310414366 A CN 201310414366A CN 103546785 B CN103546785 B CN 103546785B
- Authority
- CN
- China
- Prior art keywords
- smart card
- card
- state
- usb
- drive module
- 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.)
- Expired - Fee Related
Links
Landscapes
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The present invention discloses a kind of electronic equipment CA functions based on USB and realizes system and method, and system includes electronic equipment and the USB smart card readers by USB interface connection on an electronic device;Electronic equipment includes smart card drive module, CA modules, application module;USB smart card readers include:USB controller, card-reader driver program module, smart card controller;Smart card drive module, the operation information of data interaction is carried out with smart card for generating, operation information is sent to card-reader driver program module, and receive the operation response message of card-reader driver program module return;Card-reader driver program module, for reading the operation information of smart card drive module transmission, and verified and parsed, when verification passes through simultaneously successfully resolved, corresponding data exchange operation is then performed to smart card by smart card controller, and the response of smart card return is got, operation response message is generated according to the response of return, sent to smart card drive module.
Description
Technical field
The present invention relates to electronic equipment encryption technology field, more particularly to a kind of electronic equipment CA functions based on USB are real
Existing system and method.
Background technology
At present, the encryption system of DTV typically uses CA(Conditional Access, Conditional Access)System,
CA systems need receiving device to have an intelligent card reader, and CA smart cards are read using intelligent card reader, but existing
It is without this device to have most of television set of storage, even the TV newly gone out, also has and does not much provide above-mentioned smart card
Reading device, this causes these TVs can not be by only upgrading software by smart card reading device integrated setting in television equipment
On, and TV can not realize CA functions when no intelligent card reader.
Therefore, prior art has yet to be improved and developed.
The content of the invention
In view of above-mentioned the deficiencies in the prior art, it is an object of the invention to provide a kind of electronic equipment CA work(based on USB
System and method can be realized, it is intended to which solving the electronic equipments such as existing DTV can not be real in no intelligent card reader
The problem of existing CA functions.
Technical scheme is as follows:
A kind of electronic equipment CA functions based on USB realize system, wherein, including electronic equipment and connected by USB interface
Connect USB smart card readers on an electronic device;The electronic equipment includes smart card drive module, CA modules, using mould
Block;The USB smart card readers include:USB controller, card-reader driver program module, smart card controller;
Smart card drive module, the operation information of data interaction is carried out with smart card for generating, operation information is sent
To card-reader driver program module, and receive the operation response message of card-reader driver program module return;
CA modules, for realizing CA functions according to operation response message;
Application module, the application for supporting that CA is encrypted is performed for the instruction according to user;
Card-reader driver program module, for reading the operation information of smart card drive module transmission, and verified and parsed,
When verifying by simultaneously successfully resolved, then corresponding data exchange operation is performed to smart card by smart card controller, and obtain
The response returned to smart card, operation response message is generated according to the response of return, sent to smart card drive module;
USB controller, for transmitting operation between smart card drive module and card-reader driver program module by usb protocol
Message and operation response message;
Smart card controller, for performing corresponding data exchange operation to smart card;
The smart card drive module, application module are connected to CA modules, and the USB controller, smart card controller connect
Card-reader driver program module is connected to, the smart card drive module is also attached to the USB controller.
The described electronic equipment CA functions based on USB realize system, wherein, set on the USB smart card readers
There is a smart card neck for being used to insert smart card.
The described electronic equipment CA functions based on USB realize system, wherein, the smart card drive module setting have to
Few 3 USB end points, it is respectively used to reading and writing and the state notifying of data.
The described electronic equipment CA functions based on USB realize system, wherein, descrambling is additionally provided with the electronic equipment
Device module and descrambling demultiplexing module, the descrambler module and descrambling demultiplexing module are all connected to CA modules.
A kind of electronic equipment CA function realizing methods based on USB, wherein, including step:
A, when needing to carry out data interaction with smart card, the generation of smart card drive module carries out data interaction with smart card
Operation information, and operation information is sent to card-reader driver program module;
B, card-reader driver program module reads the operation information that smart card drive module is sent, and is verified and parsed;
C, verification pass through and successfully resolved after, card-reader driver program module by smart card controller to smart card perform phase
The data exchange operation answered, and get the response of smart card return;
D, card-reader driver program module according to the response of return generate operation response message, and will operation response message send to
Smart card drive module;
E, smart card drive module is verified and parsed to operation response message, obtains the response that smart card returns, will
The response that smart card returns, which is sent to CA modules, realizes CA functions.
The described electronic equipment CA function realizing methods based on USB, wherein, also include before the step A:
A0, process initialization processing is carried out to smart card drive module:Whether detection USB smart card readers insert electronics
Equipment, upon insertion, USB smart card readers are opened, and inquire about the plug state of smart card.
The described electronic equipment CA function realizing methods based on USB, wherein, the inquiry of the plug state of the smart card
Method includes step:
A01, smart card drive module send intelligent card state query messages to card-reader driver program module;
A02, card-reader driver program module are verified and parsed to intelligent card state query messages;
A03, verification pass through and successfully resolved after, by smart card controller inquire about smart card whether be inserted into USB intelligence
The plug state of smart card is obtained in energy card reader;
A04, card-reader driver program module generate intelligent card state inquiry response according to the plug state of the smart card inquired
Message, and send to smart card drive module;
A05, smart card drive module read intelligent card state query response message, are verified and are parsed, and obtain intelligence
The plug state that can block.
The described electronic equipment CA function realizing methods based on USB, wherein, also include after the step A0:
A1, when inquiring the plug state of smart card and being insert state, smart card drive module is by the plug of smart card
Status indication is insert state, and opens the monitoring to smart card plug state.
The described electronic equipment CA function realizing methods based on USB, wherein, the monitoring to smart card plug state
The step of specifically include:
When A11, smart card are extracted or inserted, smart card controller passes through the plug state that hardware interrupts obtain smart card;
A12, smart card controller notify the plug state of the smart card got to give card-reader driver program module;
A13, card-reader driver program module generate intelligent card state according to the plug state of the smart card received and change message,
And intelligent card state change message is sent to smart card drive module;
A14, smart card drive module change message to the intelligent card state got and are verified and parsed, and obtain intelligence
The plug state of card, and notify to give CA modules.
The described electronic equipment CA function realizing methods based on USB, wherein, the data interaction includes:Reset intelligence
Card, exchange according to smart card protocol data, toward write-in initial data in smart card, initial data is read from smart card.
Beneficial effect:The present invention is by the smart card drive module that is arranged in electronic equipment and is arranged at USB smart cards
The card-reader driver program module of card reader, data exchange is carried out with smart card, realize and reset smart card, exchange number by smart card protocol
According to, toward writing initial data in smart card, the operation such as initial data being read from smart card, can be without intelligence by the present invention
CA functions are realized on the electronic equipment of card card-reading apparatus.
Brief description of the drawings
Fig. 1 is the structured flowchart that a kind of electronic equipment CA functions based on USB of the present invention realize system preferred embodiment.
Fig. 2 is a kind of flow chart of the electronic equipment CA function realizing method preferred embodiments based on USB of the present invention.
Embodiment
The present invention provides a kind of electronic equipment CA functions based on USB and realizes system and method, for make the purpose of the present invention,
Technical scheme and effect are clearer, clear and definite, and the present invention is described in more detail below.It is it should be appreciated that described herein
Specific embodiment only to explain the present invention, is not intended to limit the present invention.
Referring to Fig. 1, Fig. 1 realizes system preferred embodiment for a kind of electronic equipment CA functions based on USB of the present invention
Structured flowchart, as illustrated, it includes electronic equipment(The present embodiment illustrates by TV 100 of electronic equipment)And USB intelligence
Can card reader 200;
Wherein, the TV 100 includes smart card drive module 103, CA modules 102, application module(The present embodiment with should
It is DVB with module(DVB)Exemplified by playing module 101), descrambler module 105, Demux(Descrambling demultiplexing)Module
104;The USB smart card readers 200 include:USB controller 201, card-reader driver program module 204, smart card controller
202nd, smart card neck 203;
Smart card drive module 103, the operation information of data interaction is carried out with smart card 301 for generating, operation is disappeared
Breath is sent to card-reader driver program module 204, and receives the operation response message of the return of card-reader driver program module 204;
CA modules 102, for realizing CA functions according to operation response message;
Application module, the application for supporting that CA is encrypted is performed for the instruction according to user;When the application module is broadcast for DVB
During amplification module 101, the DVB playing modules 101 are used to play the program for supporting CA encryptions.
Descrambler module 105 and Demux modules 104 are used for coordinating CA modules to realize CA functions, and this is prior art,
Repeat no more.
Card-reader driver program module 204, for reading the operation information of the transmission of smart card drive module 103, and verified
And parsing, when verifying by simultaneously successfully resolved, then corresponding data are performed to smart card 301 by smart card controller 202 and are handed over
Operation is changed, and gets the response of the return of smart card 301, operation response message is generated according to the response of return, sent to intelligence
Card drive module 103;
USB controller 201, for by usb protocol smart card drive module 103 and card-reader driver program module 204 it
Between transmit operation information and operation response message;
Smart card controller 202, for performing corresponding data exchange operation to smart card 301;
Smart card neck 203, for inserting smart card 301;
The smart card drive module 103, DVB playing modules 101, descrambler module 105, Demux modules 104 are connected to
CA modules 102, the USB controller 201, smart card controller 202 are connected to card-reader driver program module 204, the smart card
Drive module 103 is also attached to the USB controller 201, and the smart card neck 203 is connected to the smart card controller
202。
The present invention is the USB interface using existing TV, the communication of TV and smart card is realized, so even in no intelligence
In the case of energy card card-reading devcie, CA functions can be also realized, are described in detail below as the process of realization.
Based on said system, the present invention provides a kind of electronic equipment CA function realizing methods based on USB, as shown in Fig. 2
It includes step:
S101, when need with smart card carry out data interaction when, smart card drive module generation with smart card carry out data
Interactive operation information, and operation information is sent to card-reader driver program module;
S102, card-reader driver program module read the operation information that smart card drive module is sent, and are verified and parsed;
S103, verification pass through and successfully resolved after, card-reader driver program module is held by smart card controller to smart card
The corresponding data exchange operation of row, and get the response of smart card return;
S104, card-reader driver program module generate operation response message according to the response of return, and will operation response message hair
Deliver to smart card drive module;
S105, smart card drive module are verified and parsed to operation response message, obtain the response that smart card returns,
The response that smart card returns is sent to CA modules and realizes CA functions.
TV CA function implementation process is illustrated with reference to Fig. 1.
When user starts the program of the broadcasting support CA encryptions of DVB playing modules 101 of TV using remote control, then in head
Before secondary broadcasting, to the process initialization of smart card drive module 103, the initialization step includes:Check USB smart card readers
Whether 200 be inserted into TV 100;Belong to prior art for judging whether USB device is inserted into electronic equipment, no longer
Repeat.
When detecting that USB smart card readers 200 are inserted into TV 100, then USB smart card readers 200 are opened,
Heretofore described smart card drive module 103 is used for carrying out the interaction of data, is created in smart card drive module 103
At least three USB end points(endpoint), reading and writing and the state notifying of data are respectively intended to, i.e. these three end points are referred to as reading
End points, end points, state notifying end points are write, it is all disposed within television, correspondingly, is set at USB smart card readers end corresponding
USB write end points, USB reads end points, USB state notifying end points, the herein data transfer of USB smart card readers end and television
Carried out according to usb protocol, i.e., by existing USB device data read-write mode(Software and hardware combining)Carry out data transmission.
After USB smart card readers 200 are opened, smart card insert state is inquired about, that is, inquires about whether smart card 301 inserts
To USB smart card readers 200(It is inserted into smart card neck 203)In, the querying method that the present embodiment is provided includes step
Suddenly:
S301, smart card drive module 103 are by intelligent card state query messages(Smartcard status query
message)End points is write by it to write, wherein, smart card query messages are as shown in Table 1:Wherein, Syntax is grammer,
Number of bits are byte long, and Identifier is identifier, and Note is remarks, similarly hereinafter.
Table one
Syntax | Number of bits | Identifier | Note |
Smc_status_query_msg () { | |||
magci_number | 32 | bslbf | For fixed value, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x1 |
length | 16 | uimsbf | The length of remaining data, is fixed as 2 in order |
Reserved | 8 | uimsbf | Reserved field, it is fixed as 0 |
check sum | 8 | rpchof | Check value(It is optional) |
} |
In upper table, " Smc_status_query_msg () " represents intelligent card state query messages, " magci_
Number " represents debugging symbol, and " cmd " represents CMD, and " length " represents data length, and " Reserved ", which is represented, to be protected
Write down characters section, " check sum " represent verification and;" bslbf " represents Bit String, and preceding, " uimsbf " is represented without symbol by the bit of left position
Number integer, high-order bit is preceding, and " rpchof " represents Remainder polynomial coefficients, and high-order bit is preceding.In remarks, magci_
Number is fixed value, represents the password of operation information such as intelligent card state query messages;When cmd is 0x1, smart card is represented
STATUS ENQUIRY message, cmd is 0x2 interval scale intelligent card state query response messages, referring specifically to following each tables;Length is surplus
The length of remainder evidence, 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 pass through USB controller 201, and card-reader driver program module is reached according to usb protocol
204;
S303, card-reader driver program module 204 are verified and parsed to intelligent card state query messages, when verification is by simultaneously
And successfully resolved, then inquire about whether smart card 301 is had been inserted into 203 in smart card neck by smart card controller 202;
S304, card-reader driver program module 204 are rung according to the smart card insert state inquired, generation intelligent card state inquiry
Message is answered, the intelligent card state query response message is 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, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x2 |
length | 16 | uimsbf | The length of remaining data, is fixed as 2 in order |
card_status | 8 | uimsbf | It is 1 if being insert state if card, is otherwise 0 |
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike table one, cmd therein is fixed as 0x2, represents intelligent card state query response message;card_
Status represents plug state, and 1 represents smart card as insert state, and 0 represents smart card as extraction state.
Intelligent card state query response message is written to described reading end points by S305, card-reader driver program module 204(At this
In the case of not refered in particular in invention, it is to be arranged on television to read end points, write end points and state notifying end points, correspondingly, right
End points is write for USB, USB reads end points and USB state notifying end points for USB smart card readers).
S306, smart card drive module 103 read intelligent card state query response message from above-mentioned reading end points, and carried out
Verification and parsing, obtain intelligent card state message.
Smart card current state can be labeled as the intelligent card state inquired by smart card drive module 103.
Meanwhile smart card drive module 103 opens the monitoring of smart card plug message, the present invention provides one kind and monitors intelligence
Card insertion pulls out message approach, and it includes step:
S401, smart card drive module 103 start a new thread, and reading state notifies end in a manner of blocking
Point;
S402, when smart card 301 is inserted into smart card neck 203 or is extracted from smart card neck 203, intelligence
Card controller 202 gets the plug state of smart card by hardware interrupts;
S403, smart card controller 202 notify the smart card plug state got to card-reader driver program module 204;
According to the smart card plug state received, generation intelligent card state, which changes, to disappear for S404, card-reader driver program module 204
Breath, the intelligent card state change 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, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x3 |
length | 16 | uimsbf | The length of remaining data, is fixed as 2 in order |
card_status | 8 | uimsbf | It is 1 if being insert state if card, is otherwise 0 |
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike table two, cmd is fixed as 0x3, represents intelligent card state and changes message.
Intelligent card state change message is written to state notifying end points by S405, card-reader driver program module 204;
S406, the write-in due to data, smart card drive module 103 are read by the position of the blocking of state notifying end points
Intelligent card state changes message, and gets intelligent card state and change message;
S407, by changing to intelligent card state, message verifies and parsing, smart card drive module 103 plug smart card
State notifying is to CA modules 102.
When smart card 301 is pulled out, intelligent card state is extracted state by smart card drive module 103 labeled as smart card,
And new intelligent card state is notified that when smart card 301 is inserted into, smart card drive module 103 will obtain again to CA modules 102
Intelligent card state is taken, and intelligent card state is labeled as smart card insert state, new intelligent card state is notified to give CA modules
102。
When DVB playing modules 101 play the program for supporting CA encryptions during user starts TV, if smart card is slotting herein
Enter state, then CA modules 102 can call smart card drive module 103 to carry out data interaction with smart card 301.
Data interaction mainly includes:
1st, smart card is resetted;2nd, by smart card protocol(Such as T0, T1, T14)Exchange data;3rd, it is former toward write-in in smart card
Beginning data;4th, initial data is read from smart card.
The step of illustrating to exchange data respectively below by embodiment:
When needing to reset smart card 301:
S501, smart card drive module 103 generate smart card reset message, and are write by writing end points;Smart card resets
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, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x4 |
length | 16 | uimsbf | The length of remaining data, is fixed as 2 in order |
Reserved | 8 | uimsbf | Reserved field, it is fixed as 0 |
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike 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 end points is write, and are verified and parsed;
S503, verification pass through and successfully resolved after, card-reader driver program module 204 is by smart card controller 202 by intelligence
301 resets can be blocked, and get the response of smart card return(ATR);
S504, card-reader driver program module 204 are by the response of return(ATR)Generate smart card and reset response message, the intelligence
Card resets 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, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x5 |
length | 16 | uimsbf | The length of remaining data in order, it is 1+N |
for(i=0;i<N;i++){ | uimsbf | ||
ATR data | 8 | bslbf | ATR data |
} | |||
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike above-mentioned each table, cmd is fixed as 0x5, represents smart card and resets response message;ATR data are represented
ATR data, its length are N.
Smart card is resetted response message write-in and reads end points by S505, card-reader driver program module 204;
S506, smart card drive module 103 read smart card from above-mentioned reading end points and reset response message, and are verified
Parse ATR and return to CA modules 102.
When writing initial data in needing toward smart card 301:
S601, smart card drive module 103 generate smart card initial data write-in message, and are write by writing end points, intelligence
Energy card initial data write-in message is as shown in Table 6:
Table six
Syntax | Number of bits | Identifier | Note |
Smc_raw_write_msg () { | |||
magci_number | 32 | bslbf | For fixed value, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x6 |
length | 16 | uimsbf | The length of remaining data in order, it is 1+N |
for(i=0;i<N;i++){ | uimsbf | ||
Raw data | 8 | bslbf | The data that need to be write |
} | |||
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike above-mentioned each table, cmd is fixed as 0x6, represents smart card initial data write-in message;Raw data generations
The initial data that table need to write, its length are N.
S602, card-reader driver program module 204 read smart card initial data write-in message from end points is write, and are verified
And parsing, obtain initial data to be written(Raw data);
S603, card-reader driver program module 204 are written into initial data by smart card controller 202 and write smart card
301, and return to write-in result;
The write-in result of return is generated smart card initial data write-in response message by S604, card-reader driver program module 204,
Smart card initial data write-in response message is 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, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x7 |
length | 16 | uimsbf | The length of remaining data, is fixed as 2 in order |
Write Result | 8 | bslbf | Success is 0, is otherwise 1 |
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike above-mentioned each table, cmd is fixed as 0x7, represents smart card initial data write-in response message;Write
Result represents write-in result, and 0 representative writes successfully, and 1 represents write-in failure.
Smart card initial data write-in response message is written to reading end points by S605, card-reader driver program module 204;
S606, smart card drive module 103 read smart card initial data write-in response message from end points is read, and carry out
Verification and parsing, write-in result is obtained, returns to CA modules 102.
When needing to read initial data from smart card 301:
S701, smart card drive module 103 generate smart card initial data and read message, and are write by writing end points, should
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, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x8 |
length | 16 | uimsbf | The length of remaining data, is fixed as 5 in order |
Data Length | 32 | uimsbf | Wish the byte number read |
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike above-mentioned each table, cmd is fixed as 0x8, represents smart card initial data and reads message;Data
Length represents the byte number for needing to read, and the length of wherein remaining data is fixed as 5.
S702, card-reader driver program module 204 read smart card initial data reading message by reading end points, and carry out school
Test and parse, obtain the byte number that need to be read;
S703, card-reader driver program module 204 read designated length by smart card controller 202 from smart card 301(I.e.
Above-mentioned byte number)Initial data, if smart card 301 can not return to sufficiently long data, return to the current length of smart card 301
Data;
The data of return are generated smart card initial data and read response message, the intelligence by S704, card-reader driver program module 204
Energy 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, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0x9 |
length | 16 | uimsbf | The length of remaining data in order, it is 1+N |
for(i=0;i<N;i++){ | uimsbf | ||
data | 8 | bslbf | The data read |
} | |||
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike above-mentioned each table, cmd is fixed as 0x9, represents smart card initial data and reads response message;data
Represent the data read, length N.
Smart card initial data reading response message is written to reading end points by S705, card-reader driver program module 204;
S706, smart card drive module 103 from read end points read initial data read response message, and carry out verification and
Parsing, initial data is obtained, returns to CA modules 102.
When needs are according to smart card protocol(Such as T0, T1 or T14 etc.)When exchanging data with smart card 301, data are exchanged
It can use toward write-in initial data in smart card in the above method and obtain initial data from smart card and be combined, this reality
Apply example and a kind of exchange data method is also provided, it includes step:
S801, smart card drive module 103 generate intelligent card data and exchange message, and write card reader drive by writing end points
Dynamic model block 204, intelligent card data exchange message as shown in Table 10:
Table ten
Syntax | Number of bits | Identifier | Note |
Smc_transfer_msg () { | |||
magci_number | 32 | bslbf | For fixed value, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0xa |
length | 16 | uimsbf | The length of remaining data in order, it is 1+N |
for(i=0;i<N;i++){ | uimsbf | ||
data | 8 | bslbf | Input data |
} | |||
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike above-mentioned each table, cmd is fixed as 0xa, represents intelligent card data and exchanges message;Data represents input
Data, length N.
S802, card-reader driver program module 204 read intelligent card data exchange message from end points is write, and carry out verification reconciliation
Analysis, pass through in verification and the agreement specified is obtained during successfully resolved and needs input data;
S803, card-reader driver program module 204 by the agreement specified and need input data by smart card controller 202, complete
Interacted into smart card 301, this interaction may include multiple read-write operation, and finally give output data.
Output data generation intelligent card data is exchanged response message, the smart card number by S804, card-reader driver program module 204
According to exchange response message as shown in table 11:
Table 11
Syntax | Number of bits | Identifier | Note |
Smc_transfer_rep_msg () { | |||
magci_number | 32 | bslbf | For fixed value, such as 0x55534D43 |
cmd | 8 | bslbf | Order, is fixed as 0xb |
length | 16 | uimsbf | The length of remaining data in order, it is 1+N |
for(i=0;i<N;i++){ | uimsbf | ||
data | 8 | bslbf | Output data |
} | |||
check sum | 8 | rpchof | Check value(It is optional) |
} |
Unlike above-mentioned each table, cmd is fixed as 0xb, represents intelligent card data and exchanges response message;Data is represented
The data of output, length N.
Intelligent card data is exchanged response message write-in and reads end points by S805, card-reader driver program module 204;
S806, smart card drive module 103 read intelligent card data exchange response message from end points is read, and are verified
Output data, which is obtained, with parsing returns to CA modules 102.
In the various embodiments described above, after CA modules 102 get the message of the return of smart card drive module 103, you can obtain
The control word required for current playing program is taken, CA modules 102 set control word to descrambler module 105 and DVB broadcastings
Module 101 can be completed to decrypt and play.
In summary, the present invention by the smart card drive module that is arranged in electronic equipment and is arranged at USB smart cards
The card-reader driver program module of card reader, data exchange is carried out with smart card, realize and reset smart card, exchange number by smart card protocol
According to, toward writing initial data in smart card, the operation such as initial data being read from smart card, can be without intelligence by the present invention
CA functions are realized on the electronic equipment of card card-reading apparatus.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can
To be improved or converted according to the above description, all these modifications and variations should all belong to the guarantor of appended claims of the present invention
Protect scope.
Claims (7)
1. a kind of electronic equipment CA functions based on USB realize system, it is characterised in that are connect including electronic equipment and by USB
The USB smart card readers of mouth connection on an electronic device;The electronic equipment includes smart card drive module, CA modules, answered
Use module;The USB smart card readers include:USB controller, card-reader driver program module, smart card controller;
Smart card drive module, the operation information of data interaction is carried out with smart card for generating, operation information is sent to reading
Card device drive module, and receive the operation response message of card-reader driver program module return;
CA modules, for realizing CA functions according to operation response message;
Application module, the application for supporting that CA is encrypted is performed for the instruction according to user;
Card-reader driver program module, for reading the operation information of smart card drive module transmission, and verified and parsed, work as school
Test by simultaneously successfully resolved, then corresponding data exchange operation is performed to smart card by smart card controller, and get intelligence
The response returned can be blocked, operation response message is generated according to the response of return, sent to smart card drive module;
USB controller, for transmitting operation information between smart card drive module and card-reader driver program module by usb protocol
With operation response message;
Smart card controller, for performing corresponding data exchange operation to smart card;
The smart card drive module, application module are connected to CA modules, and the USB controller, smart card controller are connected to
Card-reader driver program module, the smart card drive module are also attached to the USB controller;
Process initialization processing is carried out to smart card drive module:Whether detection USB smart card readers insert electronic equipment, when
During insertion, USB smart card readers are opened, and inquire about the plug state of smart card;It is in the plug state for inquiring smart card
During insert state, the plug state of smart card is labeled as insert state by smart card drive module, and opens and smart card is plugged
The monitoring of state;
The step of monitoring to smart card plug state, specifically includes:
A, smart card drive module starts a new thread, and reading state notifies end points in a manner of blocking;
B, when smart card is inserted into smart card neck or is extracted from smart card neck, smart card controller passes through hardware
Interrupt the plug state for getting smart card;
C, the smart card plug state got is notified to give card-reader driver program module by smart card controller;
D, card-reader driver program module changes message according to the smart card plug state received, generation intelligent card state:
E, intelligent card state change message is written to state notifying end points by card-reader driver program module;
F, because the write-in of data, smart card drive module read intelligent card state by the position of the blocking of state notifying end points
Change message, and get intelligent card state and change message;
G, by intelligent card state change message verification and parsing, smart card drive module by smart card plug state notify to
CA modules.
2. the electronic equipment CA functions according to claim 1 based on USB realize system, it is characterised in that the USB intelligence
A smart card neck for being used to insert smart card can be provided with card reader.
3. the electronic equipment CA functions according to claim 1 based on USB realize system, it is characterised in that the intelligence
Card drive module setting has at least three USB end points, is respectively used to reading and writing and the state notifying of data.
4. the electronic equipment CA functions according to claim 1 based on USB realize system, it is characterised in that the electronics
Descrambler module and descrambling demultiplexing module are additionally provided with equipment, the descrambler module and descrambling demultiplexing module are all connected with
In CA modules.
5. a kind of electronic equipment CA function realizing methods based on USB, it is characterised in that including step:
A, when needing to carry out data interaction with smart card, the generation of smart card drive module carries out the behaviour of data interaction with smart card
Make message, and operation information is sent to card-reader driver program module;
B, card-reader driver program module reads the operation information that smart card drive module is sent, and is verified and parsed;
C, verification pass through and successfully resolved after, card-reader driver program module is performed corresponding by smart card controller to smart card
Data exchange operation, and get the response of smart card return;
D, card-reader driver program module generates operation response message according to the response of return, and operation response message is sent to intelligence
Card drive module;
E, smart card drive module is verified and parsed to operation response message, obtains the response that smart card returns, will intelligence
The response that card returns, which is sent to CA modules, realizes CA functions;
Also include before the step A:A0, process initialization processing is carried out to smart card drive module:USB smart cards are detected to read
Whether card device inserts electronic equipment, upon insertion, opens USB smart card readers, and inquire about the plug state of smart card;
Also include after the step A0:A1, when inquiring the plug state of smart card and being insert state, smart card driving mould
The plug state of smart card is labeled as insert state by block, and opens the monitoring to smart card plug state;
The step of monitoring to smart card plug state, specifically includes:
A11, smart card drive module start a new thread, and reading state notifies end points in a manner of blocking;
A12, when smart card is inserted into smart card neck or is extracted from smart card neck, smart card controller passes through hard
Part interrupts the plug state for getting smart card;
The smart card plug state got is notified to give card-reader driver program module by A13, smart card controller;
A14, card-reader driver program module change message according to the smart card plug state received, generation intelligent card state:
Intelligent card state change message is written to state notifying end points by A15, card-reader driver program module;
A16, the write-in due to data, smart card drive module read intelligent card-like by the position of the blocking of state notifying end points
State changes message, and gets intelligent card state and change message;
A17, by changing to intelligent card state, message verifies and parsing, smart card drive module notify smart card plug state
Give CA modules.
6. the electronic equipment CA function realizing methods according to claim 5 based on USB, it is characterised in that the intelligence
The querying method of the plug state of card includes step:
A01, smart card drive module send intelligent card state query messages to card-reader driver program module;
A02, card-reader driver program module are verified and parsed to intelligent card state query messages;
A03, verification pass through and successfully resolved after, by smart card controller inquire about smart card whether be inserted into USB smart cards
The plug state of smart card is obtained in card reader;
A04, card-reader driver program module generate intelligent card state query response message according to the plug state of the smart card inquired,
And send to smart card drive module;
A05, smart card drive module read intelligent card state query response message, are verified and are parsed, and obtain smart card
Plug state.
7. the electronic equipment CA function realizing methods according to claim 5 based on USB, it is characterised in that the data
Interaction includes:Reset smart card, data exchanged according to smart card protocol, toward write-in initial data in smart card, from smart card
Read initial data.
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 CN103546785A (en) | 2014-01-29 |
CN103546785B true 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 (6)
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 |
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8320563B2 (en) * | 2007-05-09 | 2012-11-27 | Sony Corporation | Service card adapter |
-
2013
- 2013-09-12 CN CN201310414366.9A patent/CN103546785B/en not_active Expired - Fee Related
Patent Citations (6)
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 |
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 |
---|---|
CN103546785A (en) | 2014-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101496337B (en) | Hard drive authentication | |
US8065524B2 (en) | Authentication processing apparatus and authentication processing method | |
KR100334359B1 (en) | Smart card message transfer without microprocessor intervention | |
CN108227613A (en) | Electronic device and its operating method | |
CN103026722A (en) | Mechanism for partial encryption of data streams | |
BRPI9813309B1 (en) | method for downloading an executable application into a decoder and said decoder | |
CN101206625A (en) | Data processing master control equipment, secondary equipment, system and method | |
CN104516838B (en) | Manage determining method of path and device | |
CN104951706B (en) | Method and apparatus for storage content | |
CN108055585A (en) | Data processing method, set top box upgrading method, terminal and set-top box | |
US20120250090A1 (en) | Image processing appartus and method | |
CN104899497A (en) | Identity card reading apparatus having no SAM module, SAM apparatus and system | |
US8775582B2 (en) | Communication device setting apparatus, communication device setting method, and recording medium | |
CN110045974B (en) | Upgrading method and device for display firmware and terminal | |
US11144305B2 (en) | Method for updating IC firmware | |
CN103546785B (en) | A kind of electronic equipment CA functions based on USB realize system and method | |
CN108243402B (en) | Method and device for reading and writing smart card | |
US9037629B2 (en) | Remote access system, electronic apparatus and method of processing remote access | |
KR20110134465A (en) | Data transmission system and data read method thereof | |
CN109257386B (en) | Processing method, device, equipment and medium for broadcast television program list protocol | |
CN101236583B (en) | Method for supporting mutual exclusion function and DRM device thereof | |
CN105117353A (en) | FPGA with general data interaction module and information processing system using same | |
CN104602038B (en) | A kind of port controlling method and system | |
CN103065068B (en) | A kind of encryption method of imprinting file and device | |
CN105187899B (en) | Data transmission system |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20171219 Termination date: 20210912 |