javacard.security
Interface RSAPrivateCrtKey

All Superinterfaces:
Key, PrivateKey

public interface RSAPrivateCrtKey
extends PrivateKey

The 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.

See Also:
RSAPrivateKey

Method Summary
 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.
 
Methods inherited from interface javacard.security.Key
clearKey, getSize, getType, isInitialized
 

Method Detail

setQ

public void setQ(byte[] buffer,
                 short offset,
                 short length)
          throws CryptoException
Sets the value of the Q parameter. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input Q parameter data is copied into the internal representation.

Note:

Throws:
CryptoException

setPQ

public void setPQ(byte[] buffer,
                  short offset,
                  short length)
           throws CryptoException
Sets the value of the PQ parameter. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input PQ parameter data is copied into the internal representation.

Note:

Throws:
CryptoException

getDP1

public short getDP1(byte[] buffer,
                    short offset)
Returns the value of the DP1 parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).


getP

public short getP(byte[] buffer,
                  short offset)
Returns the value of the P parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).


setDP1

public void setDP1(byte[] buffer,
                   short offset,
                   short length)
            throws CryptoException
Sets the value of the DP1 parameter. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input DP1 parameter data is copied into the internal representation.

Note:

Throws:
CryptoException

getDQ1

public short getDQ1(byte[] buffer,
                    short offset)
Returns the value of the DQ1 parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).


getQ

public short getQ(byte[] buffer,
                  short offset)
Returns the value of the Q parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).


setDQ1

public void setDQ1(byte[] buffer,
                   short offset,
                   short length)
            throws CryptoException
Sets the value of the DQ1 parameter. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input DQ1 parameter data is copied into the internal representation.

Note:

Throws:
CryptoException

getPQ

public short getPQ(byte[] buffer,
                   short offset)
Returns the value of the PQ parameter in plain text. The data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte).


setP

public void setP(byte[] buffer,
                 short offset,
                 short length)
          throws CryptoException
Sets the value of the P parameter. The plain text data format is big-endian and right-aligned (the least significant bit is the least significant bit of last byte). Input P parameter data is copied into the internal representation.

Note:

Throws:
CryptoException


Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.