public interface RSAPrivateKey extends PrivateKey
RSAPrivateKey
class is used to sign data using the RSA
algorithm in its modulus/exponent form. It may also be used by the
javacardx.crypto.Cipher
class to encrypt/decrypt messages.
When both the modulus and exponent of the key are set, the key is initialized and ready for use.
Modifier and Type | Method and Description |
---|---|
short |
getExponent(byte[] buffer,
short offset)
Returns the private exponent value of the key in plain text.
|
short |
getModulus(byte[] buffer,
short offset)
Returns the modulus value of the key in plain text.
|
void |
setExponent(byte[] buffer,
short offset,
short length)
Sets the private exponent value of the key.
|
void |
setModulus(byte[] buffer,
short offset,
short length)
Sets the modulus value of the key.
|
clearKey, getSize, getType, isInitialized
void setModulus(byte[] buffer, short offset, short length) throws CryptoException
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the modulus value is decrypted using the Cipher
object.
buffer
- the input bufferoffset
- the offset into the input buffer at which the modulus value
beginslength
- the length of the modulusCryptoException
- with the following reason code:
CryptoException.ILLEGAL_VALUE
if the
input modulus data length is inconsistent with the
implementation or if input data decryption is required and
fails.
void setExponent(byte[] buffer, short offset, short length) throws CryptoException
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the exponent value is decrypted using the Cipher
object.
buffer
- the input bufferoffset
- the offset into the input buffer at which the exponent value
beginslength
- the length of the exponentCryptoException
- with the following reason code:
CryptoException.ILLEGAL_VALUE
if the
input exponent data length is inconsistent with the
implementation or if input data decryption is required and
fails.
short getModulus(byte[] buffer, short offset)
buffer
- the output bufferoffset
- the offset into the output buffer at which the modulus value
startsCryptoException
- with the following reason code:
CryptoException.UNINITIALIZED_KEY
if
the modulus value of the key has not been successfully
initialized since the time the initialized state of the
key was set to false.
Key
short getExponent(byte[] buffer, short offset)
buffer
- the output bufferoffset
- the offset into the output buffer at which the exponent value
beginsCryptoException
- with the following reason code:
CryptoException.UNINITIALIZED_KEY
if
the private exponent value of the key has not been
successfully initialized since the time the initialized
state of the key was set to false.
Key
Copyright © 1998, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms