public interface RSAPrivateCrtKey extends PrivateKey
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:
When all five components (P,Q,PQ,DP1,DQ1) of the key are set, the key is initialized and ready for use.
| Modifier and Type | Method and Description |
|---|---|
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.
|
clearKey, getSize, getType, isInitializedvoid setP(byte[] buffer,
short offset,
short length)
throws CryptoException
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.
buffer - the input bufferoffset - the offset into the input buffer at which the parameter value
beginslength - the length of the parameterCryptoException - with the following reason code:
CryptoException.ILLEGAL_VALUE if the
input parameter data length is inconsistent with the
implementation or if input data decryption is required and
fails.
void setQ(byte[] buffer,
short offset,
short length)
throws CryptoException
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.
buffer - the input bufferoffset - the offset into the input buffer at which the parameter value
beginslength - the length of the parameterCryptoException - with the following reason code:
CryptoException.ILLEGAL_VALUE if the
input parameter data length is inconsistent with the
implementation or if input data decryption is required and
fails.
void setDP1(byte[] buffer,
short offset,
short length)
throws CryptoException
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.
buffer - the input bufferoffset - the offset into the input buffer at which the parameter value
beginslength - the length of the parameterCryptoException - with the following reason code:
CryptoException.ILLEGAL_VALUE if the
input parameter data length is inconsistent with the
implementation or if input data decryption is required and
fails.
void setDQ1(byte[] buffer,
short offset,
short length)
throws CryptoException
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.
buffer - the input bufferoffset - the offset into the input buffer at which the parameter value
beginslength - the length of the parameterCryptoException - with the following reason code:
CryptoException.ILLEGAL_VALUE if the
input parameter data length is inconsistent with the
implementation or if input data decryption is required and
fails.
void setPQ(byte[] buffer,
short offset,
short length)
throws CryptoException
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.
buffer - the input bufferoffset - the offset into the input buffer at which the parameter value
beginslength - the length of the parameterCryptoException - with the following reason code:
CryptoException.ILLEGAL_VALUE if the
input parameter data length is inconsistent with the
implementation or if input data decryption is required and
fails.
short getP(byte[] buffer,
short offset)
buffer - the output bufferoffset - the offset into the output buffer at which the parameter value
beginsCryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if
the value of P parameter has not been successfully
initialized since the time the initialized state of the
key was set to false.
Keyshort getQ(byte[] buffer,
short offset)
buffer - the output bufferoffset - the offset into the output buffer at which the parameter value
beginsCryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if
the value of Q parameter has not been successfully
initialized since the time the initialized state of the
key was set to false.
Keyshort getDP1(byte[] buffer,
short offset)
buffer - the output bufferoffset - the offset into the output buffer at which the parameter value
beginsCryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if
the value of DP1 parameter has not been successfully
initialized since the time the initialized state of the
key was set to false.
Keyshort getDQ1(byte[] buffer,
short offset)
buffer - the output bufferoffset - the offset into the output buffer at which the parameter value
beginsCryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if
the value of DQ1 parameter has not been successfully
initialized since the time the initialized state of the
key was set to false.
Keyshort getPQ(byte[] buffer,
short offset)
buffer - the output bufferoffset - the offset into the output buffer at which the parameter value
beginsCryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if
the value of PQ parameter has not been successfully
initialized since the time the initialized state of the
key was set to false.
KeyCopyright © 1998, 2015, Oracle and/or its affiliates. All rights reserved.