public interface DHKey
DHPrivateKey interface
methods. A DH public key implementation must also implement the DHPublicKey
interface methods.
Component Q is an optional key component. When the other 3 components of the key (X or Y, P, G) are set, the key is initialized and ready for use.
| Modifier and Type | Method and Description |
|---|---|
short |
getG(byte[] buffer,
short offset)
Returns the base parameter value of the key in plain text.
|
short |
getP(byte[] buffer,
short offset)
Returns the prime parameter value of the key in plain text.
|
short |
getQ(byte[] buffer,
short offset)
Returns the subprime parameter value of the key in plain text.
|
void |
setG(byte[] buffer,
short offset,
short length)
Sets the base parameter value of the key.
|
void |
setP(byte[] buffer,
short offset,
short length)
Sets the prime parameter value of the key.
|
void |
setQ(byte[] buffer,
short offset,
short length)
Sets the optional subprime parameter value of the key.
|
void 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 prime parameter value is decrypted using the Cipher object.
buffer - the input bufferoffset - the offset into the input buffer at which the prime parameter
value beginslength - the length of the prime parameter valueCryptoException - 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 subprime parameter value is decrypted using the Cipher object.
buffer - the input bufferoffset - the offset into the input buffer at which the subprime
parameter value beginslength - the length of the subprime parameter valueCryptoException - 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 setG(byte[] buffer,
short offset,
short length)
throws CryptoException
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher object specified via setKeyCipher()
is not null, the base parameter value is decrypted using the Cipher object.
buffer - the input bufferoffset - the offset into the input buffer at which the base parameter
value beginslength - the length of the base parameter valueCryptoException - 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 prime parameter
value startsCryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if
the prime 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 subprime
parameter value beginsCryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if
the subprime parameter has not been successfully
initialized since the time the initialized state of the
key was set to false.
Keyshort getG(byte[] buffer,
short offset)
buffer - the output bufferoffset - the offset into the output buffer at which the base parameter
value beginsCryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if
the base 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.