26
Cryptographic Smart Card Driver Development Guide
* @param input Input data.
* @param inputOffset First byte of the input data to read.
* @param output Buffer for the output data.
* @param outputOffset Position in the output buffer to receive the first written byte.
*
* @throws CryptoTokenException Thrown if an error occurs with a crypto
* token or the crypto token is invalid.
*/
public void decryptRSA( RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData,byte[] input, int inputOffset,
byte[] output, int outputOffset )throws CryptoTokenException
{
try {
signDecryptHelper( cryptoSystem, privateKeyData, input, inputOffset, output,
outputOffset, DECRYPT_DESC, SmartCardSession.DECRYPT_OPERATION );
}
catch ( CryptoUnsupportedOperationException e ) {
throw new CryptoTokenException( e.toString() );
}
}
/**
* Perform RSA signing of unprocessed data.
*
* <p>
* Notes: The RSA Crypto token should perform a raw RSA private key operation on the
* input data. The input data is typically padded, with the type of padding dependent on
* the application that requested the signature. Typically Public-Key Cryptography
Standards (PKCS) #1 version 2.0
* is used to pad the data, however other schemes such as Probabilistic Signature Scheme
(PSS) or ANSI X9.31 could also
* be used.
*
* If the RSA Crypto token requires the padding to be removed before signing, this method
* will need to detect and remove the type of padding that is currently used. The RSA
* Crypto token should only re-apply the same type of padding that was originally applied
* to the data. If the RSA Crypto token is unable to re-apply the same type of padding,
* this method should throw an UnsupportedOperationException.
* Signature requests which come from BlackBerry's S/MIME implementation currently use
* Public-Key Cryptography Standards (PKCS) #1 padding but may use other padding methods
in the future.
* <p>
* @param cryptoSystem Cypto system associated with the token.
* @param privateKeyData RSA private key.
* @param input Input data.
* @param inputOffset First byte of the input data to read.
* @param output The buffer for the output data.
* @param outputOffset Position in the output buffer to receive the first written byte.
* @throws CryptoTokenException Thrown if an error occurs with the crypto
* token or the crypto token is invalid.
* @throws 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.
*/
public void signRSA( RSACryptoSystem cryptoSystem, CryptoTokenPrivateKeyData
privateKeyData, byte[] input, int inputOffset,byte[] output, int outputOffset )
throws CryptoTokenException, CryptoUnsupportedOperationException
Содержание JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE
Страница 4: ......
Страница 6: ......
Страница 14: ...10 Cryptographic Smart Card Driver Development Guide...
Страница 17: ...13 2 Testing a cryptographic smart card driver...
Страница 18: ...14 Cryptographic Smart Card Driver Development Guide...
Страница 34: ...30 Cryptographic Smart Card Driver Development Guide...
Страница 35: ......
Страница 36: ...2007 Research In Motion Limited Published in Canada...