public interface SecurityProviderRegistrar extends SecurityProviderChoice, OptionalFeature, PropertyResolver
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL_OPTIONS_VALUE |
static String |
ALL_OPTIONS_WILDCARD |
static String |
CONFIG_PROP_BASE
Base name for configuration properties related to security providers
|
static String |
ENABLED_PROPERTY
Property used to configure whether the provider is enabled regardless of whether it is supported.
|
static String |
NAMED_PROVIDER_PROPERTY
Property used to configure whether to use the provider's name rather than its
Provider instance |
static String |
NO_OPTIONS_VALUE |
static List<Class<?>> |
SECURITY_ENTITIES
All the entities that are used in calls to
isSecurityEntitySupported(Class, String) |
EMPTYBY_NAME_COMPARATOR, NAME_EXTRACTORFALSE, TRUEEMPTY| Modifier and Type | Method and Description |
|---|---|
static SecurityProviderRegistrar |
findSecurityProviderRegistrarBySecurityEntity(Predicate<? super SecurityProviderRegistrar> entitySelector,
Collection<? extends SecurityProviderRegistrar> registrars) |
default String |
getBasePropertyName() |
default String |
getConfigurationPropertyName(String name) |
default String |
getDefaultSecurityEntitySupportValue(Class<?> entityType) |
static String |
getEffectiveSecurityEntityName(Class<?> entityType,
String name)
Determines the "pure" security entity name - e.g., for
Ciphers it strips the trailing
transformation specification in order to extract the base cipher name - e.g., "AES/CBC/NoPadding" =>
"AES" |
default PropertyResolver |
getParentPropertyResolver() |
default Map<String,Object> |
getProperties()
A map of properties that can be used to configure the SSH server or client.
|
static boolean |
isAllOptionsValue(String v) |
default boolean |
isCertificateFactorySupported(String type) |
default boolean |
isCipherSupported(String transformation) |
default boolean |
isEnabled() |
default boolean |
isKeyAgreementSupported(String algorithm) |
default boolean |
isKeyFactorySupported(String algorithm) |
default boolean |
isKeyPairGeneratorSupported(String algorithm) |
default boolean |
isMacSupported(String algorithm) |
default boolean |
isMessageDigestSupported(String algorithm) |
default boolean |
isNamedProviderUsed() |
default boolean |
isSecurityEntitySupported(Class<?> entityType,
String name) |
static boolean |
isSecurityEntitySupported(PropertyResolver resolver,
String propName,
Class<?> entityType,
String name,
String defaultValue) |
static boolean |
isSecurityEntitySupported(SecurityProviderRegistrar registrar,
Class<?> entityType,
String name,
String defaultValue)
Checks whether the requested entity type algorithm/name is listed as supported by the registrar's configuration
|
default boolean |
isSignatureSupported(String algorithm) |
static boolean |
registerSecurityProvider(SecurityProviderRegistrar registrar)
Attempts to register the security provider represented by the registrar if not already registered.
|
createProviderInstance, getSecurityProvider, toSecurityProviderChoice, toSecurityProviderChoicefindByName, findFirstMatchByName, getName, getNameList, getNames, ofName, removeByName, safeCompareByNameall, any, isSupported, ofgetBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty, isEmpty, isEmptystatic final String CONFIG_PROP_BASE
static final String ENABLED_PROPERTY
isEnabled(),
Constant Field Valuesstatic final String NAMED_PROVIDER_PROPERTY
Provider instanceisNamedProviderUsed(),
Constant Field Valuesstatic final String ALL_OPTIONS_VALUE
static final String ALL_OPTIONS_WILDCARD
static final String NO_OPTIONS_VALUE
static final List<Class<?>> SECURITY_ENTITIES
isSecurityEntitySupported(Class, String)default String getBasePropertyName()
default boolean 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)ENABLED_PROPERTYdefault PropertyResolver getParentPropertyResolver()
getParentPropertyResolver in interface PropertyResolvernull if no parentdefault Map<String,Object> getProperties()
PropertyResolverA map of properties that can be used to configure the SSH server or client. This map will never be changed by either the server or client and is not supposed to be changed at runtime (changes are not bound to have any effect on a running client or server), though it may affect the creation of sessions later as these values are usually not cached.
Note: the type of the mapped property should match the expected configuration value type -
Long, Integer, Boolean,
String, etc.... If it doesn't, the toString() result of the mapped value is used to convert it to the
required type. E.g., if the mapped value is the string "1234" and the expected value is a
long then it will be parsed into one. Also, if the mapped value is an Integer but a long
is expected, then it will be converted into one.
getProperties in interface PropertyResolverMap containing configuration values, never null. Note: may be
immutable.default boolean isCipherSupported(String transformation)
transformation - The requested Cipher transformationtrue if this security provider supports the transformationisSecurityEntitySupported(Class, String)default boolean isKeyFactorySupported(String algorithm)
algorithm - The KeyFactory algorithmtrue if this security provider supports the algorithmisSecurityEntitySupported(Class, String)default boolean isMessageDigestSupported(String algorithm)
algorithm - The MessageDigest algorithmtrue if this security provider supports the algorithmisSecurityEntitySupported(Class, String)default boolean isKeyPairGeneratorSupported(String algorithm)
algorithm - The KeyPairGenerator algorithmtrue if this security provider supports the algorithmisSecurityEntitySupported(Class, String)default boolean isKeyAgreementSupported(String algorithm)
algorithm - The KeyAgreement algorithmtrue if this security provider supports the algorithmisSecurityEntitySupported(Class, String)default boolean isMacSupported(String algorithm)
algorithm - The Mac algorithmtrue if this security provider supports the algorithmisSecurityEntitySupported(Class, String)default boolean isSignatureSupported(String algorithm)
algorithm - The Signature algorithmtrue if this security provider supports the algorithmisSecurityEntitySupported(Class, String)default boolean isCertificateFactorySupported(String type)
type - The CertificateFactory typetrue if this security provider supports the algorithmisSecurityEntitySupported(Class, String)default String getDefaultSecurityEntitySupportValue(Class<?> entityType)
entityType - The requested entity type - its simple name serves to build the configuration property name.isSecurityEntitySupported(Class, String)default boolean isSecurityEntitySupported(Class<?> entityType, String name)
default boolean isNamedProviderUsed()
isNamedProviderUsed in interface SecurityProviderChoicetrue if to use the provider's name rather than its Provider instance -
default=trueNAMED_PROVIDER_PROPERTY,
SecurityProviderChoice.getSecurityProvider(),
registerSecurityProvider(SecurityProviderRegistrar)static boolean isAllOptionsValue(String v)
v - Value to be examinedtrue if the value equals (case insensitive) to either ALL_OPTIONS_VALUE or
ALL_OPTIONS_WILDCARDstatic boolean isSecurityEntitySupported(SecurityProviderRegistrar registrar, Class<?> entityType, String name, String defaultValue)
registrar - The SecurityProviderRegistrarentityType - The requested entity type - its simple name serves to build the configuration property name.name - The requested algorithm/name - Note: if the requested entity is a Cipher then
the argument is assumed to be a possible "/" separated transformation and parsed
as such in order to retrieve the pure cipher namedefaultValue - Configuration value to use if no specific configuration providedtrue registrar is supported and the value is listed (case insensitive) or *
the property is one of the "all" markersOptionalFeature.isSupported(),
isAllOptionsValue(String)static boolean isSecurityEntitySupported(PropertyResolver resolver, String propName, Class<?> entityType, String name, String defaultValue)
static String getEffectiveSecurityEntityName(Class<?> entityType, String name)
Ciphers it strips the trailing
transformation specification in order to extract the base cipher name - e.g., "AES/CBC/NoPadding" =>
"AES"entityType - The security entity type - ignored if nullname - The effective name - ignored if null/emptystatic boolean registerSecurityProvider(SecurityProviderRegistrar registrar)
isNamedProviderUsed() is true then the generated provider will be
added to the system's list of known providers.registrar - The SecurityProviderRegistrartrue if no provider was previously registeredSecurity.getProvider(String),
SecurityProviderChoice.getSecurityProvider(),
Security.addProvider(Provider)static SecurityProviderRegistrar findSecurityProviderRegistrarBySecurityEntity(Predicate<? super SecurityProviderRegistrar> entitySelector, Collection<? extends SecurityProviderRegistrar> registrars)
Copyright © 2018–2021 The Apache Software Foundation. All rights reserved.