Package jadex.platform.service.security
Class SecurityAgent
- java.lang.Object
- 
- jadex.platform.service.security.SecurityAgent
 
- 
- All Implemented Interfaces:
- IInternalService,- IService,- ISecurityService
 
 public class SecurityAgent extends java.lang.Object implements ISecurityService, IInternalService Agent that provides the security service.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classSecurityAgent.ReencryptRequestHandlerHandler dealing with remote reencryption requests.protected classSecurityAgent.SecurityMessageHandlerSecurity service message handler.
 - 
Field SummaryFields Modifier and Type Field Description protected booleanaddglobalnetworkFlag if the security should add a global network if no global network is set.protected IInternalAccessagentComponent access.protected java.util.Map<java.lang.String,java.lang.Class<?>>allowedcryptosuitesAvailable crypt suites.protected booleanallownoauthnameFlag if connection with platforms without authenticated names are allowed.protected booleanallownonetworkFlag if connection with platforms without authenticated networks are allowed.protected IFuture<java.lang.Void>cleanuptaskTask for cleanup duties.protected booleancreatedefaultnetworkFlag if the security should create a random default network if no network is set.protected IFuture<java.lang.Void>cryptoresetCrypto-Suite reset in progress.protected IRwMap<java.lang.String,ICryptoSuite>currentcryptosuitesCryptoSuites currently in use.protected java.util.Set<org.bouncycastle.cert.X509CertificateHolder>customnameauthoritiesCustom (non-Java default) trusted authorities for certifying platform names.protected booleandebugFlag enabling debug printouts.static java.lang.StringDEFAULT_GLOBAL_ROOT_CERTIFICATEDefault root certificate for global network.protected booleandefaultauthorizationFlag whether to grant default authorization (allow basic service calls if name, network or platform is authenticated).protected IExecutionFeatureexecfeatprotected MultiCollection<java.lang.String,Tuple2<ICryptoSuite,java.lang.Long>>expiringcryptosuitesCryptoSuites that are expiring with expiration time.static java.lang.StringGLOBAL_NETWORK_NAMEName of the global network.protected longhandshaketimeoutHandshake timeout.protected doublehandshaketimeoutscaleHandshake timeout scale factor.protected java.util.Map<java.lang.String,HandshakeState>initializingcryptosuitesCryptoSuites currently initializing, value=Handshake state.protected booleanloadjavatruststoreFlag whether to use the default Java trust store.protected java.util.Set<org.bouncycastle.cert.X509CertificateHolder>nameauthoritiesTrusted authorities for certifying platform names.protected java.util.Set<java.lang.String>networknamesThe list of network names (used by all service identifiers).protected MultiCollection<java.lang.String,AbstractAuthenticationSecret>networksAvailable virtual networks.protected AbstractX509PemSecretplatformnamecertificateThe platform name certificate if available.protected AbstractAuthenticationSecretplatformsecretLocal platform authentication secret.protected booleanprintsecretFlag whether the platform secret should be printed during start.static java.lang.StringPROPERTIES_IDProperties id for the settings service.protected booleanrefuseuntrustedFlag whether to refuse unauthenticated connections.protected java.util.Map<IComponentIdentifier,AbstractAuthenticationSecret>remoteplatformsecretsRemote platform authentication secrets.protected doubleresettimeoutscaleHandshake reset scale factor.protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>>rolesMap of entities and associated roles.protected static java.lang.StringSECURITY_MESSAGEHeader property for security messages.protected longsessionkeylifetimeLifetime of session keys, after which the handshake is repeated and a new session key is generated.protected java.util.Set<java.lang.String>trustedplatformsThe platform names that are trusted and identified by name.protected booleanusesecretFlag whether to use the platform secret for authentication.- 
Fields inherited from interface jadex.bridge.service.IServiceEMPTY_SERVICES
 
- 
 - 
Constructor SummaryConstructors Constructor Description SecurityAgent()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>addNameAuthority(java.lang.String pemcertificate)Adds an authority for authenticating platform names.IFuture<java.lang.Void>addRole(java.lang.String entity, java.lang.String role)Adds a role for an entity (platform or network name).IFuture<java.lang.Void>addTrustedPlatform(java.lang.String name)Adds a name of an authenticated platform to allow access.protected voidcheckCleanup()protected ICryptoSuitecreateCryptoSuite(java.lang.String name, java.lang.String convid, JadexVersion remoteversion, boolean initializer)Creates a crypto suite of a particular name.IFuture<Tuple2<ISecurityInfo,byte[]>>decryptAndAuth(IComponentIdentifier sender, byte[] content)Decrypt and authenticates the message from a sender.protected voiddoCleanup()Cleans expired objects.IFuture<byte[]>encryptAndSign(IMsgHeader header, byte[] content)Encrypts and signs the message for a receiver.protected voidexpireCryptosuite(java.lang.String pfname)Expires a cryptosuite.static java.util.List<Tuple2<java.lang.String,java.lang.String>>flattenRoleMap(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> rolemap)Helper for flattening the role map.IFuture<MultiCollection<java.lang.String,java.lang.String>>getAllKnownNetworks()Gets the current networks and secrets.IComponentIdentifiergetComponentIdentifier()Get component ID.IFuture<java.util.Set<java.lang.String>>getCustomNameAuthorities()Gets all authorities not defined in the Java trust store for authenticating platform names.booleangetInternalAllowNoAuthName()Checks whether to allow connections without name authentication.booleangetInternalAllowNoNetwork()Checks whether to allow connections without network authentication.booleangetInternalDefaultAuthorization()Checks whether to allow the default authorization.java.util.Set<org.bouncycastle.cert.X509CertificateHolder>getInternalNameAuthorities()Gets the name authorities.MultiCollection<java.lang.String,AbstractAuthenticationSecret>getInternalNetworks()Get access to the stored virtual network configurations.AbstractX509PemSecretgetInternalPlatformNameCertificate()Get the platform name certificate.AbstractAuthenticationSecretgetInternalPlatformSecret()Gets the local platform secret.AbstractAuthenticationSecretgetInternalPlatformSecret(IComponentIdentifier cid)Gets the secret of a platform if available.booleangetInternalRefuseUntrusted()Checks whether to allow untrusted connections.java.util.Set<java.lang.String>getInternalTrustedPlatforms()Gets the trusted platform names.booleangetInternalUsePlatformSecret()Checks whether to use platform secret.JadexVersiongetJadexVersion(IComponentIdentifier remoteid)Opportunistically returns the remote Jadex version if known.IFuture<MethodInfo[]>getMethodInfos()Get reflective info about the service methods, args, return types.IFuture<java.util.Set<java.lang.String>>getNameAuthorities()Adds an authority for authenticating platform names.IFuture<java.lang.String[][]>getNameAuthoritiesInfo()Get infos about name authorities.IFuture<java.util.Set<java.lang.String>>getNetworkNames()Gets the current network names.java.util.Set<java.lang.String>getNetworkNamesSync()Gets the current network names.IFuture<java.lang.String>getPlatformSecret(IComponentIdentifier cid)Gets the secret of a platform if available.protected static <T> TgetProperty(java.lang.String property, java.util.Map<java.lang.String,java.lang.Object> args, java.util.Map<java.lang.String,java.lang.Object> settings, T defaultprop)Gets the right property from arguments, settings and default.java.util.Map<java.lang.String,java.lang.Object>getPropertyMap()Get the map of properties (considered as constant).IFuture<java.util.Map<java.lang.String,java.util.Set<java.lang.String>>>getRoleMap()Gets a copy of the current role map.IServiceIdentifiergetServiceId()Get the service identifier.IFuture<java.util.Set<java.lang.String>>getTrustedPlatforms()Gets the trusted platforms that are specified by names.protected voidinitializeHandshake(java.lang.String cid)Init handshake with other platform.IFuture<java.lang.Object>invokeMethod(java.lang.String methodname, ClassInfo[] argtypes, java.lang.Object[] args, ClassInfo rettype)Invoke a method reflectively.IFuture<java.lang.Boolean>isPrintPlatformSecret()Checks if platform secret is printed.static booleanisSecurityMessage(IMsgHeader header)Checks if a message is a security message.IFuture<java.lang.Boolean>isUsePlatformSecret()Checks if platform secret is used.IFuture<java.lang.Boolean>isValid()Test if the service is valid.protected IFuture<java.util.Map<java.lang.String,java.lang.Object>>loadSettings()Loads the settings.protected voidrefreshCryptosuiteRoles()Refreshed crypto suite roles.IFuture<java.lang.Void>removeNameAuthority(java.lang.String pemcertificate)Remvoes an authority for authenticating platform names.IFuture<java.lang.Void>removeNetwork(java.lang.String networkname, java.lang.String secret)Remove a network.IFuture<java.lang.Void>removeRole(java.lang.String entity, java.lang.String role)Adds a role of an entity (platform or network name).IFuture<java.lang.Void>removeTrustedPlatform(java.lang.String name)Adds a name of an authenticated platform to allow access.protected IFuture<byte[]>requestReencryption(java.lang.String platformname, byte[] content)Request reencryption by source.protected IFuture<java.lang.Void>resetCryptoSuites()Resets the crypto suite in case of security state change (network secret changes etc.).protected voidsaveSettings()Saves the current settings.voidsendSecurityHandshakeMessage(IComponentIdentifier receiver, BasicSecurityMessage message)Sends a security handshake message.protected IFuture<java.lang.Void>sendSecurityMessage(IComponentIdentifier receiver, java.lang.Object message)Sends a security message.IFuture<java.lang.Void>setComponentAccess(IInternalAccess access)Sets the access for the component.IFuture<java.lang.Void>setNetwork(java.lang.String networkname, java.lang.String secret)Sets a new network.IFuture<java.lang.Void>setPlatformSecret(IComponentIdentifier cid, java.lang.String secret)Sets the secret of a platform.IFuture<java.lang.Void>setPrintPlatformSecret(boolean printplatformsecret)Sets whether the platform secret should be printed.voidsetSecInfoMappedRoles(SecurityInfo secinf)Sets the roles of a security info object.voidsetServiceIdentifier(IServiceIdentifier sid)Set the service identifier.IFuture<java.lang.Void>setUsePlatformSecret(boolean useplatformsecret)Sets whether the platform secret should be used.IFuture<java.lang.Void>shutdownService()Shutdown the service.IFuture<java.lang.Void>start()Initialization.IFuture<java.lang.Void>startService()Start the service.
 
