Class X509DSADetector
- All Implemented Interfaces:
Validator<X509Certificate>,net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.IdentifiableComponent,net.shibboleth.shared.component.IdentifiedComponent,net.shibboleth.shared.component.InitializableComponent
The original Digital Signature Algorithm (DSA) is very weak by modern standards, involving a 1024-bit key and the SHA-1 digest algorithm.
By default, this validator adds an ErrorStatus to an
item containing a certificate wrapping a DSA public key, and returns
Validator.Action.DONE
on the basis that further processing of the certificate is unlikely to be desired.
The error property may be set to false to downgrade the
ErrorStatus to a WarningStatus.
The action property may be set to
Validator.Action.CONTINUE if there is a need to
perform additional validation on a DSA certificate.
- Since:
- 0.10.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.shibboleth.metadata.validate.Validator
Validator.Action -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Validator.ActionValidator.Actionto return when a DSA key is detected.private booleanWhether anErrorStatusshould be added on failure. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Validator.ActionReturns theValidator.Actionto be returned if a DSA key is detected.final booleanisError()Returns whether anErrorStatusis being added on failure.voidsetAction(Validator.Action newAction) Sets theValidator.Actionto be returned if a DSA key is detected.voidsetError(boolean newValue) Set whether anErrorStatusshould be added on failure.validate(X509Certificate cert, Item<?> item, String callerId) Apply the validator to a value in the context of the givenItem.Methods inherited from class net.shibboleth.metadata.validate.BaseValidator
addError, addErrorMessage, addErrorMessage, addErrorMessage, addStatus, addWarning, getMessage, makeComponentId, setMessageMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiableComponent
setIdMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
action
Validator.Actionto return when a DSA key is detected. Default:Validator.Action.DONE. -
error
private boolean errorWhether anErrorStatusshould be added on failure. Default:true.
-
-
Constructor Details
-
X509DSADetector
public X509DSADetector()
-
-
Method Details
-
getAction
Returns theValidator.Actionto be returned if a DSA key is detected.- Returns:
- the
Validator.Actionto be returned
-
setAction
Sets theValidator.Actionto be returned if a DSA key is detected.- Parameters:
newAction- theValidator.Actionto be returned
-
setError
public void setError(boolean newValue) Set whether anErrorStatusshould be added on failure.- Parameters:
newValue- whether anErrorStatusshould be added on failure
-
isError
public final boolean isError()Returns whether anErrorStatusis being added on failure.- Returns:
trueif anErrorStatusis being added on failure.
-
validate
@Nonnull public Validator.Action validate(@Nonnull X509Certificate cert, @Nonnull Item<?> item, @Nonnull String callerId) Description copied from interface:ValidatorApply the validator to a value in the context of the givenItem.The validator influences future processing by adding item metadata to the
Item.A common case is that the validator will add a
StatusMetadatato theItem, for example aErrorStatus. In this case, the convention is that thecomponentIdof theErrorStatuswould be created by combining thecallerIdwith a/and the validator's own identifier. For example, a validatorvalcalled by a stagestagewould normally use acomponentIdofstage/val.- Specified by:
validatein interfaceValidator<X509Certificate>- Parameters:
cert- the value to be validateditem- theItemcontext for the validationcallerId- aStringidentifying the caller- Returns:
- an indication of whether to process additional validators
-