Blackberry Java Development Environment 4.6.0 Manuale - Pagina 11

Sfoglia online o scarica il pdf Manuale per Software Blackberry Java Development Environment 4.6.0. Blackberry Java Development Environment 4.6.0 36. Cryptographic smart card driver

Task
Determine if the token object and the
CryptoSystem
support the type of
encryption scheme.
Enable decryption of unprocessed data.
Steps
>
Perform one of the following steps:
To create a cryptographic smart card driver that is compatible with BlackBerry Device
Software Version 4.2 or later, create a method that returns a Boolean value that indicates if
the token object supports the specified encryption scheme.
public boolean isSupportedDecryptRSA(RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData)throws
CryptoTokenException
{
return privateKeyData instanceof MyCryptoTokenData;
}
To create a cryptographic smart card driver that is compatible with BlackBerry Device
Software Version 4.1 and Version 4.2 or later, and to include the cryptographic smart card
driver in two-factor authentication, create a method that returns a Boolean value that
indicates if the token object supports the specified encryption scheme.
public boolean isSupportedDecryptRSASmartCardImpl( CryptoSystem
cryptoSystem,CryptoTokenPrivateKeyData privateKeyData);
>
Perform one of the following steps:
To create a cryptographic smart card driver that is compatible with BlackBerry Device
Software Version 4.2 or later, create a method that performs decryption of unprocessed data,
for example:
public void decryptRSA(RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData,byte[] input, int
inputOffset,
byte[] output, int outputOffset)throws CryptoTokenException
{
try {//signDecryptHelper is a private helper method.
signDecryptHelper(cryptoSystem, privateKeyData, input, inputOffset,
output, outputOffset, DECRYPT_DESC,
SmartCardSession.DECRYPT_OPERATION);
}
catch (CryptoUnsupportedOperationException e) {
throw new CryptoTokenException(e.toString());
}
}
To create a cryptographic smart card driver that is compatible with BlackBerry Device
Software Version 4.1 and Version 4.2 or later, and to include the cryptographic smart card
driver in two-factor authentication, create a method that performs decryption of unprocessed
data, for example:
public void decryptRSASmartCardImplCryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData, byte[] input, int
inputOffset, byte[] output,int outputOffset)
1: Using smart cards
7