Class SunECSecurityProviderRegistrar
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar
org.apache.sshd.common.util.security.SunECSecurityProviderRegistrar
- All Implemented Interfaces:
NamedResource, OptionalFeature, PropertyResolver, PublicKeyFactory, SecurityProviderChoice, SecurityProviderRegistrar
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.
This registrar can be used to enforce using some security entities from the JDK's SunEC provider even if other registrars also provide the same entity. Care should be taken to use consistent configurations. For instance, to use EC keys from this provider instead of Bouncy Castle, all of "KeyPairGenerator", "KeyFactory", and "Signature" should be set correctly. Mixing SunEC keys with Bouncy Castle signatures won't work.
This registrar is enabled by default. It can be disabled via a system property
org.apache.sshd.security.provider.SunECWrapper.enabled=false.
The registrar can be configured as usual. By default are enabled:
- "Ed25519"
KeyFactory,KeyPairGenerator, andSignature, if "Ed25519" is supported by SunEC- "X25519"
KeyAgreement,KeyFactory, andKeyPairGenerator, if "X25519" is supported by SunEC- "X448"
KeyAgreement,KeyFactory, andKeyPairGenerator, if "X448" is supported by SunEC
Everything else is disabled.
- Author:
- Apache MINA SSHD Project
-
Field Summary
Fields 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 TypeMethodDescriptiongetBoolean(String name) booleangetBooleanProperty(String name, boolean def) getDefaultSecurityEntitySupportValue(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
getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getStringProperty, isEmptyMethods inherited from interface SecurityProviderChoice
getFactoryMethods inherited from interface SecurityProviderRegistrar
getBasePropertyName, getConfigurationPropertyName, getParentPropertyResolver, getPublicKey, isCertificateFactorySupported, isCipherSupported, isKEMSupported, isKeyAgreementSupported, isKeyFactorySupported, isKeyPairGeneratorSupported, isMacSupported, isMessageDigestSupported, isSignatureSupported
-
Constructor Details
-
SunECSecurityProviderRegistrar
public SunECSecurityProviderRegistrar()
-
-
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
-
getBoolean
-
getBooleanProperty
-
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()
-