Digital signature generating apparatus, method, computer program and computer-readable storage medium

A digital signature generating apparatus generates a digital signature of digital data. The digital signature generating apparatus includes a receiving unit, the secret key changing unit and a digital signature generating unit. The receiving unit receives one of a first command and a second command. The first command includes information indicating one of a plurality of secret keys, and the plurality of secret keys are included in the digital signature generating apparatus. The secret key changing unit changes a secret key used by the digital signature generating apparatus to a secret key specified by the first command, if the first command is received by the receiving unit. The digital signature generating unit generates the digital signature of the digital data from a hash value extracted from the second command, if the second command is received by the receiving unit.

FIELD OF THE INVENTION

This invention relates to a digital signature generating apparatus and method, a computer program therefor and a computer-readable storage medium storing this computer program.

BACKGROUND OF THE INVENTION

Digital cameras that store the optical image of a subject in digital form are now in actual use. An advantage of image data captured by a digital camera is that the data is easy to utilize and manipulate. However, this means that the image data can also be altered with ease. A problem which arises as a consequence is that the trustworthiness of a photograph taken by a digital camera is inferior to that of an emulsion photograph and lacks the ability to serve as evidence. For this reason, a digital camera system having a function for adding a digital signature to captured image data has been proposed in recent years. For example, see the specifications of U.S. Pat. No. 5,499,294 and Japanese Patent Application Laid-Open No. 9-200730.

However, since public-key encryption schemes such as RSA encryption ordinarily used in generating digital signatures require an exponentiation operation or a remainder operation, high-speed processing is difficult and a processing time that is several hundred to several thousand times longer than that needed for a common-key encryption scheme such as DES is required. Consequently, with the limited computational resources available in a digital camera, generating a digital signature using public-key encryption is very difficult.

Accordingly, there has been proposed a technique (e.g., see the specification of Japanese Patent Application Laid-Open No. 2002-244924) through which a digital signature is applied using a storage medium incorporating a microprocessor, e.g., an IC card, thereby enabling a digital signature to be applied to generated image data without greatly enhancing the capabilities of computational resources available to the digital camera.

However, the arrangement set forth in the specification of Japanese Patent Application Laid-Open No. 2002-244924 is such that the memory in an IC card is furnished with only one secret key with regard to a camera-specific ID. If a special user is provided with a secret key different from that of the general user, therefore, then the IC card having the secret key for the special user must be re-fabricated. The problem which arises is an increase in the manufacturing cost of the IC card for the special user.

SUMMARY OF THE INVENTION

Accordingly, an object of the present invention is to provide a special user with digital-signature key information that differs from that of a general user without raising manufacturing cost.

According to an aspect of the present invention, a digital signature generating apparatus having storage unit in which a plurality of secret keys have been stored, comprises: a processing unit adapted to change a secret key used by the digital signature generating apparatus to a secret key specified by a key change command if the key change command has been received, and generate a digital signature of prescribed digital data using any one of the plurality of secret keys if a signature generating command has been received.

According to another aspect of the present invention, a method of generating a digital signature in a digital signal generating apparatus having storage unit in which a plurality of secret keys have been stored, the method comprises the steps of: changing a secret key used by the digital signature generating apparatus to a secret key specified by a key change command if the key change command has been received; and generating a digital signature of prescribed digital data using any one of the plurality of secret keys if a signature generating command has been received.

According to a further aspect of the present invention, a digital signature generating apparatus, which has a plurality of secret keys, for generating a digital signature of prescribed digital data using one of the plurality of secret keys, comprises: a processing unit adapted to analyze an externally applied command, and set a secret key, which is to be used in generating the digital signature, from among the plurality of secret keys in accordance with result of the analysis.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

First Embodiment

First, the main components of a digital signature generating system according to a first embodiment of the invention will be described with reference toFIG. 1.

An IC card10is equipped with a multi-application operating system and is capable of executing multiple application programs. The IC card10has a storage medium (a semiconductor memory or the like) storing a plurality of secret keys and is capable of using any one of these secret keys to generate a digital signature S of digital data M (image data, etc.) contained in a command applied by a computer A20and of outputting this digital signature S upon including it in a response. The IC card10may be of the contact type, contactless type or hybrid type (i.e., an IC card having both contact- and contactless-type functions). Since the IC card10is an apparatus that generates the digital signature S of digital data M, it can also be regarded as a “digital signature generating apparatus”.

It should be noted that the computer and IC card10exchange data via an IC card interface incorporated in the computer or connected to the computer so as to enable communication, though this is not specifically set forth in the description that follows.

The computer A20is one used by the vendor of the IC card10. A recording medium21is one on which a program A installed in the computer A20has been recorded. The program A, which is capable of being executed by the computer A20, is one necessary to execute processing (seeFIG. 5) for changing a secret key and processing for verifying a secret key (seeFIG. 6).

A computer B30is one used by the general user or special user. A recording medium31is one on which a program B installed in the computer B30has been recorded. The program B, which is capable of being executed by the computer B30, is one necessary to execute processing (seeFIG. 7) for generating a digital signature.

The main structural elements of the IC card10according to this embodiment will now be described with reference toFIG. 2. An interface unit101receives a command transmitted from the computer A20or B30and sends the computer A20or B30a response that corresponds to the command received.

A CPU (Central Processing Unit)102controls the operation of the IC card10in accordance with a plurality of application programs stored in an EEPROM (Electrically Erasable and Programmable ROM)104.

A ROM (Read-Only Memory)103is a memory for storing a multi-application operating system and a command interpreter. The multi-application operating system is an operating system that manages a plurality of application programs stored in the EEPROM104. The multi-application operating system includes an input/output function, an encryption function, a file management function, a function for adding a new application program to the EEPROM104and a function for deleting an application program stored in the EEPROM104.

The EEPROM104is a memory that stores a key management table for managing a plurality of secret keys, a plurality of application programs and user data.

A RAM (Random-Access Memory)105is a memory for temporarily storing data handled by the CPU102and by a coprocessor106.

The coprocessor106generates a digital signature S of digital data M by encrypting hash of received digital data M using one of the plurality of secret keys stored in the EEPROM104. The coprocessor106utilizes a public-key code such as RSA code in the encryption algorithm.

An example of the key management table stored in the EEPROM104of the IC card10will be described next with reference toFIG. 3. The key management table is a management table for managing secret keys used by the IC card10. A plurality of secret keys (16 in this embodiment) have been registered in the key management table, as shown inFIG. 3. A secret key at No.0is the secret key for the general user. The secret key on the IC card10immediately after the manufacture thereof will have been set to the secret key at No.0. The secret keys at Nos.1to15are secret keys for special users. If a certain special user is to be provided with the secret key at No.2, the vender transmits a key change command (which specifies the No.2secret key) to the IC card10using the computer A20. If execution of the key change command ends normally, the secret key on the IC card10will be the No.2secret key, thereby enabling this special user to be provided with a secret key that is different from that of the general user.

Reference will now be had toFIGS. 4A and 4Bto describe the data format of the command transmitted from the computer A20or B30to the IC card10and the data format of the response transmitted from the IC card10to the computer A20or B30.

A command identifying code field401contains a command identifying code representing the type of command. Commands include the key change command, a key verification command and a signature generation command. The key change command requests the IC card10to change a secret key used by the IC card10to a secret key that has been selected by the vender. The key verification command queries the IC card10about the key number of the secret key to which the IC card10has been set. The signature generation command requests the IC card10to generate the digital signature S of digital data M, such as image data that has been selected by the user.

A command data length field402contains the data length (the length in bytes) of a command data field403.

The command data field403contains data that is transmitted to the IC card10. In case of the key change command, the key number of the secret key desired to be set in the IC card10is planted in the command data field403. In case of the key verification command, nothing is planted in the command data field403. In case of the signature generation command, the digital data M (image data, etc.) is planted in the command data field403.

A response data length field404contains the data length (the length in bytes) of a response data field405.

