Package org.wso2.carbon.crypto.api
Class CryptoContext
java.lang.Object
org.wso2.carbon.crypto.api.CryptoContext
The class which encapsulated information which is used to find out the correct keys for crypto operations.
The context will be interpreted by applicable
KeyResolver implementations.-
Constructor Summary
ConstructorsConstructorDescriptionCryptoContext(int tenantId, String tenantDomain, String type, String identifier, String purpose, Map<String, String> properties) The constructor which accepts all the needed information to create aCryptoContext. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(String propertyName, String propertyValue) Adds the given context property value against the given property name.static CryptoContextbuildEmptyContext(int tenantId, String tenantDomain) Creates and returns aCryptoContextwhich has no attribute values other than the tenant information.getProperty(String propertyName) Returns the context property which has given property name.intgetType()toString()
-
Constructor Details
-
CryptoContext
public CryptoContext(int tenantId, String tenantDomain, String type, String identifier, String purpose, Map<String, String> properties) The constructor which accepts all the needed information to create aCryptoContext.- Parameters:
tenantId- ID of the tenant which the crypto operations are going to be performed on.tenantDomain- Name of the tenant which the crypto operations are going to be performed on.type- A name which denotes the type of the context. e.g. SERVICE-PROVIDERidentifier- An identifier of the context if there is any. e.g. service provider idpurpose- The purpose of the crypto operations.properties- An arbitrary map of context properties.
-
-
Method Details
-
buildEmptyContext
Creates and returns aCryptoContextwhich has no attribute values other than the tenant information.This is a convenience method to create a context with minimal information.
- Parameters:
tenantId-tenantDomain-- Returns:
-
getTenantId
public int getTenantId() -
getTenantDomain
-
getType
-
getIdentifier
-
getPurpose
-
addProperty
Adds the given context property value against the given property name. These properties will be interpreted by the applicableKeyResolver- Parameters:
propertyName- Name of the propertypropertyValue- Value of the property
-
getProperty
Returns the context property which has given property name.- Parameters:
propertyName- Property name- Returns:
- The context property which has the given name.
-
toString
-