|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.crypto.RSACryptoToken
net.rim.device.api.crypto.SmartCardRSACryptoToken
public abstract class SmartCardRSACryptoToken
An interface for RSA cryptographic smart cards to implement. The RIM Crypto API will call this interface when a RSA operation is to be performed on a RSA enabled cryptographic smart card.
RSACryptoToken
Field Summary |
---|
Fields inherited from interface net.rim.device.api.crypto.AsymmetricCryptoToken |
---|
KEY_GENERATION, PRIVATE_KEY_OPERATION, PUBLIC_KEY_OPERATION |
Constructor Summary | ||
---|---|---|
|
protected |
SmartCardRSACryptoToken()
Deprecated. Creates a new SmartCardRSACryptoToken object. |
Method Summary | ||
---|---|---|
|
void |
decryptRSA(RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData,
byte[] input,
int inputOffset,
byte[] output,
int outputOffset)
Deprecated. Performs a raw RSA decryption operation. |
|
protected abstract void |
decryptRSASmartCardImpl(CryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData,
byte[] input,
int inputOffset,
byte[] output,
int outputOffset)
Deprecated. Performs a raw RSA decryption operation. |
|
boolean |
isSupportedDecryptRSA(RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData)
Deprecated. Returns a boolean that determines if the given key and crypto system support RSA encryption. |
|
protected abstract boolean |
isSupportedDecryptRSASmartCardImpl(CryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData)
Deprecated. Returns a boolean that determines if the given key and crypto system support RSA encryption. |
|
void |
signRSA(RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData,
byte[] input,
int inputOffset,
byte[] output,
int outputOffset)
Deprecated. Performs a raw RSA signature operation. |
|
protected abstract void |
signRSASmartCardImpl(CryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData,
byte[] input,
int inputOffset,
byte[] output,
int outputOffset)
Deprecated. Performs a raw RSA signature operation. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SmartCardRSACryptoToken()
SmartCardRSACryptoToken
object.
This constructor is not used.
Method Detail |
---|
public boolean isSupportedDecryptRSA(RSACryptoSystem cryptoSystem, CryptoTokenPrivateKeyData privateKeyData) throws CryptoTokenException
RSACryptoToken
isSupportedDecryptRSA
in class RSACryptoToken
cryptoSystem
- The crypto system to check.privateKeyData
- The private key data.
CryptoTokenException
- Thrown if an error occurs with a crypto
token or the crypto token is invalid.protected abstract boolean isSupportedDecryptRSASmartCardImpl(CryptoSystem cryptoSystem, CryptoTokenPrivateKeyData privateKeyData) throws CryptoTokenException
cryptoSystem
- The crypto system to check.privateKeyData
- The private key data.
CryptoTokenException
- Thrown if an error occurs with a crypto
token or the crypto token is invalid.RSACryptoToken.isSupportedDecryptRSA(net.rim.device.api.crypto.RSACryptoSystem, net.rim.device.api.crypto.CryptoTokenPrivateKeyData)
public void decryptRSA(RSACryptoSystem cryptoSystem, CryptoTokenPrivateKeyData privateKeyData, byte[] input, int inputOffset, byte[] output, int outputOffset) throws CryptoTokenException
RSACryptoToken
Notes: The token should do a raw RSA private key operation on the input data to reveal the plaintext bytes. The plaintext byes will typically be padded; the type of padding will depend on the application which encrypted the data. Typically PKCS #1 version 2.0 will be used for padding the data, but other schemes (such as OAEP) could be used. If the token removes the padding this method will need to re-add the same type of padding before returning. Data encrypted with BlackBerry's S/MIME implementation currently uses PKCS #1 padding but may use other padding methods in the future.
decryptRSA
in class RSACryptoToken
cryptoSystem
- The crypto system associated with the token.privateKeyData
- The RSA private key.input
- The input data.inputOffset
- The offset in the input data to begin reading from.output
- The buffer for the output data.outputOffset
- The offset in the output buffer to begin writing at.
CryptoTokenException
- Thrown if an error occurs with a crypto
token or the crypto token is invalid.protected abstract void decryptRSASmartCardImpl(CryptoSystem cryptoSystem, CryptoTokenPrivateKeyData privateKeyData, byte[] input, int inputOffset, byte[] output, int outputOffset) throws CryptoTokenException
Notes: The token should do a raw RSA private key operation on the input data to reveal the plaintext bytes. The plaintext byes will typically be padded; the type of padding will depend on the application which encrypted the data. Typically PKCS #1 version 2.0 will be used for padding the data, but other schemes (such as OAEP) could be used. If the token removes the padding this method will need to re-add the same type of padding before returning. Data encrypted with BlackBerry's S/MIME implementation currently uses PKCS #1 padding but may use other padding methods in the future.
cryptoSystem
- The crypto system associated with the token.privateKeyData
- The RSA private key.input
- The input data.inputOffset
- The offset in the input data to begin reading from.output
- The buffer for the output data.outputOffset
- The offset in the output buffer to begin writing at.
CryptoTokenException
- Thrown if an error occurs with a crypto
token or the crypto token is invalid.RSACryptoToken.decryptRSA(net.rim.device.api.crypto.RSACryptoSystem, net.rim.device.api.crypto.CryptoTokenPrivateKeyData, byte[], int, byte[], int)
public void signRSA(RSACryptoSystem cryptoSystem, CryptoTokenPrivateKeyData privateKeyData, byte[] input, int inputOffset, byte[] output, int outputOffset) throws CryptoTokenException, CryptoUnsupportedOperationException
RSACryptoToken
Notes: The token should do a raw RSA private key operation on the input data. The input data will typically be padded; the type of padding will depend on the application requesting the signature. Typically PKCS #1 version 2.0 will be used for padding the data, but other schemes (such as PSS or ANSI X9.31) could be used. If the token requires that the padding be removed before signing, this method will need to detect the type of padding currently being used and remove it. The token should only re-apply the same type of padding which was originally applied to the data. If the token is unable to re-apply the same type of padding an UnsupportedOperationException should be thrown. Signature requests which come from BlackBerry's S/MIME implementation currently use PKCS #1 padding but may use other padding methods in the future.
signRSA
in class RSACryptoToken
cryptoSystem
- The crypto system associated with the token.privateKeyData
- The RSA private key.input
- The input data.inputOffset
- The offset in the input data to begin reading from.output
- The buffer for the output data.outputOffset
- The offset in the output buffer to begin writing at.
CryptoTokenException
- Thrown if an error occurs with the crypto
token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown if a call is made to an unsupported operation
or if the token does not support signing due to the type of padding around the encoded message.protected abstract void signRSASmartCardImpl(CryptoSystem cryptoSystem, CryptoTokenPrivateKeyData privateKeyData, byte[] input, int inputOffset, byte[] output, int outputOffset) throws CryptoTokenException, CryptoUnsupportedOperationException
Notes: The token should do a raw RSA private key operation on the input data. The input data will typically be padded; the type of padding will depend on the application requesting the signature. Typically PKCS #1 version 2.0 will be used for padding the data, but other schemes (such as PSS or ANSI X9.31) could be used. If the token requires that the padding be removed before signing, this method will need to detect the type of padding currently being used and remove it. The token should only re-apply the same type of padding which was originally applied to the data. If the token is unable to re-apply the same type of padding an UnsupportedOperationException should be thrown. Signature requests which come from BlackBerry's S/MIME implementation currently use PKCS #1 padding but may use other padding methods in the future.
cryptoSystem
- The crypto system associated with the token.privateKeyData
- The RSA private key.input
- The input data.inputOffset
- The offset in the input data to begin reading from.output
- The buffer for the output data.outputOffset
- The offset in the output buffer to begin writing at.
CryptoTokenException
- Thrown if an error occurs with the crypto
token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown if a call is made to an unsupported operation
or if the token does not support signing due to the type of padding around the encoded message.RSACryptoToken.signRSA(net.rim.device.api.crypto.RSACryptoSystem, net.rim.device.api.crypto.CryptoTokenPrivateKeyData, byte[], int, byte[], int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal