Since: API level 20
public static abstract class

UcmAgentProviderImpl.UcmAgentKeyStoreSpi

extends KeyStoreSpi
implements UcmAgentProviderImpl.UcmAgentSpiProperty
java.lang.Object
   ↳ java.security.KeyStoreSpi
     ↳ com.samsung.android.knox.ucm.plugin.agent.UcmAgentProviderImpl.UcmAgentKeyStoreSpi

Class Overview

This class provide API's extended from KeyStoreSpi. If vendor want to support KeyStore as JCE, plugin application should implement this Spi and add as Service Provider.

Since
API level 20
KNOX 2.7

Summary

[Expand]
Inherited Constants
From interface com.samsung.android.knox.ucm.plugin.agent.UcmAgentProviderImpl.UcmAgentSpiProperty
Public Constructors
UcmAgentKeyStoreSpi()
Public Methods
String engineGetCertificateAlias(Certificate cert)
Standard KeyStore API.
Date engineGetCreationDate(String alias)
Standard KeyStore API.
abstract void engineLoad(KeyStore.LoadStoreParameter param)
Standard KeyStore API.
abstract void engineLoad(InputStream stream, char[] password)
Standard KeyStore API.
void engineSetCertificateEntry(String alias, Certificate cert)
Standard KeyStore API.
abstract void engineSetEntry(String alias, KeyStore.Entry entry, KeyStore.ProtectionParameter protParam)
Standard KeyStore API.
void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain)
Standard KeyStore API.
void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain)
Standard KeyStore API.
void engineStore(OutputStream stream, char[] password)
Standard KeyStore API.
Bundle getProperty()
API to get the properties set by UCM framework during SPI call.
void setErrorCode(int error)
API to set the error code(if any) which will be forwarded to calling application via UCM framework.
[Expand]
Inherited Methods
From class java.security.KeyStoreSpi
From class java.lang.Object
From interface com.samsung.android.knox.ucm.plugin.agent.UcmAgentProviderImpl.UcmAgentSpiProperty

Public Constructors

public UcmAgentKeyStoreSpi ()

Since: API level 20

Public Methods

public String engineGetCertificateAlias (Certificate cert)

Since: API level 20

Standard KeyStore API.

Since
API level 20
KNOX 2.7

public Date engineGetCreationDate (String alias)

Since: API level 20

Standard KeyStore API.

Since
API level 20
KNOX 2.7

public abstract void engineLoad (KeyStore.LoadStoreParameter param)

Since: API level 20

Standard KeyStore API.

Since
API level 20
KNOX 2.7

public abstract void engineLoad (InputStream stream, char[] password)

Since: API level 20

Standard KeyStore API.

Since
API level 20
KNOX 2.7

public void engineSetCertificateEntry (String alias, Certificate cert)

Since: API level 20

Standard KeyStore API.

Since
API level 20
KNOX 2.7

public abstract void engineSetEntry (String alias, KeyStore.Entry entry, KeyStore.ProtectionParameter protParam)

Since: API level 20

Standard KeyStore API.

Since
API level 20
KNOX 2.7

public void engineSetKeyEntry (String alias, Key key, char[] password, Certificate[] chain)

Since: API level 20

Standard KeyStore API.

Since
API level 20
KNOX 2.7

public void engineSetKeyEntry (String alias, byte[] key, Certificate[] chain)

Since: API level 20

Standard KeyStore API.

Since
API level 20
KNOX 2.7

public void engineStore (OutputStream stream, char[] password)

Since: API level 20

Standard KeyStore API.

Since
API level 20
KNOX 2.7

public Bundle getProperty ()

Since: API level 20

API to get the properties set by UCM framework during SPI call.

Returns
  • Bundle calling application 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 SimpleKeyStoreSpi extends UcmAgentProviderImpl.UcmAgentKeyStoreSpi {
   public SimpleKeyStoreSpi(Context ctx) {
     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));
   }
 }
 
Since
API level 20
KNOX 2.7
Multiuser Environment
Global Scope

public void setErrorCode (int error)

Since: API level 20

API to set the error code(if any) which will be forwarded to calling application via UCM framework.

 public class SimpleUcmAgentKeyStoreSpi extends UcmAgentProviderImpl.UcmAgentKeyStoreSpi {
   public void engineGetCertificateChain(String alias) {
       ...
       setErrorCode(UcmAgentService.ERROR_ALIAS_NOT_FOUND);
       ...
   }
 }
 

Parameters
error Error code
Since
API level 20
KNOX 2.7
Multiuser Environment
Global Scope