Package crypto.providerdetection
Class ProviderDetection
- java.lang.Object
-
- crypto.providerdetection.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 Summary
Constructors Constructor Description ProviderDetection()ProviderDetection(CrySLRuleReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.StringdoAnalysis(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.StringgetProvider()StringgetRulesDirectory()protected voidsetRulesDirectory(String rulesDirectory)
-
-
-
Constructor Detail
-
ProviderDetection
public ProviderDetection()
-
ProviderDetection
public ProviderDetection(CrySLRuleReader reader)
-
-
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- observableDynamicICFGrootRulesDirectory- 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
-
-