Class ProviderDetection


  • public class ProviderDetection
    extends Object
    The ProviderDetection class helps in detecting the provider used when coding with JCA's Cryptographic APIs and chooses the corresponding set of CrySL rules that are implemented for that provider.
    Author:
    Enri Ozuni
    • Constructor Detail

      • ProviderDetection

        public ProviderDetection()
    • Method Detail

      • getProvider

        public String getProvider()
      • getRulesDirectory

        public String getRulesDirectory()
      • setRulesDirectory

        protected void setRulesDirectory​(String rulesDirectory)
      • doAnalysis

        public String doAnalysis​(boomerang.callgraph.ObservableICFG<soot.Unit,​soot.SootMethod> observableDynamicICFG,
                                 String rootRulesDirectory)
        This method does the Provider Detection analysis and returns the detected provider after the analysis is finished. If no Provider is detected, then it will return null value, meaning that there was no provider used.
        Parameters:
        observableDynamicICFG - observableDynamicICFG
        rootRulesDirectory - directory for the rules
        Returns:
        the detected provider
      • chooseRules

        public List<CrySLRule> chooseRules​(String providerRulesDirectory)
        This method is used to choose the CryptSL rules in a directory from the detected provider and should be called after the `doAnalysis()` method.
        Parameters:
        providerRulesDirectory - the path to the crysl rules
        Returns:
        CryptSL rules from the detected provider
      • chooseRulesZip

        public List<CrySLRule> chooseRulesZip​(String providerRulesZip)
        This method is used to choose the CryptSL rules in a zip file from the detected provider and should be called after the `doAnalysis()` method.
        Parameters:
        providerRulesZip - the path to the zip file
        Returns:
        list of crysl rules in the zip file