Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Podręcznik - Strona 29
Przeglądaj online lub pobierz pdf Podręcznik dla Oprogramowanie Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE. Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE 36 stron. Cryptographic smart card driver
/**
* Determine if this token supports the chosen operation using the provided system.
*
* @param cryptoSystem Crypto System to check against.
* @param operation Operation to check: either KEY_GENERATION,
* PUBLIC_KEY_OPERATION, PRIVATE_KEY_OPERATION,* or some other value
* specific to the crypto system that indicates the operation to check.
*/
public boolean isSupported( CryptoSystem cryptoSystem, int operation )
{
return ( operation == PRIVATE_KEY_OPERATION );
}
/**
* Determines if the given key and crypto system
* support RSA encryption.
*
* @return True if the token supports RSA encryption.
*
* @param cryptoSystem Crypto system to check.
* @param privateKeyData Private key data.
*
* @throws CryptoTokenException If an error occurs with a crypto
* token or the crypto token is invalid.
*/
public boolean isSupportedDecryptRSA( RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData )throws CryptoTokenException
{
return privateKeyData instanceof MyCryptoTokenData;
}
/**
* Perform RSA decryption of unprocessed data.
*
* <p>
* Notes: To reveal the plaintext bytes, the RSACryptoToken should perform a raw RSA
* private key operation on the input data.
* The plaintext bytes are typically padded with the type of padding dependent on the
* application that encrypted the data.
*
* Typically Public-Key Cryptography Standards (PKCS) #1 version 2.0 is used to pad the
data, however other schemes
* such as OAEP can also be used.
*
* If the RSACryptoToken removes the padding in the input data, this method must re-add
* the same type of padding before the method completes its operations.
*
* Data encrypted using the BlackBerry S/MIME implementation currently uses Public-Key
Cryptography Standards (PKCS) #1
* padding but may use other padding methods in the future.
* <p>
*
* @param cryptoSystem Crypto system associated with the token.
* @param privateKeyData RSA private key.
3: Code samples
25