- 
- 
- 
Field Detail- 
PROPERTIES_IDpublic static final java.lang.String PROPERTIES_ID Properties id for the settings service.- See Also:
- Constant Field Values
 
 - 
SECURITY_MESSAGEprotected static final java.lang.String SECURITY_MESSAGE Header property for security messages.- See Also:
- Constant Field Values
 
 - 
GLOBAL_NETWORK_NAMEpublic static final java.lang.String GLOBAL_NETWORK_NAME Name of the global network.- See Also:
- Constant Field Values
 
 - 
DEFAULT_GLOBAL_ROOT_CERTIFICATEpublic static final java.lang.String DEFAULT_GLOBAL_ROOT_CERTIFICATE Default root certificate for global network.- See Also:
- Constant Field Values
 
 - 
agentprotected IInternalAccess agent Component access.
 - 
execfeatprotected IExecutionFeature execfeat 
 - 
usesecretprotected boolean usesecret Flag whether to use the platform secret for authentication.
 - 
printsecretprotected boolean printsecret Flag whether the platform secret should be printed during start.
 - 
defaultauthorizationprotected boolean defaultauthorization Flag whether to grant default authorization (allow basic service calls if name, network or platform is authenticated).
 - 
refuseuntrustedprotected boolean refuseuntrusted Flag whether to refuse unauthenticated connections.
 - 
allownoauthnameprotected boolean allownoauthname Flag if connection with platforms without authenticated names are allowed.
 - 
allownonetworkprotected boolean allownonetwork Flag if connection with platforms without authenticated networks are allowed.
 - 
loadjavatruststoreprotected boolean loadjavatruststore Flag whether to use the default Java trust store.
 - 
addglobalnetworkprotected boolean addglobalnetwork Flag if the security should add a global network if no global network is set.
 - 
createdefaultnetworkprotected boolean createdefaultnetwork Flag if the security should create a random default network if no network is set.
 - 
handshaketimeoutprotected long handshaketimeout Handshake timeout.
 - 
handshaketimeoutscaleprotected double handshaketimeoutscale Handshake timeout scale factor.
 - 
resettimeoutscaleprotected double resettimeoutscale Handshake reset scale factor.
 - 
sessionkeylifetimeprotected long sessionkeylifetime Lifetime of session keys, after which the handshake is repeated and a new session key is generated.
 - 
debugprotected boolean debug Flag enabling debug printouts.
 - 
platformsecretprotected AbstractAuthenticationSecret platformsecret Local platform authentication secret.
 - 
remoteplatformsecretsprotected java.util.Map<IComponentIdentifier,AbstractAuthenticationSecret> remoteplatformsecrets Remote platform authentication secrets.
 - 
networksprotected MultiCollection<java.lang.String,AbstractAuthenticationSecret> networks Available virtual networks.
 - 
platformnamecertificateprotected AbstractX509PemSecret platformnamecertificate The platform name certificate if available.
 - 
trustedplatformsprotected java.util.Set<java.lang.String> trustedplatforms The platform names that are trusted and identified by name.
 - 
nameauthoritiesprotected java.util.Set<org.bouncycastle.cert.X509CertificateHolder> nameauthorities Trusted authorities for certifying platform names.
 - 
customnameauthoritiesprotected java.util.Set<org.bouncycastle.cert.X509CertificateHolder> customnameauthorities Custom (non-Java default) trusted authorities for certifying platform names.
 - 
allowedcryptosuitesprotected java.util.Map<java.lang.String,java.lang.Class<?>> allowedcryptosuites Available crypt suites.
 - 
initializingcryptosuitesprotected java.util.Map<java.lang.String,HandshakeState> initializingcryptosuites CryptoSuites currently initializing, value=Handshake state.
 - 
currentcryptosuitesprotected IRwMap<java.lang.String,ICryptoSuite> currentcryptosuites CryptoSuites currently in use.
 - 
expiringcryptosuitesprotected MultiCollection<java.lang.String,Tuple2<ICryptoSuite,java.lang.Long>> expiringcryptosuites CryptoSuites that are expiring with expiration time.
 - 
rolesprotected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> roles Map of entities and associated roles.
 - 
cryptoresetprotected IFuture<java.lang.Void> cryptoreset Crypto-Suite reset in progress.
 - 
cleanuptaskprotected volatile IFuture<java.lang.Void> cleanuptask Task for cleanup duties.
 - 
networknamesprotected java.util.Set<java.lang.String> networknames The list of network names (used by all service identifiers).
 
- 
 - 
Method Detail- 
startpublic IFuture<java.lang.Void> start() Initialization.
 - 
encryptAndSignpublic IFuture<byte[]> encryptAndSign(IMsgHeader header, byte[] content) Encrypts and signs the message for a receiver.- Specified by:
- encryptAndSignin interface- ISecurityService
- Parameters:
- receiver- The receiver.
- content- The content
- Returns:
- Encrypted/signed message.
 
 - 
decryptAndAuthpublic IFuture<Tuple2<ISecurityInfo,byte[]>> decryptAndAuth(IComponentIdentifier sender, byte[] content) Decrypt and authenticates the message from a sender.- Specified by:
- decryptAndAuthin interface- ISecurityService
- Parameters:
- sender- The sender.
- content- The content.
- Returns:
- Decrypted/authenticated message or null on invalid message.
 
 - 
isUsePlatformSecretpublic IFuture<java.lang.Boolean> isUsePlatformSecret() Checks if platform secret is used.- Specified by:
- isUsePlatformSecretin interface- ISecurityService
- Returns:
- True, if so.
 
 - 
setUsePlatformSecretpublic IFuture<java.lang.Void> setUsePlatformSecret(boolean useplatformsecret) Sets whether the platform secret should be used.- Specified by:
- setUsePlatformSecretin interface- ISecurityService
- Parameters:
- useplatformsecret- The flag.
- Returns:
- Null, when done.
 
 - 
isPrintPlatformSecretpublic IFuture<java.lang.Boolean> isPrintPlatformSecret() Checks if platform secret is printed.- Specified by:
- isPrintPlatformSecretin interface- ISecurityService
- Returns:
- True, if so.
 
 - 
setPrintPlatformSecretpublic IFuture<java.lang.Void> setPrintPlatformSecret(boolean printplatformsecret) Sets whether the platform secret should be printed.- Specified by:
- setPrintPlatformSecretin interface- ISecurityService
- Parameters:
- printplatformsecret- The flag.
- Returns:
- Null, when done.
 
 - 
setNetworkpublic IFuture<java.lang.Void> setNetwork(java.lang.String networkname, java.lang.String secret) Sets a new network.- Specified by:
- setNetworkin interface- ISecurityService
- Parameters:
- networkname- The network name.
- secret- The secret.
- Returns:
- Null, when done.
 
 - 
