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.