Package javacard.security
Interface DHPublicKey
-
public interface DHPublicKey extends PublicKey, DHKey
TheDHPublicKey
interface is used to verify signatures on signed data using the DH algorithm. An implementation ofDHPublicKey
interface must also implement theDHKey
interface methods.When all three components of the key (Y, P, G) are set, the key is initialized and ready for use.
- See Also:
DHPrivateKey
,KeyBuilder
,Signature
,javacardx.crypto.KeyEncryption
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description short
getY(byte[] buffer, short offset)
Returns the value of the key in plain text.void
setY(byte[] buffer, short offset, short length)
Sets the value of the key.-
Methods inherited from interface javacard.security.Key
clearKey, getSize, getType, isInitialized
-
-
-
-
Method Detail
-
setY
void setY(byte[] buffer, short offset, short length) throws CryptoException
Sets the value of the key. When the base, prime and subprime parameters are initialized and the key value is set, the key is ready for use. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input key data is copied into the internal representation.Note:
- If the key object implements the
javacardx.crypto.KeyEncryption
interface and theCipher
object specified viasetKeyCipher()
is notnull
, the key value is decrypted using theCipher
object.
- Parameters:
buffer
- the input bufferoffset
- the offset into the input buffer at which the key value beginslength
- the length of the key value- Throws:
CryptoException
- with the following reason code:CryptoException.ILLEGAL_VALUE
if the input key data length is inconsistent with the implementation or if input data decryption is required and fails.
- If the key object implements the
-
getY
short getY(byte[] buffer, short offset)
Returns the value of the key 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 bufferoffset
- the offset into the input buffer at which the key value starts- Returns:
- the byte length of the key value returned
- Throws:
CryptoException
- with the following reason code:CryptoException.UNINITIALIZED_KEY
if the value of the key has not been successfully initialized since the time the initialized state of the key was set to false.
- See Also:
Key
-
-