removeNetworkpublic IFuture<java.lang.Void> removeNetwork(java.lang.String networkname, java.lang.String secret) Remove a network.- Specified by:
- removeNetworkin interface- ISecurityService
- Parameters:
- networkname- The network name.
- secret- The secret, null to remove the network completely.
- Returns:
- Null, when done.
 
 - 
getAllKnownNetworkspublic IFuture<MultiCollection<java.lang.String,java.lang.String>> getAllKnownNetworks() Gets the current networks and secrets.- Specified by:
- getAllKnownNetworksin interface- ISecurityService
- Returns:
- The current networks and secrets.
 
 - 
addNameAuthoritypublic IFuture<java.lang.Void> addNameAuthority(java.lang.String pemcertificate) Adds an authority for authenticating platform names.- Specified by:
- addNameAuthorityin interface- ISecurityService
- Parameters:
- pemcertificate- The pem-encoded certificate.
- Returns:
- Null, when done.
 
 - 
removeNameAuthoritypublic IFuture<java.lang.Void> removeNameAuthority(java.lang.String pemcertificate) Remvoes an authority for authenticating platform names.- Specified by:
- removeNameAuthorityin interface- ISecurityService
- Parameters:
- secret- The secret, only X.509 secrets allowed.
- Returns:
- Null, when done.
 
 - 
getNameAuthoritiespublic IFuture<java.util.Set<java.lang.String>> getNameAuthorities() Adds an authority for authenticating platform names.- Specified by:
- getNameAuthoritiesin interface- ISecurityService
- Parameters:
- secret- The secret, only X.509 secrets allowed.
- Returns:
- Null, when done.
 
 - 
getCustomNameAuthoritiespublic IFuture<java.util.Set<java.lang.String>> getCustomNameAuthorities() Gets all authorities not defined in the Java trust store for authenticating platform names.- Specified by:
- getCustomNameAuthoritiesin interface- ISecurityService
- Returns:
- List of name authorities.
 
 - 
getNetworkNamespublic IFuture<java.util.Set<java.lang.String>> getNetworkNames() Gets the current network names.- Specified by:
- getNetworkNamesin interface- ISecurityService
- Returns:
- The current networks names.
 
 - 
addTrustedPlatformpublic IFuture<java.lang.Void> addTrustedPlatform(java.lang.String name) Adds a name of an authenticated platform to allow access.- Specified by:
- addTrustedPlatformin interface- ISecurityService
- Parameters:
- name- The platform name, name must be authenticated with certificate.
- roles- The roles the platform should have, can be null or empty.
- Returns:
- Null, when done.
 
 - 
removeTrustedPlatformpublic IFuture<java.lang.Void> removeTrustedPlatform(java.lang.String name) Adds a name of an authenticated platform to allow access.- Specified by:
- removeTrustedPlatformin interface- ISecurityService
- Parameters:
- name- The platform name.
- Returns:
- Null, when done.
 
 - 
getTrustedPlatformspublic IFuture<java.util.Set<java.lang.String>> getTrustedPlatforms() Gets the trusted platforms that are specified by names.- Specified by:
- getTrustedPlatformsin interface- ISecurityService
- Returns:
- The trusted platforms and their roles.
 
 - 
getNetworkNamesSyncpublic java.util.Set<java.lang.String> getNetworkNamesSync() Gets the current network names.- Returns:
- The current networks names.
 
 - 
getPlatformSecretpublic IFuture<java.lang.String> getPlatformSecret(IComponentIdentifier cid) Gets the secret of a platform if available.- Specified by:
- getPlatformSecretin interface- ISecurityService
- Parameters:
- cid- ID of the platform.
- Returns:
- Encoded secret or null.
 
 - 
setPlatformSecretpublic IFuture<java.lang.Void> setPlatformSecret(IComponentIdentifier cid, java.lang.String secret) Sets the secret of a platform.- Specified by:
- setPlatformSecretin interface- ISecurityService
- Parameters:
- cid- ID of the platform.
- secret- Encoded secret or null to remove.
- Returns:
- Encoded secret or null.
 
 - 
addRolepublic IFuture<java.lang.Void> addRole(java.lang.String entity, java.lang.String role) Adds a role for an entity (platform or network name).- Specified by:
- addRolein interface- ISecurityService
- Parameters:
- entity- The entity name.
- role- The role name.
- Returns:
- Null, when done.
 
 - 
removeRolepublic IFuture<java.lang.Void> removeRole(java.lang.String entity, java.lang.String role) Adds a role of an entity (platform or network name).- Specified by:
- removeRolein interface- ISecurityService
- Parameters:
- entity- The entity name.
- role- The role name.
- Returns:
- Null, when done.
 
 - 
getRoleMappublic IFuture<java.util.Map<java.lang.String,java.util.Set<java.lang.String>>> getRoleMap() Gets a copy of the current role map.- Specified by:
- getRoleMapin interface- ISecurityService
- Returns:
- Copy of the role map.
 
 - 
getJadexVersionpublic JadexVersion getJadexVersion(IComponentIdentifier remoteid) Opportunistically returns the remote Jadex version if known.- Specified by:
- getJadexVersionin interface- ISecurityService
- Parameters:
- remoteid- ID of the remote platform.
- Returns:
- Null, if the version is cannot be determined, a JadexVersion otherwise. Note that the JadexVersion can still be an unknown version (as determined by isUnknown), which means that the platform itself reported an unknown version.
 
 - 
getInternalNetworkspublic MultiCollection<java.lang.String,AbstractAuthenticationSecret> getInternalNetworks() Get access to the stored virtual network configurations.- Returns:
- The stored virtual network configurations.
 
 - 
getInternalPlatformSecretpublic AbstractAuthenticationSecret getInternalPlatformSecret() Gets the local platform secret.
 - 
getInternalPlatformSecretpublic AbstractAuthenticationSecret getInternalPlatformSecret(IComponentIdentifier cid) Gets the secret of a platform if available.- Parameters:
- cid- ID of the platform.
- Returns:
- Secret or null.
 
 - 
getInternalNameAuthoritiespublic java.util.Set<org.bouncycastle.cert.X509CertificateHolder> getInternalNameAuthorities() Gets the name authorities.
 - 
getInternalTrustedPlatformspublic java.util.Set<java.lang.String> getInternalTrustedPlatforms() Gets the trusted platform names.
 - 
getInternalPlatformNameCertificatepublic AbstractX509PemSecret getInternalPlatformNameCertificate() Get the platform name certificate.
 - 
getInternalUsePlatformSecretpublic boolean getInternalUsePlatformSecret() Checks whether to use platform secret.- Returns:
- True, if used.
 
 - 
getInternalRefuseUntrustedpublic boolean getInternalRefuseUntrusted() Checks whether to allow untrusted connections.- Returns:
- True, if used.
 
 - 
getInternalAllowNoAuthNamepublic boolean getInternalAllowNoAuthName() Checks whether to allow connections without name authentication.- Returns:
- True, if used.
 
 - 
getInternalAllowNoNetworkpublic boolean getInternalAllowNoNetwork() Checks whether to allow connections without network authentication.- Returns:
- True, if used.
 
 - 
getInternalDefaultAuthorizationpublic boolean getInternalDefaultAuthorization() Checks whether to allow the default authorization.- Returns:
- True, if used.
 
 - 
setSecInfoMappedRolespublic void setSecInfoMappedRoles(SecurityInfo secinf) Sets the roles of a security info object.- Parameters:
- secinf- Security info.
- defroles- Default roles that should be added.
 
 - 
getComponentIdentifierpublic IComponentIdentifier getComponentIdentifier() Get component ID.
 - 
checkCleanupprotected void checkCleanup() 
 - 
doCleanupprotected void doCleanup() Cleans expired objects.
 - 
resetCryptoSuitesprotected IFuture<java.lang.Void> resetCryptoSuites() Resets the crypto suite in case of security state change (network secret changes etc.).
 - 
createCryptoSuiteprotected ICryptoSuite createCryptoSuite(java.lang.String name, java.lang.String convid, JadexVersion remoteversion, boolean initializer) Creates a crypto suite of a particular name.- Parameters:
- name- Name of the suite.
- convid- Conversation ID of handshake.
- remoteversion- The remote Jadex version.
- initializer- True, if suite should represent the initializer.
- Returns:
- The suite, null if not found.
 
 - 
expireCryptosuiteprotected void expireCryptosuite(java.lang.String pfname) Expires a cryptosuite.- Parameters:
- pfname- Platform name.
 
 - 
refreshCryptosuiteRolesprotected void refreshCryptosuiteRoles() Refreshed crypto suite roles.
 - 
sendSecurityHandshakeMessagepublic void sendSecurityHandshakeMessage(IComponentIdentifier receiver, BasicSecurityMessage message) Sends a security handshake message.- Parameters:
- receiver- Receiver of the message.
- message- The message.
 
 - 
initializeHandshakeprotected void initializeHandshake(java.lang.String cid) Init handshake with other platform.- Parameters:
- cid- The platform id.
 
 - 
loadSettingsprotected IFuture<java.util.Map<java.lang.String,java.lang.Object>> loadSettings() Loads the settings.
 - 
saveSettingsprotected void saveSettings() Saves the current settings.
 - 
sendSecurityMessageprotected IFuture<java.lang.Void> sendSecurityMessage(IComponentIdentifier receiver, java.lang.Object message) Sends a security message.- Parameters:
- receiver- Receiver of the message.
- message- The message.
- Returns:
- Null, when sent.
 
 - 
isSecurityMessagepublic static final boolean isSecurityMessage(IMsgHeader header) Checks if a message is a security message.- Parameters:
- header- The message header.
- Returns:
- True, if security message.
 
 - 
requestReencryptionprotected IFuture<byte[]> requestReencryption(java.lang.String platformname, byte[] content) Request reencryption by source.- Parameters:
- source- Source of the content.
- content- The encrypted content.
- Returns:
- Reply of decryption request, may be exception.
 
 - 
getServiceIdpublic IServiceIdentifier getServiceId() Get the service identifier.- Specified by:
- getServiceIdin interface- IService
- Returns:
- The service identifier.
 
 - 
isValidpublic IFuture<java.lang.Boolean> isValid() Test if the service is valid.
 - 
getPropertyMappublic java.util.Map<java.lang.String,java.lang.Object> getPropertyMap() Get the map of properties (considered as constant).- Specified by:
- getPropertyMapin interface- IService
- Returns:
- The service property map (if any).
 
 - 
startServicepublic IFuture<java.lang.Void> startService() Start the service.- Specified by:
- startServicein interface- IInternalService
- Returns:
- A future that is done when the service has completed starting.
 
 - 
shutdownServicepublic IFuture<java.lang.Void> shutdownService() Shutdown the service.- Specified by:
- shutdownServicein interface- IInternalService
- Returns:
- A future that is done when the service has completed its shutdown.
 
 - 
setComponentAccesspublic IFuture<java.lang.Void> setComponentAccess(IInternalAccess access) Sets the access for the component.- Specified by:
- setComponentAccessin interface- IInternalService
- Parameters:
- access- Component access.
 
 - 
setServiceIdentifierpublic void setServiceIdentifier(IServiceIdentifier sid) Set the service identifier.- Specified by:
- setServiceIdentifierin interface- IInternalService
 
 - 
getPropertyprotected static final <T> T getProperty(java.lang.String property, java.util.Map<java.lang.String,java.lang.Object> args, java.util.Map<java.lang.String,java.lang.Object> settings, T defaultprop)Gets the right property from arguments, settings and default.- Parameters:
- property- Property name.
- args- Arguments.
- settings- Settings.
- defaultprop- Default.
- Returns:
- The property.
 
 - 
flattenRoleMappublic static final java.util.List<Tuple2<java.lang.String,java.lang.String>> flattenRoleMap(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> rolemap) Helper for flattening the role map.
 - 
getNameAuthoritiesInfopublic IFuture<java.lang.String[][]> getNameAuthoritiesInfo() Get infos about name authorities. Format is [{subjectid,dn,custom},...]- Specified by:
- getNameAuthoritiesInfoin interface- ISecurityService
- Returns:
- Infos about the name authorities.
 
 - 
invokeMethodpublic IFuture<java.lang.Object> invokeMethod(java.lang.String methodname, ClassInfo[] argtypes, java.lang.Object[] args, ClassInfo rettype) Invoke a method reflectively.- Specified by:
- invokeMethodin interface- IService
- Parameters:
- methodname- The method name.
- argtypes- The argument types (can be null if method exists only once).
- args- The arguments.
- rettype- The future return type if it is a specific future.
- Returns:
- The result.
 
 - 
getMethodInfospublic IFuture<MethodInfo[]> getMethodInfos() Get reflective info about the service methods, args, return types.- Specified by:
- getMethodInfosin interface- IService
- Returns:
- The method infos.
 
 
- 
 
-