Smart Card Solution
User Manual
- R502 Manual
JavaCard API Samples
- Algorithm
Java Card Specification
Knowledge Sharing
Smart Card Solution
User Manual
JavaCard API Samples
Java Card Specification
Knowledge Sharing
javacard.security
All Superinterfaces: Key , PrivateKey
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
=
*d
mod
,
where
is the data to be signed,
is the private key exponent,
and
is private key modulus composed of
two prime numbers
and
.
The following names are used in the initializer methods in this interface:
-1 mod
mod (
- 1)
mod (
- 1)
When all five components (P,Q,PQ,DP1,DQ1) of the key are set, the key is initialized and ready for use.
See Also:RSAPrivateKey , RSAPublicKey , KeyBuilder , Signature , javacardx.crypto.Cipher , javacardx.crypto.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 |
---|
void setP(byte[] buffer, short offset, short length) throws CryptoException
Sets the value of the P parameter.
The plain text data format is big-endian and right-aligned (the least significant bit is the least significant
bit of last byte). Input P parameter data is copied into the internal representation.
Note:
Parameters:buffer - the input buffer
offset - the offset into the input buffer at which the parameter value begins
length - the length of the parameter
Throws:
CryptoException - with the following reason code:
void setQ(byte[] buffer, short offset, short length) throws CryptoException
Sets the value of the Q parameter.
The plain text data format is big-endian and right-aligned (the least significant bit is the least significant
bit of last byte). Input Q parameter data is copied into the internal representation.
Note:
Parameters:buffer - the input buffer
offset - the offset into the input buffer at which the parameter value begins
length - the length of the parameter
Throws:
CryptoException - with the following reason code:
void setDP1(byte[] buffer, short offset, short length) throws CryptoException
Sets the value of the DP1 parameter.
The plain text data format is big-endian and right-aligned (the least significant bit is the least significant
bit of last byte). Input DP1 parameter data is copied into the internal representation.
Note:
Parameters:buffer - the input buffer
offset - the offset into the input buffer at which the parameter value begins
length - the length of the parameter
Throws:
CryptoException - with the following reason code:
void setDQ1(byte[] buffer, short offset, short length) throws CryptoException
Sets the value of the DQ1 parameter.
The plain text data format is big-endian and right-aligned (the least significant bit is the least significant
bit of last byte). Input DQ1 parameter data is copied into the internal representation.
Note:
Parameters:buffer - the input buffer
offset - the offset into the input buffer at which the parameter value begins
length - the length of the parameter
Throws:
CryptoException - with the following reason code:
void setPQ(byte[] buffer, short offset, short length) throws CryptoException
Sets the value of the PQ parameter.
The plain text data format is big-endian and right-aligned (the least significant bit is the least significant
bit of last byte). Input PQ parameter data is copied into the internal representation.
Note:
Parameters:buffer - the input buffer
offset - the offset into the input buffer at which the parameter value begins
length - the length of the parameter
Throws:
CryptoException - with the following reason code:
short getP(byte[] buffer, short offset)
Returns the value of the P parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).
Parameters:buffer - the output buffer
offset - the offset into the output buffer at which the parameter value begins
Returns:the byte length of the P parameter value returned
Throws:
CryptoException - with the following reason code:
See Also:Key
short getQ(byte[] buffer, short offset)
Returns the value of the Q parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).
Parameters:buffer - the output buffer
offset - the offset into the output buffer at which the parameter value begins
Returns:the byte length of the Q parameter value returned
Throws:
CryptoException - with the following reason code:
See Also:Key
short getDP1(byte[] buffer, short offset)
Returns the value of the DP1 parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).
Parameters:buffer - the output buffer
offset - the offset into the output buffer at which the parameter value begins
Returns:the byte length of the DP1 parameter value returned
Throws:
CryptoException - with the following reason code:
See Also:Key
short getDQ1(byte[] buffer, short offset)
Returns the value of the DQ1 parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).
Parameters:buffer - the output buffer
offset - the offset into the output buffer at which the parameter value begins
Returns:the byte length of the DQ1 parameter value returned
Throws:
CryptoException - with the following reason code:
See Also:Key
short getPQ(byte[] buffer, short offset)
Returns the value of the PQ parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).
Parameters:buffer - the output buffer
offset - the offset into the output buffer at which the parameter value begins
Returns:the byte length of the PQ parameter value returned
Throws:
CryptoException - with the following reason code:
See Also:Key