The response data field405contains data that corresponds to the command. In a case where execution of the key change command has ended normally, the key number of the secret key that has been set in the IC card10is planted in the response data field405. If execution of the signature generation command has ended normally, the digital signature of the digital data extracted from the signature generating command is planted in the response data field405. If the key change command, key verification command or signature generation command has not ended normally, then dummy data is planted in the response data field405.

A status code field406contains a status code representing the result (normal end, error, alert, etc.) of command execution.

The procedure of processing executed by the computer A20and IC card10for changing a secret key will now be described with reference toFIG. 5. The processing for changing a secret key is processing for changing the secret key, which has been selected by the vendor, used by the IC card10. This processing is executed on the vendor side after the IC card10is manufactured.

Step S501: The computer A20generates a key change command in accordance with the instructions of the vendor and transmits the generated key change command to the IC card10. At this time the key number that was selected by the vendor is present in the command data field403of the key change command.

Step S502: The interface unit101receives the key change command and supplies the CPU102with the key change command received. The CPU102extracts the key number from the command data field403of the key change command and updates the key management table for the purpose of enabling the key number extracted. In other words, the secret key specified by the key change command is changed to the secret key used by the IC card10. For example, if the key number specified by the key change command is No.3, the secret key used by the IC card10is changed to the No.3secret key.

Step S503: The CPU102generates a response from the result of execution of the key change command and supplies the interface unit101with the response generated. At this time the key number that is the result of the change is present in the response data field405of the response. The interface unit101sends this response back to the computer A20.

Step S504: The computer A20receives and analyzes the response. If execution of the key change command ended normally, the computer A20notifies the vendor of the key number resulting from the change. As a result, the vendor is capable of ascertaining the secret key for the digital signature that has been set in the IC card10. If execution of the key change command did not end normally, the computer A20uses the status code to notify the vendor of the reason why the key change command did not end normally.

The procedure of processing executed by the computer A20and IC card10to verify a secret key will now be described with reference toFIG. 6. Processing for verification of a secret key is for verifying a secret key for a digital signature used by the IC card10. This processing is executed on the side of the vendor.

Step S601: The computer A20generates a key verification command in accordance with the instructions of the vendor and transmits the generated key verification command to the IC card10. At this time nothing is present in the command data field403of the key verification command.

Step S602: The interface unit101receives the key verification command and supplies the CPU102with the key verification command received. The CPU102executes the key verification command supplied from the interface unit101. Specifically, the CPU102refers to the key management table and investigates the key number to which the IC card10has been set.

Step S603: The CPU102generates a response from the result of execution of the key verification command and supplies the interface unit101with the response generated. At this time the key number to which the IC card10has been set is present in the response data field405of the response. The interface unit101sends this response back to the computer A20.

Step S604: The computer A20receives and analyzes the response. If execution of the key verification command ended normally, the computer A20notifies the vendor of the key number to which the IC card10has been set. As a result, the vendor is capable of ascertaining the secret key for the digital signature that has been set in the IC card10. If execution of the key verification command did not end normally, the computer A20uses the status code to notify the vendor of the reason why execution of the key verification command did not end normally.

The procedure of processing executed by the computer B30and IC card10to generate a digital signature will now be described with reference toFIG. 7. Processing for generating a digital signature is for generating the digital signature S of digital data M using the secret key for the digital signature that has been set in the IC card10. This processing is executed on the side of the general or special user.

Step S701: The computer B30generates a signature generation command in accordance with the instructions of the general or special user and transmits the generated signature generation command to the IC card10. At this time the digital data M is present in the command data field403of the signature generation command.

Step S702: The interface unit101receives the signature generation command and supplies the CPU102with the signature generation command received. The CPU102extracts the digital data M from the command data field403and writes the extracted digital data M to the RAM105. The CPU102extracts from the key management table the secret key to which the IC card10has been set and writes the extracted secret key to the RAM105. In a case where the user of the computer B30is a general user, the CPU102writes the No.0secret key to the RAM105. In a case where the user of the computer B30is a special user, the processor106writes the secret key of any one of Nos.1to15to the RAM105. In order to generate the digital signature S of digital data M, the processor106generates a hash of the digital data M from the digital data M that has been read out of the RAM105and encrypts the generated hash by the secret key read out of the RAM105. The coprocessor106writes the generated digital signature S to the RAM105.

Step S703: The CPU102generates a response from the result of execution of the signature generation command and supplies the interface unit101with the response generated. If execution of the signature generation command ended normally, the digital signature S read out of the RAM105is planted in the response data field405. If the execution of the signature generation command did not end normally, then dummy data is planted in the response data field405. The interface unit101sends this response back to the computer B30.

Step S704: The computer B30receives and analyzes the response. If execution of the signature generation command ended normally, the computer B30notifies the user of the fact that the digital signature S was generated normally. The computer B30then extracts the digital signature S from the response data field405and attaches the extracted digital signature S to the digital data M. If execution of the signature generation command did not end normally, the computer B30notifies the user of the reason why execution of the command did not end normally.

Next, reference will be had toFIG. 8to describe a procedure for supplying a special user with the IC card10that has been set to a secret key for the special user.

Step S801: The vendor accepts the IC card10from the special user.

Step S802: The vendor decides the key number (any one of Nos.1to15) that the special user will be allowed to use.

Step S803: The vendor sets the IC card10to the key number decided at step S802. The above-described key change command is used to set the key number. A secret key different from that of the general user (the key number of the general user is No.0) is set in the IC card10by this processing. For example, if the key number decided at step S802is No.3, then the secret key of IC card10becomes the secret key corresponding to No.3.

Step S804: The vendor supplies the IC card10to the special user. As a result, the vendor is capable of supplying the special user with a secret key for a digital signature different from that of the general user.

Thus, in accordance with the IC card10of the first embodiment, the secret key used can be changed by a key change command. As a result, a special user can be provided with a secret key for a digital signature different from that of a general user without raising the cost of manufacturing the IC card10. Further, since a plurality of secret keys for special users can also be stored, even a plurality of special users can be provided with respective ones of secret keys for digital signatures different from that of the general user.

Further, in accordance with the IC card10of the first embodiment, the fact that the card can be equipped with a multi-function operating system makes it easy to add on a new application program. In other words, this makes it each to adopt a new algorithm for generating digital signatures, to update the key management table and to add on entirely new functions.

Second Embodiment

With the above-described processing for generating a digital signature, the digital data M is contained in the command data field of the signature generation command. However, it is also possible to replace the digital data M with the hash of the digital data M. In such case the hash of the digital data M need no longer be generated within the IC card10and, as a result, it is possible to lighten the load upon the IC card10and to generate the digital signature S at high speed. Further, it is also possible to reduce the data size handled by the IC card10in such case (because the data size of the hash value of the digital data M is sufficiently smaller than the data size of the digital data M). As a result, the size of the circuitry on the IC card10can be reduced and the cost of manufacturing the IC card10can be reduced.

Third Embodiment

The computer B30can be replaced by an image sensing apparatus such as a digital camera, digital video camera or scanner.FIG. 9illustrates the main components of a digital signature generating system according to a third embodiment of the invention. An image sensing apparatus40is an apparatus having an image sensing unit for sensing the image of a subject. Examples of the apparatus are a digital camera, digital video camera and scanner. A recording medium41is a medium on which a program necessary for executing the above-described processing for generating digital signatures has been recorded. In this case, a digital signature of original image data representing an image sensed by the image sensing apparatus can be generated by the IC card10.

Other Embodiments

In this case, so long as the system or apparatus has the functions of the program, the program may be executed in any form, such as an object code, a program executed by an interpreter, or scrip data supplied to an operating system.

The configurations and structures of each of the components shown in the above embodiments all do nothing more than illustrate mere examples of concrete implementations for working the present invention and the technical scope of the present invention should not be interpreted as being limited by these examples. In other words, the present invention can be worked in a variety of forms without departing from the spirit of the invention or the main features thereof.

In accordance with the present invention, as described above, a secret key for a digital signature that is different from that of a general user can be provided to a special user without raising the cost of manufacture.