Class CertificateVerificator

  • All Implemented Interfaces:
    pl.edu.icm.unity.engine.api.authn.CredentialExchange, pl.edu.icm.unity.engine.api.authn.CredentialVerificator, pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator, pl.edu.icm.unity.engine.api.utils.StringConfigurable, CertificateExchange, pl.edu.icm.unity.types.DescribedObject, pl.edu.icm.unity.types.NamedObject

    public class CertificateVerificator
    extends pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
    implements CertificateExchange
    Trivial verificator of certificates. It is assumed that the certificate was previously authenticated. Therefore the only operation is resolving of the certificate user.

    There is no local credential associated with this verificator. Therefore it always returns the correct credential state. Storing credential of this type makes no sense, but works (empty string is stored).

    Author:
    K. Benedyczak
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  CertificateVerificator.Factory  
      • Nested classes/interfaces inherited from interface pl.edu.icm.unity.engine.api.authn.CredentialVerificator

        pl.edu.icm.unity.engine.api.authn.CredentialVerificator.VerificatorType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String DESC  
      static String NAME  
      • Fields inherited from class pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator

        credentialName
      • Fields inherited from class pl.edu.icm.unity.engine.api.authn.AbstractVerificator

        identityResolver, instanceName
    • Constructor Summary

      Constructors 
      Constructor Description
      CertificateVerificator​(pl.edu.icm.unity.engine.api.EntityManagement idMan)  
    • Constructor Detail

      • CertificateVerificator

        @Autowired
        public CertificateVerificator​(@Qualifier("insecure")
                                      pl.edu.icm.unity.engine.api.EntityManagement idMan)
    • Method Detail

      • getSerializedConfiguration

        public String getSerializedConfiguration()
        Specified by:
        getSerializedConfiguration in interface pl.edu.icm.unity.engine.api.utils.StringConfigurable
      • setSerializedConfiguration

        public void setSerializedConfiguration​(String json)
        Specified by:
        setSerializedConfiguration in interface pl.edu.icm.unity.engine.api.utils.StringConfigurable
      • prepareCredential

        public String prepareCredential​(String rawCredential,
                                        String currentCredential,
                                        boolean verify)
                                 throws pl.edu.icm.unity.exceptions.IllegalCredentialException
        Specified by:
        prepareCredential in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
        Throws:
        pl.edu.icm.unity.exceptions.IllegalCredentialException
      • checkCredentialState

        public pl.edu.icm.unity.types.authn.CredentialPublicInformation checkCredentialState​(String currentCredential)
        Specified by:
        checkCredentialState in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
      • checkCertificate

        public pl.edu.icm.unity.engine.api.authn.AuthenticationResult checkCertificate​(X509Certificate[] chain,
                                                                                       String formForUnknown,
                                                                                       boolean enableAssociation,
                                                                                       pl.edu.icm.unity.engine.api.authn.remote.AuthenticationTriggeringContext triggeringContext)
        Specified by:
        checkCertificate in interface CertificateExchange
      • invalidate

        public String invalidate​(String currentCredential)
        Specified by:
        invalidate in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
      • isCredentialSet

        public boolean isCredentialSet​(pl.edu.icm.unity.types.basic.EntityParam entity)
                                throws pl.edu.icm.unity.exceptions.EngineException
        Specified by:
        isCredentialSet in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • isCredentialDefinitionChagneOutdatingCredentials

        public boolean isCredentialDefinitionChagneOutdatingCredentials​(String newCredentialDefinition)
        Specified by:
        isCredentialDefinitionChagneOutdatingCredentials in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator