Java Card 2.1 Platform
Final Revision 1.0

javacard.security
Interface DSAPublicKey


public abstract interface DSAPublicKey
extends PublicKey, DSAKey

The DSAPublicKey interface is used to verify signatures on signed data using the DSA algorithm. An implementation of DSAPublicKey interface must also implement the DSAKey interface methods.

When all four components of the key (Y,P,Q,G) are set, the key is initialized and ready for use.

See Also:
DSAPrivateKey, KeyBuilder, Signature, KeyEncryption

Method Summary
 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.DSAKey
getG, getP, getQ, setG, setP, setQ
 
Methods inherited from interface javacard.security.Key
clearKey, getSize, getType, isInitialized
 

Method Detail

setY

public void setY(byte[] buffer,
                 short offset,
                 short length)
          throws CryptoException
Sets the value of the key. When the base, prime and subprime parameters are intialized and the key value is set, the key is ready for use. The plaintext 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.
Parameters:
buffer - the input buffer
offset - the offset into the input buffer at which the key value begins
length - 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.

Note:

  • If the key object implements the javacardx.crypto.KeyEncryption interface and the Cipher object specified via setKeyCipher() is not null, the key value is decrypted using the Cipher object.

getY

public 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 buffer
offset - the offset into the input buffer at which the key value starts
Returns:
the byte length of the key value returned

Submit a bug or feature

Java and Java Card are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
All Rights Reserved.