Class Overview
This class provide API's extended from KeyPairGeneratorSpi.
If vendor want to support KeyPairGenerator as JCE, plugin application should implement this Spi and add as Service Provider.
Summary
Public Methods |
Bundle
|
getProperty()
API to get the properties set by UCM framework during SPI call.
|
void
|
initialize(int keysize, SecureRandom random)
Standard KeyPairGenerator API.
|
void
|
setErrorCode(int error)
API to set the error code(if any) which will be forwarded to calling application via UCM framework.
|
Public Constructors
public
UcmAgentKeyPairGeneratorSpi
()
Public Methods
public
Bundle
getProperty
()
API to get the properties set by UCM framework during SPI call.
Returns
- Bundle Bundle calling applicaiton information
Usage
To perform crypto operation properly, plugin application should know caller information.
Plugin application can use this API to get caller user Id, resource Id, caller application Uid and owner Id
public class SimpleUcmAgentKeyPairGeneratorSpi extends UcmAgentProviderImpl.UcmAgentKeyPairGeneratorSpi {
public SimpleUcmAgentKeyPairGeneratorSpi(Context ctx, String algorithm) {
Bundle bundle = getProperty();
int userId = bundle.getInt(UcmAgentSpiProperty.KEY_USER_ID, -1));
int resourceId = bundle.getInt(UcmAgentSpiProperty.KEY_RESOURCE_ID , -1));
int callerId = bundle.getInt(UcmAgentSpiProperty.KEY_CALLER_UID , -1));
}
}
|
public
void
initialize
(int keysize, SecureRandom random)
Standard KeyPairGenerator API.
public
void
setErrorCode
(int error)
API to set the error code(if any) which will be forwarded to calling application via UCM framework.
public class SimpleUcmAgentKeyPairGeneratorSpi extends UcmAgentProviderImpl.UcmAgentKeyPairGeneratorSpi {
public void generateKeyPair() {
...
setErrorCode(UcmAgentService.ERROR_EMPTY_PARAMETER);
...
}
}