public static abstract class

UcmAgentProviderImpl.UcmAgentSignatureSpi

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

Class Overview

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

Since
API level 37
KNOX 3.10

Summary

[Expand]
Inherited Constants
From interface com.samsung.android.knox.ucm.plugin.agent.UcmAgentProviderImpl.UcmAgentSpiProperty
[Expand]
Inherited Fields
From class java.security.SignatureSpi
Public Constructors
UcmAgentSignatureSpi()
Public Methods
abstract void engineInitSign(PrivateKey privateKey)
Standard Signature API.
abstract byte[] engineSign()
Standard Signature API.
abstract void engineUpdate(byte[] b, int offset, int len)
Standard Signature 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.
Protected Methods
Object engineGetParameter(String params)
Standard Signature API.
void engineInitVerify(PublicKey publicKey)
Standard Signature API.
void engineSetParameter(String param, Object value)
Standard Signature API.
void engineUpdate(byte b)
Standard Signature API.
boolean engineVerify(byte[] sigBytes)
Standard Signature API.
[Expand]
Inherited Methods
From class java.security.SignatureSpi
From class java.lang.Object
From interface com.samsung.android.knox.ucm.plugin.agent.UcmAgentProviderImpl.UcmAgentSpiProperty

Public Constructors

public UcmAgentSignatureSpi ()

Since: API level 36

Public Methods

public abstract void engineInitSign (PrivateKey privateKey)

Since: API level 36

Standard Signature API.

Since
API level 37
KNOX 3.10

public abstract byte[] engineSign ()

Since: API level 36

Standard Signature API.

Since
API level 37
KNOX 3.10

public abstract void engineUpdate (byte[] b, int offset, int len)

Since: API level 36

Standard Signature API.

Since
API level 37
KNOX 3.10

public Bundle getProperty ()

Since: API level 36

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 SimpleUcmAgentSignatureSpi extends UcmAgentProviderImpl.UcmAgentSignatureSpi {
   public SimpleUcmAgentSignatureSpi(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 37
KNOX 3.10
Multiuser Environment
Global Scope

public void setErrorCode (int error)

Since: API level 36

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

 public class SimpleUcmAgentSignatureSpi extends UcmAgentProviderImpl.UcmAgentSignatureSpi {
   public void engineInitSign(PrivateKey privateKey, SecureRandom random) {
     ...
     setErrorCode(UcmAgentService.ERROR_EMPTY_PARAMETER);
     ...
   }
 }
 

Parameters
error Error code
Since
API level 37
KNOX 3.10
Multiuser Environment
Global Scope

Protected Methods

protected Object engineGetParameter (String params)

Since: API level 36

Standard Signature API.

Since
API level 37
KNOX 3.10

protected void engineInitVerify (PublicKey publicKey)

Since: API level 36

Standard Signature API.

Since
API level 37
KNOX 3.10

protected void engineSetParameter (String param, Object value)

Since: API level 36

Standard Signature API.

Since
API level 37
KNOX 3.10

protected void engineUpdate (byte b)

Since: API level 36

Standard Signature API.

Since
API level 37
KNOX 3.10

protected boolean engineVerify (byte[] sigBytes)

Since: API level 36

Standard Signature API.

Since
API level 37
KNOX 3.10