Top Description Fields Constructors Methods
org.apache.sshd.common.util.security

public Class SunJCESecurityProviderRegistrar

extends AbstractSecurityProviderRegistrar
Class Inheritance
Imports
java.security.Provider, .Security, java.util.HashMap, .Map, org.apache.sshd.common.util.GenericUtils

This is registrar ensures that even if other registrars are active, we still use the Java built-in security provider at least for some security entities.

The problem is that if the Bouncy Castle registrar is present and enabled, we'll end up using the Bouncy Castle implementations for just about anything. But not all Bouncy Castle versions have native implementations of the algorithms. If BC AES is used and is implemented in Java, performance will be very poor. SunJCE's AES uses native code and is much faster.

If no Bouncy Castle is registered, this extra registrar will not have an effect. Like all registrars, this one can be disabled via a system property org.apache.sshd.security.provider.SunJCEWrapper.enabled=false. Note that this does not disable the fallback to the platform provider; it only disables this wrapper which can be used to force the use of the "SunJCE" standard Java provider even if some other registrar also supports an algorithm (and would thus normally be preferred).

The registrar can be configured as usual. By default it has only the AES cipher and the SHA macs enabled, everything else is disabled.

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final Map<String, String>
Inherited from org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar:
propsproviderHoldersupportedEntities

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getDefaultSecurityEntitySupportValue(Class<?>
The requested entity type - its simple name serves to build the configuration property name.
entityType
)

Overrides default org.apache.sshd.common.util.security.SecurityProviderRegistrar.getDefaultSecurityEntitySupportValue.

public String
public Provider
public String
public boolean
public boolean
public boolean
Inherited from org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar:
createProviderInstancegetNamegetOrCreateProvidergetPropertiesisSecurityEntitySupportedtoString

Field Detail

defaultPropertiesback to summary
private final Map<String, String> defaultProperties

Constructor Detail

SunJCESecurityProviderRegistrarback to summary
public SunJCESecurityProviderRegistrar()

Method Detail

getDefaultSecurityEntitySupportValueback to summary
public String getDefaultSecurityEntitySupportValue(Class<?> entityType)

Overrides default org.apache.sshd.common.util.security.SecurityProviderRegistrar.getDefaultSecurityEntitySupportValue.

Parameters
entityType:Class<?>

Doc from org.apache.sshd.common.util.security.SecurityProviderRegistrar.getDefaultSecurityEntitySupportValue.

The requested entity type - its simple name serves to build the configuration property name.

Returns:String

Doc from org.apache.sshd.common.util.security.SecurityProviderRegistrar.getDefaultSecurityEntitySupportValue.

Configuration value to use if no specific configuration provided - default=empty

Annotations
@Override
getProviderNameback to summary
public String getProviderName()

Overrides default org.apache.sshd.common.util.security.SecurityProviderChoice.getProviderName.

Doc from org.apache.sshd.common.util.security.SecurityProviderChoice.getProviderName.

Retrieves the underlying Provider's name.

Returns:String

the Provider's name

Annotations
@Override
getSecurityProviderback to summary
public Provider getSecurityProvider()

Implements org.apache.sshd.common.util.security.SecurityProviderChoice.getSecurityProvider.

Returns:Provider

Doc from org.apache.sshd.common.util.security.SecurityProviderChoice.getSecurityProvider.

The security Provider to use in case isNamedProviderUsed() is false. Can be null if isNamedProviderUsed() is true, but not recommended.

Annotations
@Override
getStringback to summary
public String getString(String name)

Overrides default org.apache.sshd.common.PropertyResolver.getString.

Annotations
@Override
isEnabledback to summary
public boolean isEnabled()

Overrides default org.apache.sshd.common.util.security.SecurityProviderRegistrar.isEnabled.

Returns:boolean

Doc from org.apache.sshd.common.util.security.SecurityProviderRegistrar.isEnabled.

true if the provider is enabled regardless of whether it is supported - default=true

Note

checks if the provider has been programmatically disabled via SecurityUtils#setAPrioriDisabledProvider(String, boolean)

Annotations
@Override
isNamedProviderUsedback to summary
public boolean isNamedProviderUsed()

Overrides default org.apache.sshd.common.util.security.SecurityProviderRegistrar.isNamedProviderUsed.

Returns:boolean

Doc from org.apache.sshd.common.util.security.SecurityProviderRegistrar.isNamedProviderUsed.

true if to use the provider's name rather than its Provider instance - default=true

Annotations
@Override
isSupportedback to summary
public boolean isSupported()

Implements org.apache.sshd.common.OptionalFeature.isSupported.

Annotations
@Override