|
Java Card 2.1 Platform Final Revision 1.0 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The RSAPrivateCrtKey
interface is used to sign data using the RSA algorithm
in its Chinese Remainder Theorem form. It may also be used by the javacardx.crypto.Cipher
class
to encrypt/decrypt messages.
Let S = md mod n, where m is the data to be signed, d is the private key exponent, and n is private key modulus composed of two prime numbers p and q. The following names are used in the initializer methods in this interface:
P, the prime factor p
Q, the prime factor q.
PQ = q-1 mod p
DP1 = d mod (p - 1)
DQ1 = d mod (q - 1)
When all five components (P,Q,PQ,DP1,DQ1) of the key are set, the key is initialized and ready for use.
RSAPrivateKey
,
RSAPublicKey
,
KeyBuilder
,
Signature
,
Cipher
,
KeyEncryption
Method Summary | |
short |
getDP1(byte[] buffer,
short offset)
Returns the value of the DP1 parameter in plain text. |
short |
getDQ1(byte[] buffer,
short offset)
Returns the value of the DQ1 parameter in plain text. |
short |
getP(byte[] buffer,
short offset)
Returns the value of the P parameter in plain text. |
short |
getPQ(byte[] buffer,
short offset)
Returns the value of the PQ parameter in plain text. |
short |
getQ(byte[] buffer,
short offset)
Returns the value of the Q parameter in plain text. |
void |
setDP1(byte[] buffer,
short offset,
short length)
Sets the value of the DP1 parameter. |
void |
setDQ1(byte[] buffer,
short offset,
short length)
Sets the value of the DQ1 parameter. |
void |
setP(byte[] buffer,
short offset,
short length)
Sets the value of the P parameter. |
void |
setPQ(byte[] buffer,
short offset,
short length)
Sets the value of the PQ parameter. |
void |
setQ(byte[] buffer,
short offset,
short length)
Sets the value of the Q parameter. |
Methods inherited from interface javacard.security.Key |
clearKey,
getSize,
getType,
isInitialized |
Method Detail |
public void setP(byte[] buffer, short offset, short length) throws CryptoException
buffer
- the input bufferoffset
- the offset into the input buffer at which the parameter value beginslength
- the length of the parameterCryptoException.ILLEGAL_VALUE
if the input parameter data length is inconsistent
with the implementation or if input data decryption is required and fails.
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the P parameter value is decrypted using the Cipher
object.
public void setQ(byte[] buffer, short offset, short length) throws CryptoException
buffer
- the input bufferoffset
- the offset into the input buffer at which the parameter value beginslength
- the length of the parameterCryptoException.ILLEGAL_VALUE
if the input parameter data length is inconsistent
with the implementation or if input data decryption is required and fails.
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the Q parameter value is decrypted using the Cipher
object.
public void setDP1(byte[] buffer, short offset, short length) throws CryptoException
buffer
- the input bufferoffset
- the offset into the input buffer at which the parameter value beginslength
- the length of the parameterCryptoException.ILLEGAL_VALUE
if the input parameter data length is inconsistent
with the implementation or if input data decryption is required and fails.
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the DP1 parameter value is decrypted using the Cipher
object.
public void setDQ1(byte[] buffer, short offset, short length) throws CryptoException
buffer
- the input bufferoffset
- the offset into the input buffer at which the parameter value beginslength
- the length of the parameterCryptoException.ILLEGAL_VALUE
if the input parameter data length is inconsistent
with the implementation or if input data decryption is required and fails.
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the DQ1 parameter value is decrypted using the Cipher
object.
public void setPQ(byte[] buffer, short offset, short length) throws CryptoException
buffer
- the input bufferoffset
- the offset into the input buffer at which the parameter value beginslength
- the length of the parameterCryptoException.ILLEGAL_VALUE
if the input parameter data length is inconsistent
with the implementation or if input data decryption is required and fails.
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the PQ parameter value is decrypted using the Cipher
object.
public short getP(byte[] buffer, short offset)
buffer
- the output bufferoffset
- the offset into the output buffer at which the parameter value beginspublic short getQ(byte[] buffer, short offset)
buffer
- the output bufferoffset
- the offset into the output buffer at which the parameter value beginspublic short getDP1(byte[] buffer, short offset)
buffer
- the output bufferoffset
- the offset into the output buffer at which the parameter value beginspublic short getDQ1(byte[] buffer, short offset)
buffer
- the output bufferoffset
- the offset into the output buffer at which the parameter value beginspublic short getPQ(byte[] buffer, short offset)
buffer
- the output bufferoffset
- the offset into the output buffer at which the parameter value begins
|
Submit a bug or feature Java and Java Card are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |