public abstract class AbstractProtocolAttributeEncoder extends java.lang.Object implements ProtocolAttributeEncoder
Modifier and Type | Field and Description |
---|---|
protected ServicesManager |
servicesManager
The Services manager.
|
Constructor and Description |
---|
AbstractProtocolAttributeEncoder(ServicesManager servicesManager)
Instantiates a new attribute encoder with the default
cipher as
DefaultRegisteredServiceCipherExecutor . |
AbstractProtocolAttributeEncoder(ServicesManager servicesManager,
RegisteredServiceCipherExecutor cipherExecutor)
Instantiates a new Abstract cas attribute encoder.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
encodeAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes,
RegisteredService registeredService)
Encodes attributes that are ready to be released.
|
protected abstract void |
encodeAttributesInternal(java.util.Map<java.lang.String,java.lang.Object> attributes,
java.util.Map<java.lang.String,java.lang.String> cachedAttributesToEncode,
RegisteredServiceCipherExecutor cipher,
RegisteredService registeredService)
Initialize the cipher with the public key
and then start to encrypt select attributes.
|
protected java.util.Map<java.lang.String,java.lang.String> |
initialize(java.util.Map<java.lang.String,java.lang.Object> attributes)
Initialize the encoding process.
|
void |
setCipherExecutor(RegisteredServiceCipherExecutor cipherExecutor) |
protected ServicesManager servicesManager
public AbstractProtocolAttributeEncoder(ServicesManager servicesManager)
DefaultRegisteredServiceCipherExecutor
.servicesManager
- the services managerpublic AbstractProtocolAttributeEncoder(ServicesManager servicesManager, RegisteredServiceCipherExecutor cipherExecutor)
servicesManager
- the services managercipherExecutor
- the cipher executorpublic java.util.Map<java.lang.String,java.lang.Object> encodeAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes, RegisteredService registeredService)
ProtocolAttributeEncoder
encodeAttributes
in interface ProtocolAttributeEncoder
attributes
- The attribute collection that is ready to be releasedregisteredService
- the requesting service for which attributes are to be encodedprotected abstract void encodeAttributesInternal(java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.String,java.lang.String> cachedAttributesToEncode, RegisteredServiceCipherExecutor cipher, RegisteredService registeredService)
attributes
- the attributescachedAttributesToEncode
- the cached attributes to encodecipher
- the cipher object initialized per service public keyregisteredService
- the registered serviceprotected java.util.Map<java.lang.String,java.lang.String> initialize(java.util.Map<java.lang.String,java.lang.Object> attributes)
CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL
and
CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET
from the authentication attributes originally and into a cache object, so it
can later on be encrypted if needed.attributes
- the new encoded attributespublic void setCipherExecutor(RegisteredServiceCipherExecutor cipherExecutor)