Class SunJCESecurityProviderRegistrar
- All Implemented Interfaces:
NamedResource, OptionalFeature, PropertyResolver, SecurityProviderChoice, SecurityProviderRegistrar
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.
-
Field Summary
FieldsFields inherited from class AbstractSecurityProviderRegistrar
props, providerHolder, supportedEntitiesFields inherited from class AbstractLoggingBean
logFields inherited from interface NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTORFields inherited from interface OptionalFeature
FALSE, TRUEFields inherited from interface PropertyResolver
EMPTYFields inherited from interface SecurityProviderChoice
EMPTYFields inherited from interface SecurityProviderRegistrar
ALL_OPTIONS_VALUE, ALL_OPTIONS_WILDCARD, CONFIG_PROP_BASE, ENABLED_PROPERTY, NAMED_PROVIDER_PROPERTY, NO_OPTIONS_VALUE, SECURITY_ENTITIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDefaultSecurityEntitySupportValue(Class<?> entityType) Retrieves the underlyingProvider's name.booleanbooleanbooleanMethods inherited from class AbstractSecurityProviderRegistrar
createProviderInstance, getName, getOrCreateProvider, getProperties, isSecurityEntitySupported, toStringMethods inherited from class AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface PropertyResolver
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getStringProperty, isEmptyMethods inherited from interface SecurityProviderRegistrar
getBasePropertyName, getConfigurationPropertyName, getEdDSASupport, getParentPropertyResolver, isCertificateFactorySupported, isCipherSupported, isKeyAgreementSupported, isKeyFactorySupported, isKeyPairGeneratorSupported, isMacSupported, isMessageDigestSupported, isSignatureSupported
-
Field Details
-
defaultProperties
-
-
Constructor Details
-
SunJCESecurityProviderRegistrar
public SunJCESecurityProviderRegistrar()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Returns:
trueif the provider is enabled regardless of whether it is supported - default=true. Note: checks if the provider has been programmatically disabled viaSecurityUtils.setAPrioriDisabledProvider(String, boolean)- See Also:
-
getProviderName
Description copied from interface:SecurityProviderChoiceRetrieves the underlyingProvider's name.- Returns:
- the
Provider's name
-
getDefaultSecurityEntitySupportValue
-
getString
-
isNamedProviderUsed
public boolean isNamedProviderUsed()- Returns:
trueif to use the provider's name rather than itsProviderinstance - default=true- See Also:
-
getSecurityProvider
- Returns:
- The security
Providerto use in caseSecurityProviderChoice.isNamedProviderUsed()isfalse. Can benullifSecurityProviderChoice.isNamedProviderUsed()istrue, but not recommended.
-
isSupported
public boolean isSupported()
-