| java.lang.Object com.sun.midp.crypto.RSAKey
All known Subclasses: com.sun.midp.crypto.RSAPublicKey, com.sun.midp.crypto.RSAPrivateKey,
RSAKey | class RSAKey implements Key(Code) | | Implements RSAKey with methods to set and get RSA exponent
and modulus.
|
Field Summary | |
byte[] | exp Local variable to hold the exponent. | byte[] | mod The number of bytes allocated to the modulus
is always a multiple of 8. |
Constructor Summary | |
| RSAKey(byte[] modulus, int modOffset, int modLen, byte[] exponent, int expOffset, int expLen) Constructor for RSA public key. |
Method Summary | |
public boolean | equals(RSAPrivateKey k) Compare the current key as a RSA private key. | public boolean | equals(RSAPublicKey k) Compare the current key as a RSA public key. | public boolean | equals(RSAKey k) Compare the current key as a generic RSA key. | public String | getAlgorithm() Gets the type of the current key. | public byte[] | getEncoded() Returns the encoding of key. | public short | getExponent(byte[] buf, short off) Get the exponent for the key. | public String | getFormat() Returns the name of the encoding format for this key. | public short | getModulus(byte[] buf, short off) Get the modulus for the key. | public int | getModulusLen() Get the length of modulus for the key. | public String | toString() Convert the key to a readable string. |
exp | byte[] exp(Code) | | Local variable to hold the exponent.
|
mod | byte[] mod(Code) | | The number of bytes allocated to the modulus
is always a multiple of 8.
|
RSAKey | RSAKey(byte[] modulus, int modOffset, int modLen, byte[] exponent, int expOffset, int expLen)(Code) | | Constructor for RSA public key.
Parameters: modulus - modulus of key to process Parameters: modOffset - offset of the modulus Parameters: modLen - length of modulus in bytes Parameters: exponent - exponent the key Parameters: expOffset - offset of the exponent Parameters: expLen - length of the exponent in bytes |
equals | public boolean equals(RSAPrivateKey k)(Code) | | Compare the current key as a RSA private key.
Parameters: k - the key to compare true if the kesy are the same. |
equals | public boolean equals(RSAPublicKey k)(Code) | | Compare the current key as a RSA public key.
Parameters: k - the key to compare true if the keys are the same. |
equals | public boolean equals(RSAKey k)(Code) | | Compare the current key as a generic RSA key.
Parameters: k - the key to compare true if the keys are the same. |
getAlgorithm | public String getAlgorithm()(Code) | | Gets the type of the current key.
the type of the key |
getEncoded | public byte[] getEncoded()(Code) | | Returns the encoding of key.
null because there is no encoding |
getExponent | public short getExponent(byte[] buf, short off)(Code) | | Get the exponent for the key.
Parameters: buf - output buffer to hold the exponent Parameters: off - offset in the buffer to copy the exponent length of the data copied |
getFormat | public String getFormat()(Code) | | Returns the name of the encoding format for this key.
the string "RAW". |
getModulus | public short getModulus(byte[] buf, short off)(Code) | | Get the modulus for the key.
Parameters: buf - output buffer to hold the modulus Parameters: off - offset in the buffer to copy the modulus length of the data copied See Also: RSAKey.setModulus |
getModulusLen | public int getModulusLen()(Code) | | Get the length of modulus for the key.
length of the modulus in bytes |
toString | public String toString()(Code) | | Convert the key to a readable string.
string representation of key |
|
|