Blackberry Java Development Environment 4.6.0 매뉴얼 - 페이지 29

{카테고리_이름} Blackberry Java Development Environment 4.6.0에 대한 매뉴얼을 온라인으로 검색하거나 PDF를 다운로드하세요. Blackberry Java Development Environment 4.6.0 36 페이지. 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